@@ -1747,7 +1747,7 @@ pub fn is_useful<'p, 'a, 'tcx>(
1747
1747
1748
1748
debug ! ( "is_useful_expand_first_col: ty={:#?}, expanding {:#?}" , ty, v. head( ) ) ;
1749
1749
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 ( ) ) ;
1751
1751
1752
1752
if cx. is_non_exhaustive_variant ( v. head ( ) )
1753
1753
&& !cx. is_local ( ty)
@@ -1760,7 +1760,7 @@ pub fn is_useful<'p, 'a, 'tcx>(
1760
1760
1761
1761
let matrix_head_ctors: Vec < Constructor < ' _ > > = matrix
1762
1762
. 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) )
1764
1764
. filter ( |ctor| !ctor. is_wildcard ( ) )
1765
1765
. collect ( ) ;
1766
1766
debug ! ( "matrix_head_ctors = {:#?}" , matrix_head_ctors) ;
@@ -1804,11 +1804,10 @@ fn pat_constructors<'tcx>(
1804
1804
tcx : TyCtxt < ' tcx > ,
1805
1805
param_env : ty:: ParamEnv < ' tcx > ,
1806
1806
pat : & Pat < ' tcx > ,
1807
- ty : Ty < ' tcx > ,
1808
1807
) -> SmallVec < [ Constructor < ' tcx > ; 1 ] > {
1809
1808
match * pat. kind {
1810
1809
PatKind :: AscribeUserType { ref subpattern, .. } => {
1811
- pat_constructors ( tcx, param_env, subpattern, ty )
1810
+ pat_constructors ( tcx, param_env, subpattern)
1812
1811
}
1813
1812
PatKind :: Binding { .. } | PatKind :: Wild => smallvec ! [ Wildcard ] ,
1814
1813
PatKind :: Leaf { .. } | PatKind :: Deref { .. } => smallvec ! [ Single ] ,
@@ -1829,9 +1828,9 @@ fn pat_constructors<'tcx>(
1829
1828
smallvec ! [ ConstantRange ( lo, hi, end) ]
1830
1829
}
1831
1830
}
1832
- PatKind :: Array { .. } => match ty. kind {
1831
+ PatKind :: Array { .. } => match pat . ty . kind {
1833
1832
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) ,
1835
1834
} ,
1836
1835
PatKind :: Slice { ref prefix, ref slice, ref suffix } => {
1837
1836
let prefix = prefix. len ( ) as u64 ;
0 commit comments