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 b03e7c6 commit 172a6d5Copy full SHA for 172a6d5
compiler/rustc_smir/src/rustc_smir/context.rs
@@ -594,8 +594,13 @@ impl<'tcx> Context for TablesWrapper<'tcx> {
594
fn intrinsic_name(&self, def: InstanceDef) -> Option<Symbol> {
595
let tables = self.0.borrow_mut();
596
let instance = tables.instances[def];
597
- let name = tables.tcx.intrinsic(instance.def_id())?;
598
- Some(name.to_string())
+ if !(matches!(instance.def, ty::InstanceDef::Intrinsic(..))
+ || matches!(instance.def, ty::InstanceDef::Item(..)))
599
+ {
600
+ return None;
601
+ }
602
+ let intrinsic = tables.tcx.intrinsic(instance.def_id())?;
603
+ Some(intrinsic.name.to_string())
604
}
605
606
fn ty_layout(&self, ty: Ty) -> Result<Layout, Error> {
0 commit comments