@@ -17,7 +17,7 @@ use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, ValidityRequirement};
1717use rustc_middle:: ty:: print:: { with_no_trimmed_paths, with_no_visible_paths} ;
1818use rustc_middle:: ty:: { self , Instance , Ty } ;
1919use rustc_session:: config:: OptLevel ;
20- use rustc_span:: { source_map:: Spanned , sym, Span , Symbol } ;
20+ use rustc_span:: { source_map:: Spanned , sym, Span } ;
2121use rustc_target:: abi:: call:: { ArgAbi , FnAbi , PassMode , Reg } ;
2222use rustc_target:: abi:: { self , HasDataLayout , WrappingRange } ;
2323use rustc_target:: spec:: abi:: Abi ;
@@ -672,7 +672,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
672672 & mut self ,
673673 helper : & TerminatorCodegenHelper < ' tcx > ,
674674 bx : & mut Bx ,
675- intrinsic : Option < Symbol > ,
675+ intrinsic : Option < ty :: IntrinsicDef > ,
676676 instance : Option < Instance < ' tcx > > ,
677677 source_info : mir:: SourceInfo ,
678678 target : Option < mir:: BasicBlock > ,
@@ -682,7 +682,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
682682 // Emit a panic or a no-op for `assert_*` intrinsics.
683683 // These are intrinsics that compile to panics so that we can get a message
684684 // which mentions the offending type, even from a const context.
685- let panic_intrinsic = intrinsic. and_then ( |s | ValidityRequirement :: from_intrinsic ( s ) ) ;
685+ let panic_intrinsic = intrinsic. and_then ( |i | ValidityRequirement :: from_intrinsic ( i . name ) ) ;
686686 if let Some ( requirement) = panic_intrinsic {
687687 let ty = instance. unwrap ( ) . args . type_at ( 0 ) ;
688688
@@ -818,7 +818,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
818818 // The arguments we'll be passing. Plus one to account for outptr, if used.
819819 let arg_count = fn_abi. args . len ( ) + fn_abi. ret . is_indirect ( ) as usize ;
820820
821- if intrinsic == Some ( sym:: caller_location) {
821+ if matches ! ( intrinsic, Some ( ty :: IntrinsicDef { name : sym:: caller_location, .. } ) ) {
822822 return if let Some ( target) = target {
823823 let location =
824824 self . get_caller_location ( bx, mir:: SourceInfo { span : fn_span, ..source_info } ) ;
@@ -838,7 +838,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
838838 }
839839
840840 let instance = match intrinsic {
841- None | Some ( sym:: drop_in_place) => instance,
841+ None | Some ( ty :: IntrinsicDef { name : sym:: drop_in_place, .. } ) => instance,
842842 Some ( intrinsic) => {
843843 let mut llargs = Vec :: with_capacity ( 1 ) ;
844844 let ret_dest = self . make_return_dest (
@@ -866,7 +866,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
866866 // third argument must be constant. This is
867867 // checked by const-qualification, which also
868868 // promotes any complex rvalues to constants.
869- if i == 2 && intrinsic == sym:: simd_shuffle {
869+ if i == 2 && intrinsic. name == sym:: simd_shuffle {
870870 if let mir:: Operand :: Constant ( constant) = & arg. node {
871871 let ( llval, ty) = self . simd_shuffle_indices ( bx, constant) ;
872872 return OperandRef {
0 commit comments