@@ -1632,7 +1632,7 @@ pub fn is_useful<'p, 'a, 'tcx>(
1632
1632
1633
1633
debug ! ( "is_useful_expand_first_col: pcx={:#?}, expanding {:#?}" , pcx, v. head( ) ) ;
1634
1634
1635
- if let Some ( constructor) = pat_constructor ( cx, v. head ( ) , pcx ) {
1635
+ if let Some ( constructor) = pat_constructor ( cx, v. head ( ) ) {
1636
1636
debug ! ( "is_useful - expanding constructor: {:#?}" , constructor) ;
1637
1637
split_grouped_constructors (
1638
1638
cx. tcx ,
@@ -1651,7 +1651,7 @@ pub fn is_useful<'p, 'a, 'tcx>(
1651
1651
debug ! ( "is_useful - expanding wildcard" ) ;
1652
1652
1653
1653
let used_ctors: Vec < Constructor < ' _ > > =
1654
- matrix. heads ( ) . filter_map ( |p| pat_constructor ( cx, p, pcx ) ) . collect ( ) ;
1654
+ matrix. heads ( ) . filter_map ( |p| pat_constructor ( cx, p) ) . collect ( ) ;
1655
1655
debug ! ( "used_ctors = {:#?}" , used_ctors) ;
1656
1656
// `all_ctors` are all the constructors for the given type, which
1657
1657
// should all be represented (or caught with the wild pattern `_`).
@@ -1756,10 +1756,9 @@ fn is_useful_specialized<'p, 'a, 'tcx>(
1756
1756
fn pat_constructor < ' tcx > (
1757
1757
cx : & mut MatchCheckCtxt < ' _ , ' tcx > ,
1758
1758
pat : & Pat < ' tcx > ,
1759
- pcx : PatCtxt < ' tcx > ,
1760
1759
) -> Option < Constructor < ' tcx > > {
1761
1760
match * pat. kind {
1762
- PatKind :: AscribeUserType { ref subpattern, .. } => pat_constructor ( cx, subpattern, pcx ) ,
1761
+ PatKind :: AscribeUserType { ref subpattern, .. } => pat_constructor ( cx, subpattern) ,
1763
1762
PatKind :: Binding { .. } | PatKind :: Wild => None ,
1764
1763
PatKind :: Leaf { .. } | PatKind :: Deref { .. } => Some ( Single ) ,
1765
1764
PatKind :: Variant { adt_def, variant_index, .. } => {
@@ -1773,9 +1772,9 @@ fn pat_constructor<'tcx>(
1773
1772
end,
1774
1773
pat. span ,
1775
1774
) ) ,
1776
- PatKind :: Array { .. } => match pcx . ty . kind {
1775
+ PatKind :: Array { .. } => match pat . ty . kind {
1777
1776
ty:: Array ( _, length) => Some ( FixedLenSlice ( length. eval_usize ( cx. tcx , cx. param_env ) ) ) ,
1778
- _ => span_bug ! ( pat. span, "bad ty {:?} for array pattern" , pcx . ty) ,
1777
+ _ => span_bug ! ( pat. span, "bad ty {:?} for array pattern" , pat . ty) ,
1779
1778
} ,
1780
1779
PatKind :: Slice { ref prefix, ref slice, ref suffix } => {
1781
1780
let prefix = prefix. len ( ) as u64 ;
0 commit comments