@@ -17,7 +17,7 @@ use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, ValidityRequirement};
17
17
use rustc_middle:: ty:: print:: { with_no_trimmed_paths, with_no_visible_paths} ;
18
18
use rustc_middle:: ty:: { self , Instance , Ty } ;
19
19
use rustc_session:: config:: OptLevel ;
20
- use rustc_span:: { source_map:: Spanned , sym, Span , Symbol } ;
20
+ use rustc_span:: { source_map:: Spanned , sym, Span } ;
21
21
use rustc_target:: abi:: call:: { ArgAbi , FnAbi , PassMode , Reg } ;
22
22
use rustc_target:: abi:: { self , HasDataLayout , WrappingRange } ;
23
23
use rustc_target:: spec:: abi:: Abi ;
@@ -680,7 +680,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
680
680
& mut self ,
681
681
helper : & TerminatorCodegenHelper < ' tcx > ,
682
682
bx : & mut Bx ,
683
- intrinsic : Option < Symbol > ,
683
+ intrinsic : Option < ty :: IntrinsicDef > ,
684
684
instance : Option < Instance < ' tcx > > ,
685
685
source_info : mir:: SourceInfo ,
686
686
target : Option < mir:: BasicBlock > ,
@@ -690,7 +690,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
690
690
// Emit a panic or a no-op for `assert_*` intrinsics.
691
691
// These are intrinsics that compile to panics so that we can get a message
692
692
// 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 ) ) ;
694
694
if let Some ( requirement) = panic_intrinsic {
695
695
let ty = instance. unwrap ( ) . args . type_at ( 0 ) ;
696
696
@@ -826,7 +826,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
826
826
// The arguments we'll be passing. Plus one to account for outptr, if used.
827
827
let arg_count = fn_abi. args . len ( ) + fn_abi. ret . is_indirect ( ) as usize ;
828
828
829
- if intrinsic == Some ( sym:: caller_location) {
829
+ if matches ! ( intrinsic, Some ( ty :: IntrinsicDef { name : sym:: caller_location, .. } ) ) {
830
830
return if let Some ( target) = target {
831
831
let location =
832
832
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> {
846
846
}
847
847
848
848
let instance = match intrinsic {
849
- None | Some ( sym:: drop_in_place) => instance,
849
+ None | Some ( ty :: IntrinsicDef { name : sym:: drop_in_place, .. } ) => instance,
850
850
Some ( intrinsic) => {
851
851
let mut llargs = Vec :: with_capacity ( 1 ) ;
852
852
let ret_dest = self . make_return_dest (
@@ -873,7 +873,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
873
873
// The indices passed to simd_shuffle in the
874
874
// third argument must be constant. This is
875
875
// checked by the type-checker.
876
- if i == 2 && intrinsic == sym:: simd_shuffle {
876
+ if i == 2 && intrinsic. name == sym:: simd_shuffle {
877
877
if let mir:: Operand :: Constant ( constant) = & arg. node {
878
878
let ( llval, ty) = self . simd_shuffle_indices ( bx, constant) ;
879
879
return OperandRef {
0 commit comments