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.
1 parent f6aa3ee commit 50559ceCopy full SHA for 50559ce
compiler/rustc_middle/src/mir/consts.rs
@@ -509,8 +509,9 @@ impl<'tcx> Const<'tcx> {
509
Const::Ty(c) => match c.kind() {
510
ty::ConstKind::Param(..) => true,
511
// A valtree may be a reference. Valtree references correspond to a
512
- // different allocation each time they are evaluated.
513
- ty::ConstKind::Value(_) => false,
+ // different allocation each time they are evaluated. Valtrees for primitive
+ // types are fine though.
514
+ ty::ConstKind::Value(_) => c.ty().is_primitive(),
515
ty::ConstKind::Unevaluated(..) | ty::ConstKind::Expr(..) => false,
516
// Should not appear in runtime MIR.
517
ty::ConstKind::Infer(..)
0 commit comments