]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: [E0658] Unstable langauge feature
authorMuhammad Mahad <mahadtxt@gmail.com>
Tue, 8 Aug 2023 19:27:08 +0000 (00:27 +0500)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:28 +0000 (19:00 +0100)
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>
gcc/rust/checks/errors/rust-const-checker.cc
gcc/rust/checks/errors/rust-feature-gate.cc

index e7e2bf781fc6c2abb96546ad274898b773f52094..03b8f6a7c205b6daae1e0753a7aa24914d34fb56 100644 (file)
@@ -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");
 }
 
index 11f6675b4701e42c87205e5ed02d3350120308c9..0f6b6c06582613277305677ac54fcd8ea9ad642d 100644 (file)
@@ -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 ());
        }
     }