diff --git a/gcc/rust/checks/errors/rust-const-checker.cc b/gcc/rust/checks/errors/rust-const-checker.cc index 43618345a538..50f56af2d854 100644 --- a/gcc/rust/checks/errors/rust-const-checker.cc +++ b/gcc/rust/checks/errors/rust-const-checker.cc @@ -861,7 +861,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 a90944e45ab1..29bc2fbea93c 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 ()); } }