@@ -1747,7 +1747,7 @@ pub fn is_useful<'p, 'a, 'tcx>(
17471747
17481748 debug ! ( "is_useful_expand_first_col: ty={:#?}, expanding {:#?}" , ty, v. head( ) ) ;
17491749
1750- let v_constructors = pat_constructors ( cx. tcx , cx. param_env , v. head ( ) , ty ) ;
1750+ let v_constructors = pat_constructors ( cx. tcx , cx. param_env , v. head ( ) ) ;
17511751
17521752 if cx. is_non_exhaustive_variant ( v. head ( ) )
17531753 && !cx. is_local ( ty)
@@ -1760,7 +1760,7 @@ pub fn is_useful<'p, 'a, 'tcx>(
17601760
17611761 let matrix_head_ctors: Vec < Constructor < ' _ > > = matrix
17621762 . heads ( )
1763- . flat_map ( |p| pat_constructors ( cx. tcx , cx. param_env , p, ty ) )
1763+ . flat_map ( |p| pat_constructors ( cx. tcx , cx. param_env , p) )
17641764 . filter ( |ctor| !ctor. is_wildcard ( ) )
17651765 . collect ( ) ;
17661766 debug ! ( "matrix_head_ctors = {:#?}" , matrix_head_ctors) ;
@@ -1804,11 +1804,10 @@ fn pat_constructors<'tcx>(
18041804 tcx : TyCtxt < ' tcx > ,
18051805 param_env : ty:: ParamEnv < ' tcx > ,
18061806 pat : & Pat < ' tcx > ,
1807- ty : Ty < ' tcx > ,
18081807) -> SmallVec < [ Constructor < ' tcx > ; 1 ] > {
18091808 match * pat. kind {
18101809 PatKind :: AscribeUserType { ref subpattern, .. } => {
1811- pat_constructors ( tcx, param_env, subpattern, ty )
1810+ pat_constructors ( tcx, param_env, subpattern)
18121811 }
18131812 PatKind :: Binding { .. } | PatKind :: Wild => smallvec ! [ Wildcard ] ,
18141813 PatKind :: Leaf { .. } | PatKind :: Deref { .. } => smallvec ! [ Single ] ,
@@ -1829,9 +1828,9 @@ fn pat_constructors<'tcx>(
18291828 smallvec ! [ ConstantRange ( lo, hi, end) ]
18301829 }
18311830 }
1832- PatKind :: Array { .. } => match ty. kind {
1831+ PatKind :: Array { .. } => match pat . ty . kind {
18331832 ty:: Array ( _, length) => smallvec ! [ FixedLenSlice ( length. eval_usize( tcx, param_env) ) ] ,
1834- _ => span_bug ! ( pat. span, "bad ty {:?} for array pattern" , ty) ,
1833+ _ => span_bug ! ( pat. span, "bad ty {:?} for array pattern" , pat . ty) ,
18351834 } ,
18361835 PatKind :: Slice { ref prefix, ref slice, ref suffix } => {
18371836 let prefix = prefix. len ( ) as u64 ;
0 commit comments