We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
const_mut_refs
1 parent a6008fa commit a320ef7Copy full SHA for a320ef7
compiler/rustc_mir/src/transform/check_consts/ops.rs
@@ -535,6 +535,7 @@ impl NonConstOp for UnsizingCast {
535
}
536
537
538
+// Types that cannot appear in the signature or locals of a `const fn`.
539
pub mod ty {
540
use super::*;
541
@@ -548,7 +549,13 @@ pub mod ty {
548
549
550
551
fn emit_error(&self, ccx: &ConstCx<'_, '_>, span: Span) {
- mcf_emit_error(ccx, span, "mutable references in const fn are unstable");
552
+ feature_err(
553
+ &ccx.tcx.sess.parse_sess,
554
+ sym::const_mut_refs,
555
+ span,
556
+ &format!("mutable references are not allowed in {}s", ccx.const_kind()),
557
+ )
558
+ .emit()
559
560
561
0 commit comments