Rollup merge of #115749 - oli-obk:smir_consts, r=compiler-errors
Allow loading the SMIR for constants and statics cc https://github.com/rust-lang/project-stable-mir/issues/34 before this PR we were ICEing when trying to access the SMIR of anything other than functions
This commit is contained in:
commit
2a087be735
2 changed files with 7 additions and 1 deletions
|
@ -84,7 +84,7 @@ impl<'tcx> Context for Tables<'tcx> {
|
|||
|
||||
fn mir_body(&mut self, item: stable_mir::DefId) -> stable_mir::mir::Body {
|
||||
let def_id = self[item];
|
||||
let mir = self.tcx.optimized_mir(def_id);
|
||||
let mir = self.tcx.instance_mir(ty::InstanceDef::Item(def_id));
|
||||
stable_mir::mir::Body {
|
||||
blocks: mir
|
||||
.basic_blocks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue