1
Fork 0

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:
Matthias Krüger 2023-09-11 21:16:23 +02:00 committed by GitHub
commit 2a087be735
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -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