We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e87ef94 commit ef49daaCopy full SHA for ef49daa
compiler/rustc_mir_build/src/build/mod.rs
@@ -29,7 +29,13 @@ crate fn mir_built<'tcx>(
29
return tcx.mir_built(def);
30
}
31
32
- tcx.alloc_steal_mir(mir_build(tcx, def))
+ let mut body = mir_build(tcx, def);
33
+ if def.const_param_did.is_some() {
34
+ assert!(matches!(body.source.instance, ty::InstanceDef::Item(_)));
35
+ body.source = MirSource::from_instance(ty::InstanceDef::Item(def.to_global()));
36
+ }
37
+
38
+ tcx.alloc_steal_mir(body)
39
40
41
/// Construct the MIR for a given `DefId`.
0 commit comments