Skip to content

Commit ef49daa

Browse files
Is this really the best we can do?
1 parent e87ef94 commit ef49daa

File tree

1 file changed

+7
-1
lines changed
  • compiler/rustc_mir_build/src/build

1 file changed

+7
-1
lines changed

compiler/rustc_mir_build/src/build/mod.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ crate fn mir_built<'tcx>(
2929
return tcx.mir_built(def);
3030
}
3131

32-
tcx.alloc_steal_mir(mir_build(tcx, def))
32+
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)
3339
}
3440

3541
/// Construct the MIR for a given `DefId`.

0 commit comments

Comments
 (0)