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>
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");
}
{
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 ());
}
}