@@ -587,27 +587,14 @@ impl<'tcx> Context for TablesWrapper<'tcx> {
587
587
}
588
588
}
589
589
590
- /// Retrieve the plain intrinsic name of an instance if it's an intrinsic.
591
- fn intrinsic_name ( & self , def : InstanceDef ) -> Option < Symbol > {
590
+ /// Retrieve the plain intrinsic name of an instance.
591
+ ///
592
+ /// This assumes that the instance is an intrinsic.
593
+ fn intrinsic_name ( & self , def : InstanceDef ) -> Symbol {
592
594
let tables = self . 0 . borrow_mut ( ) ;
593
595
let instance = tables. instances [ def] ;
594
- match instance. def {
595
- ty:: InstanceDef :: Intrinsic ( ..) | ty:: InstanceDef :: Item ( ..) => {
596
- let intrinsic = tables. tcx . intrinsic ( instance. def_id ( ) ) ?;
597
- Some ( intrinsic. name . to_string ( ) )
598
- }
599
- ty:: InstanceDef :: VTableShim ( ..)
600
- | ty:: InstanceDef :: ReifyShim ( ..)
601
- | ty:: InstanceDef :: Virtual ( ..)
602
- | ty:: InstanceDef :: ThreadLocalShim ( ..)
603
- | ty:: InstanceDef :: ClosureOnceShim { .. }
604
- | ty:: InstanceDef :: ConstructCoroutineInClosureShim { .. }
605
- | ty:: InstanceDef :: CoroutineKindShim { .. }
606
- | ty:: InstanceDef :: DropGlue ( ..)
607
- | ty:: InstanceDef :: FnPtrShim ( ..)
608
- | ty:: InstanceDef :: CloneShim ( ..)
609
- | ty:: InstanceDef :: FnPtrAddrShim ( ..) => None ,
610
- }
596
+ let intrinsic = tables. tcx . intrinsic ( instance. def_id ( ) ) . unwrap ( ) ;
597
+ intrinsic. name . to_string ( )
611
598
}
612
599
613
600
fn ty_layout ( & self , ty : Ty ) -> Result < Layout , Error > {
0 commit comments