@@ -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 ;
@@ -680,7 +680,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
680680 & mut self ,
681681 helper : & TerminatorCodegenHelper < ' tcx > ,
682682 bx : & mut Bx ,
683- intrinsic : Option < Symbol > ,
683+ intrinsic : Option < ty :: IntrinsicDef > ,
684684 instance : Option < Instance < ' tcx > > ,
685685 source_info : mir:: SourceInfo ,
686686 target : Option < mir:: BasicBlock > ,
@@ -690,7 +690,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
690690 // Emit a panic or a no-op for `assert_*` intrinsics.
691691 // These are intrinsics that compile to panics so that we can get a message
692692 // which mentions the offending type, even from a const context.
693- let panic_intrinsic = intrinsic. and_then ( |s | ValidityRequirement :: from_intrinsic ( s ) ) ;
693+ let panic_intrinsic = intrinsic. and_then ( |i | ValidityRequirement :: from_intrinsic ( i . name ) ) ;
694694 if let Some ( requirement) = panic_intrinsic {
695695 let ty = instance. unwrap ( ) . args . type_at ( 0 ) ;
696696
@@ -826,7 +826,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
826826 // The arguments we'll be passing. Plus one to account for outptr, if used.
827827 let arg_count = fn_abi. args . len ( ) + fn_abi. ret . is_indirect ( ) as usize ;
828828
829- if intrinsic == Some ( sym:: caller_location) {
829+ if matches ! ( intrinsic, Some ( ty :: IntrinsicDef { name : sym:: caller_location, .. } ) ) {
830830 return if let Some ( target) = target {
831831 let location =
832832 self . get_caller_location ( bx, mir:: SourceInfo { span : fn_span, ..source_info } ) ;
@@ -846,7 +846,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
846846 }
847847
848848 let instance = match intrinsic {
849- None | Some ( sym:: drop_in_place) => instance,
849+ None | Some ( ty :: IntrinsicDef { name : sym:: drop_in_place, .. } ) => instance,
850850 Some ( intrinsic) => {
851851 let mut llargs = Vec :: with_capacity ( 1 ) ;
852852 let ret_dest = self . make_return_dest (
@@ -873,7 +873,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
873873 // The indices passed to simd_shuffle in the
874874 // third argument must be constant. This is
875875 // checked by the type-checker.
876- if i == 2 && intrinsic == sym:: simd_shuffle {
876+ if i == 2 && intrinsic. name == sym:: simd_shuffle {
877877 if let mir:: Operand :: Constant ( constant) = & arg. node {
878878 let ( llval, ty) = self . simd_shuffle_indices ( bx, constant) ;
879879 return OperandRef {
0 commit comments