@@ -766,7 +766,7 @@ impl<'p, 'tcx> RustcMatchCheckCtxt<'p, 'tcx> {
766
766
let mut subpatterns = pat. iter_fields ( ) . map ( |p| Box :: new ( cx. hoist_witness_pat ( p) ) ) ;
767
767
let kind = match pat. ctor ( ) {
768
768
Bool ( b) => PatKind :: Constant { value : mir:: Const :: from_bool ( cx. tcx , * b) } ,
769
- IntRange ( range) => return self . hoist_pat_range ( range, pat. ty ( ) ) ,
769
+ IntRange ( range) => return self . hoist_pat_range ( range, * pat. ty ( ) ) ,
770
770
Struct | Variant ( _) | UnionField => match pat. ty ( ) . kind ( ) {
771
771
ty:: Tuple ( ..) => PatKind :: Leaf {
772
772
subpatterns : subpatterns
@@ -785,7 +785,7 @@ impl<'p, 'tcx> RustcMatchCheckCtxt<'p, 'tcx> {
785
785
RustcMatchCheckCtxt :: variant_index_for_adt ( & pat. ctor ( ) , * adt_def) ;
786
786
let variant = & adt_def. variant ( variant_index) ;
787
787
let subpatterns = cx
788
- . list_variant_nonhidden_fields ( pat. ty ( ) , variant)
788
+ . list_variant_nonhidden_fields ( * pat. ty ( ) , variant)
789
789
. zip ( subpatterns)
790
790
. map ( |( ( field, _ty) , pattern) | FieldPat { field, pattern } )
791
791
. collect ( ) ;
@@ -796,7 +796,7 @@ impl<'p, 'tcx> RustcMatchCheckCtxt<'p, 'tcx> {
796
796
PatKind :: Leaf { subpatterns }
797
797
}
798
798
}
799
- _ => bug ! ( "unexpected ctor for type {:?} {:?}" , pat. ctor( ) , pat. ty( ) ) ,
799
+ _ => bug ! ( "unexpected ctor for type {:?} {:?}" , pat. ctor( ) , * pat. ty( ) ) ,
800
800
} ,
801
801
// Note: given the expansion of `&str` patterns done in `expand_pattern`, we should
802
802
// be careful to reconstruct the correct constant pattern here. However a string
@@ -961,21 +961,21 @@ impl<'p, 'tcx> TypeCx for RustcMatchCheckCtxt<'p, 'tcx> {
961
961
self . tcx . features ( ) . exhaustive_patterns
962
962
}
963
963
964
- fn ctor_arity ( & self , ctor : & crate :: constructor:: Constructor < Self > , ty : Self :: Ty ) -> usize {
965
- self . ctor_arity ( ctor, ty)
964
+ fn ctor_arity ( & self , ctor : & crate :: constructor:: Constructor < Self > , ty : & Self :: Ty ) -> usize {
965
+ self . ctor_arity ( ctor, * ty)
966
966
}
967
967
fn ctor_sub_tys (
968
968
& self ,
969
969
ctor : & crate :: constructor:: Constructor < Self > ,
970
- ty : Self :: Ty ,
970
+ ty : & Self :: Ty ,
971
971
) -> & [ Self :: Ty ] {
972
- self . ctor_sub_tys ( ctor, ty)
972
+ self . ctor_sub_tys ( ctor, * ty)
973
973
}
974
974
fn ctors_for_ty (
975
975
& self ,
976
- ty : Self :: Ty ,
976
+ ty : & Self :: Ty ,
977
977
) -> Result < crate :: constructor:: ConstructorSet < Self > , Self :: Error > {
978
- self . ctors_for_ty ( ty)
978
+ self . ctors_for_ty ( * ty)
979
979
}
980
980
981
981
fn debug_pat (
@@ -994,7 +994,7 @@ impl<'p, 'tcx> TypeCx for RustcMatchCheckCtxt<'p, 'tcx> {
994
994
overlaps_on : IntRange ,
995
995
overlaps_with : & [ & crate :: pat:: DeconstructedPat < ' _ , Self > ] ,
996
996
) {
997
- let overlap_as_pat = self . hoist_pat_range ( & overlaps_on, pat. ty ( ) ) ;
997
+ let overlap_as_pat = self . hoist_pat_range ( & overlaps_on, * pat. ty ( ) ) ;
998
998
let overlaps: Vec < _ > = overlaps_with
999
999
. iter ( )
1000
1000
. map ( |pat| pat. data ( ) . unwrap ( ) . span )
0 commit comments