Skip to content

Commit be04efc

Browse files
MahadMuhammadphilberty
authored andcommitted
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 <[email protected]>
1 parent 87172a8 commit be04efc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

gcc/rust/checks/errors/rust-const-checker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ void
862862
ConstChecker::visit (ReferenceType &type)
863863
{
864864
if (const_context.is_in_context () && type.is_mut ())
865-
rust_error_at (type.get_locus (),
865+
rust_error_at (type.get_locus (), ErrorCode::E0658,
866866
"mutable references are not allowed in constant functions");
867867
}
868868

gcc/rust/checks/errors/rust-feature-gate.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ FeatureGate::gate (Feature::Name name, location_t loc,
8686
{
8787
const char *fmt_str
8888
= "%s. add `#![feature(%s)]` to the crate attributes to enable.";
89-
rust_error_at (loc, fmt_str, error_msg.c_str (),
89+
rust_error_at (loc, ErrorCode::E0658, fmt_str, error_msg.c_str (),
9090
feature.as_string ().c_str ());
9191
}
9292
}

0 commit comments

Comments
 (0)