@@ -20,14 +20,14 @@ pub(crate) fn fn_sig_for_fn_abi<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx
20
20
21
21
// FIXME(davidtwco,eddyb): A `ParamEnv` should be passed through to this function.
22
22
let ty = instance. ty ( tcx, ty:: ParamEnv :: reveal_all ( ) ) ;
23
- match ty. kind {
23
+ match * ty. kind ( ) {
24
24
ty:: FnDef ( ..) => {
25
25
// HACK(davidtwco,eddyb): This is a workaround for polymorphization considering
26
26
// parameters unused if they show up in the signature, but not in the `mir::Body`
27
27
// (i.e. due to being inside a projection that got normalized, see
28
28
// `src/test/ui/polymorphization/normalized_sig_types.rs`), and codegen not keeping
29
29
// track of a polymorphization `ParamEnv` to allow normalizing later.
30
- let mut sig = match ty. kind {
30
+ let mut sig = match * ty. kind ( ) {
31
31
ty:: FnDef ( def_id, substs) => tcx
32
32
. normalize_erasing_regions ( tcx. param_env ( def_id) , tcx. fn_sig ( def_id) )
33
33
. subst ( tcx, substs) ,
@@ -65,13 +65,13 @@ pub(crate) fn fn_sig_for_fn_abi<'tcx>(tcx: TyCtxt<'tcx>, instance: Instance<'tcx
65
65
let env_region = ty:: ReLateBound ( ty:: INNERMOST , ty:: BrEnv ) ;
66
66
let env_ty = tcx. mk_mut_ref ( tcx. mk_region ( env_region) , ty) ;
67
67
68
- let pin_did = tcx. require_lang_item ( rustc_hir:: LangItem :: PinTypeLangItem , None ) ;
68
+ let pin_did = tcx. require_lang_item ( rustc_hir:: LangItem :: Pin , None ) ;
69
69
let pin_adt_ref = tcx. adt_def ( pin_did) ;
70
70
let pin_substs = tcx. intern_substs ( & [ env_ty. into ( ) ] ) ;
71
71
let env_ty = tcx. mk_adt ( pin_adt_ref, pin_substs) ;
72
72
73
73
sig. map_bound ( |sig| {
74
- let state_did = tcx. require_lang_item ( rustc_hir:: LangItem :: GeneratorStateLangItem , None ) ;
74
+ let state_did = tcx. require_lang_item ( rustc_hir:: LangItem :: GeneratorState , None ) ;
75
75
let state_adt_ref = tcx. adt_def ( state_did) ;
76
76
let state_substs =
77
77
tcx. intern_substs ( & [ sig. yield_ty . into ( ) , sig. return_ty . into ( ) ] ) ;
@@ -116,7 +116,7 @@ fn clif_sig_from_fn_sig<'tcx>(
116
116
Abi :: SysV64 => ( CallConv :: SystemV , sig. inputs ( ) . to_vec ( ) , sig. output ( ) ) ,
117
117
Abi :: RustCall => {
118
118
assert_eq ! ( sig. inputs( ) . len( ) , 2 ) ;
119
- let extra_args = match sig. inputs ( ) . last ( ) . unwrap ( ) . kind {
119
+ let extra_args = match sig. inputs ( ) . last ( ) . unwrap ( ) . kind ( ) {
120
120
ty:: Tuple ( ref tupled_arguments) => tupled_arguments,
121
121
_ => bug ! ( "argument to function with \" rust-call\" ABI is not a tuple" ) ,
122
122
} ;
@@ -307,7 +307,7 @@ impl<'tcx, B: Backend + 'static> FunctionCx<'_, 'tcx, B> {
307
307
} )
308
308
. unzip ( ) ;
309
309
let return_layout = self . layout_of ( return_ty) ;
310
- let return_tys = if let ty:: Tuple ( tup) = return_ty. kind {
310
+ let return_tys = if let ty:: Tuple ( tup) = return_ty. kind ( ) {
311
311
tup. types ( ) . map ( |ty| self . clif_type ( ty) . unwrap ( ) ) . collect ( )
312
312
} else {
313
313
vec ! [ self . clif_type( return_ty) . unwrap( ) ]
@@ -379,7 +379,7 @@ pub(crate) fn codegen_fn_prelude<'tcx>(
379
379
// to reconstruct it into a tuple local variable, from multiple
380
380
// individual function arguments.
381
381
382
- let tupled_arg_tys = match arg_ty. kind {
382
+ let tupled_arg_tys = match arg_ty. kind ( ) {
383
383
ty:: Tuple ( ref tys) => tys,
384
384
_ => bug ! ( "spread argument isn't a tuple?! but {:?}" , arg_ty) ,
385
385
} ;
@@ -500,7 +500,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
500
500
let destination = destination. map ( |( place, bb) | ( trans_place ( fx, place) , bb) ) ;
501
501
502
502
// Handle special calls like instrinsics and empty drop glue.
503
- let instance = if let ty:: FnDef ( def_id, substs) = fn_ty. kind {
503
+ let instance = if let ty:: FnDef ( def_id, substs) = * fn_ty. kind ( ) {
504
504
let instance = ty:: Instance :: resolve ( fx. tcx , ty:: ParamEnv :: reveal_all ( ) , def_id, substs)
505
505
. unwrap ( )
506
506
. unwrap ( )
@@ -553,7 +553,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
553
553
let self_arg = trans_operand ( fx, & args[ 0 ] ) ;
554
554
let pack_arg = trans_operand ( fx, & args[ 1 ] ) ;
555
555
556
- let tupled_arguments = match pack_arg. layout ( ) . ty . kind {
556
+ let tupled_arguments = match pack_arg. layout ( ) . ty . kind ( ) {
557
557
ty:: Tuple ( ref tupled_arguments) => tupled_arguments,
558
558
_ => bug ! ( "argument to function with \" rust-call\" ABI is not a tuple" ) ,
559
559
} ;
@@ -715,7 +715,7 @@ pub(crate) fn codegen_drop<'tcx>(
715
715
) ;
716
716
assert_eq ! ( fn_sig. output( ) , fx. tcx. mk_unit( ) ) ;
717
717
718
- match ty. kind {
718
+ match ty. kind ( ) {
719
719
ty:: Dynamic ( ..) => {
720
720
let ( ptr, vtable) = drop_place. to_ptr_maybe_unsized ( ) ;
721
721
let ptr = ptr. get_addr ( fx) ;
0 commit comments