diff options
author | Muhammad Mahad <mahadtxt@gmail.com> | 2023-08-09 00:27:08 +0500 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-08-09 09:19:01 +0000 |
commit | be04efc9ce7d97ea88d0236c181135e345d3a518 (patch) | |
tree | 3eb0af7d4927579ed5e3e4354ee42997d12de138 | |
parent | 87172a8bf9fe577be000b389ff8a45d5fcb326dc (diff) | |
download | gcc-be04efc9ce7d97ea88d0236c181135e345d3a518.zip gcc-be04efc9ce7d97ea88d0236c181135e345d3a518.tar.gz gcc-be04efc9ce7d97ea88d0236c181135e345d3a518.tar.bz2 |
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 <mahadtxt@gmail.com>
-rw-r--r-- | gcc/rust/checks/errors/rust-const-checker.cc | 2 | ||||
-rw-r--r-- | gcc/rust/checks/errors/rust-feature-gate.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/checks/errors/rust-const-checker.cc b/gcc/rust/checks/errors/rust-const-checker.cc index 599854a..a7c289f 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 a90944e..29bc2fb 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 ()); } } |