Skip to content

Commit

Permalink
gccrs: [E0658] Unstable langauge feature
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
MahadMuhammad authored and philberty committed Aug 9, 2023
1 parent 87172a8 commit be04efc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gcc/rust/checks/errors/rust-const-checker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
2 changes: 1 addition & 1 deletion gcc/rust/checks/errors/rust-feature-gate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 ());
}
}
Expand Down

0 comments on commit be04efc

Please sign in to comment.