From: Muhammad Mahad Date: Tue, 8 Aug 2023 19:27:08 +0000 (+0500) Subject: gccrs: [E0658] Unstable langauge feature X-Git-Tag: basepoints/gcc-15~2243 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a60bafec5a093a19d81000468789c153d0112db8;p=thirdparty%2Fgcc.git gccrs: [E0658] Unstable langauge feature gcc/rust/ChangeLog: * checks/errors/rust-const-checker.cc (ConstChecker::visit): Use of mutable reference in constant functions. * checks/errors/rust-feature-gate.cc (FeatureGate::gate): ErrorCode for intrinsics are subject to change. Signed-off-by: Muhammad Mahad --- diff --git a/gcc/rust/checks/errors/rust-const-checker.cc b/gcc/rust/checks/errors/rust-const-checker.cc index e7e2bf781fc6..03b8f6a7c205 100644 --- a/gcc/rust/checks/errors/rust-const-checker.cc +++ b/gcc/rust/checks/errors/rust-const-checker.cc @@ -862,7 +862,7 @@ void ConstChecker::visit (ReferenceType &type) { if (const_context.is_in_context () && type.is_mut ()) - rust_error_at (type.get_locus (), + rust_error_at (type.get_locus (), ErrorCode::E0658, "mutable references are not allowed in constant functions"); } diff --git a/gcc/rust/checks/errors/rust-feature-gate.cc b/gcc/rust/checks/errors/rust-feature-gate.cc index 11f6675b4701..0f6b6c065826 100644 --- a/gcc/rust/checks/errors/rust-feature-gate.cc +++ b/gcc/rust/checks/errors/rust-feature-gate.cc @@ -86,7 +86,7 @@ FeatureGate::gate (Feature::Name name, location_t loc, { const char *fmt_str = "%s. add `#![feature(%s)]` to the crate attributes to enable."; - rust_error_at (loc, fmt_str, error_msg.c_str (), + rust_error_at (loc, ErrorCode::E0658, fmt_str, error_msg.c_str (), feature.as_string ().c_str ()); } }