@@ -261,7 +261,7 @@ impl IntRange {
261261 /// Lint on likely incorrect range patterns (#63987)
262262 pub ( super ) fn lint_overlapping_range_endpoints < ' a , ' p : ' a , ' tcx : ' a > (
263263 & self ,
264- pcx : PatCtxt < ' _ , ' p , ' tcx > ,
264+ pcx : & PatCtxt < ' _ , ' p , ' tcx > ,
265265 pats : impl Iterator < Item = & ' a DeconstructedPat < ' p , ' tcx > > ,
266266 column_count : usize ,
267267 hir_id : HirId ,
@@ -696,7 +696,7 @@ impl<'tcx> Constructor<'tcx> {
696696 /// `EvalResult::Deny { .. }`.
697697 ///
698698 /// This means that the variant has a stdlib unstable feature marking it.
699- pub ( super ) fn is_unstable_variant ( & self , pcx : PatCtxt < ' _ , ' _ , ' tcx > ) -> bool {
699+ pub ( super ) fn is_unstable_variant ( & self , pcx : & PatCtxt < ' _ , ' _ , ' tcx > ) -> bool {
700700 if let Constructor :: Variant ( idx) = self && let ty:: Adt ( adt, _) = pcx. ty . kind ( ) {
701701 let variant_def_id = adt. variant ( * idx) . def_id ;
702702 // Filter variants that depend on a disabled unstable feature.
@@ -710,7 +710,7 @@ impl<'tcx> Constructor<'tcx> {
710710
711711 /// Checks if the `Constructor` is a `Constructor::Variant` with a `#[doc(hidden)]`
712712 /// attribute from a type not local to the current crate.
713- pub ( super ) fn is_doc_hidden_variant ( & self , pcx : PatCtxt < ' _ , ' _ , ' tcx > ) -> bool {
713+ pub ( super ) fn is_doc_hidden_variant ( & self , pcx : & PatCtxt < ' _ , ' _ , ' tcx > ) -> bool {
714714 if let Constructor :: Variant ( idx) = self && let ty:: Adt ( adt, _) = pcx. ty . kind ( ) {
715715 let variant_def_id = adt. variants ( ) [ * idx] . def_id ;
716716 return pcx. cx . tcx . is_doc_hidden ( variant_def_id) && !variant_def_id. is_local ( ) ;
@@ -731,7 +731,7 @@ impl<'tcx> Constructor<'tcx> {
731731
732732 /// The number of fields for this constructor. This must be kept in sync with
733733 /// `Fields::wildcards`.
734- pub ( super ) fn arity ( & self , pcx : PatCtxt < ' _ , ' _ , ' tcx > ) -> usize {
734+ pub ( super ) fn arity ( & self , pcx : & PatCtxt < ' _ , ' _ , ' tcx > ) -> usize {
735735 match self {
736736 Single | Variant ( _) => match pcx. ty . kind ( ) {
737737 ty:: Tuple ( fs) => fs. len ( ) ,
@@ -775,7 +775,7 @@ impl<'tcx> Constructor<'tcx> {
775775 /// matrix, unless all of them are.
776776 pub ( super ) fn split < ' a > (
777777 & self ,
778- pcx : PatCtxt < ' _ , ' _ , ' tcx > ,
778+ pcx : & PatCtxt < ' _ , ' _ , ' tcx > ,
779779 ctors : impl Iterator < Item = & ' a Constructor < ' tcx > > + Clone ,
780780 ) -> SmallVec < [ Self ; 1 ] >
781781 where
@@ -811,7 +811,7 @@ impl<'tcx> Constructor<'tcx> {
811811 /// this checks for inclusion.
812812 // We inline because this has a single call site in `Matrix::specialize_constructor`.
813813 #[ inline]
814- pub ( super ) fn is_covered_by < ' p > ( & self , pcx : PatCtxt < ' _ , ' p , ' tcx > , other : & Self ) -> bool {
814+ pub ( super ) fn is_covered_by < ' p > ( & self , pcx : & PatCtxt < ' _ , ' p , ' tcx > , other : & Self ) -> bool {
815815 // This must be kept in sync with `is_covered_by_any`.
816816 match ( self , other) {
817817 // Wildcards cover anything
@@ -865,7 +865,7 @@ impl<'tcx> Constructor<'tcx> {
865865 /// assumed to have been split from a wildcard.
866866 fn is_covered_by_any < ' p > (
867867 & self ,
868- pcx : PatCtxt < ' _ , ' p , ' tcx > ,
868+ pcx : & PatCtxt < ' _ , ' p , ' tcx > ,
869869 used_ctors : & [ Constructor < ' tcx > ] ,
870870 ) -> bool {
871871 if used_ctors. is_empty ( ) {
@@ -918,7 +918,7 @@ pub(super) struct SplitWildcard<'tcx> {
918918}
919919
920920impl < ' tcx > SplitWildcard < ' tcx > {
921- pub ( super ) fn new < ' p > ( pcx : PatCtxt < ' _ , ' p , ' tcx > ) -> Self {
921+ pub ( super ) fn new < ' p > ( pcx : & PatCtxt < ' _ , ' p , ' tcx > ) -> Self {
922922 debug ! ( "SplitWildcard::new({:?})" , pcx. ty) ;
923923 let cx = pcx. cx ;
924924 let make_range = |start, end| {
@@ -1044,7 +1044,7 @@ impl<'tcx> SplitWildcard<'tcx> {
10441044 /// do what you want.
10451045 pub ( super ) fn split < ' a > (
10461046 & mut self ,
1047- pcx : PatCtxt < ' _ , ' _ , ' tcx > ,
1047+ pcx : & PatCtxt < ' _ , ' _ , ' tcx > ,
10481048 ctors : impl Iterator < Item = & ' a Constructor < ' tcx > > + Clone ,
10491049 ) where
10501050 ' tcx : ' a ,
@@ -1056,21 +1056,21 @@ impl<'tcx> SplitWildcard<'tcx> {
10561056 }
10571057
10581058 /// Whether there are any value constructors for this type that are not present in the matrix.
1059- fn any_missing ( & self , pcx : PatCtxt < ' _ , ' _ , ' tcx > ) -> bool {
1059+ fn any_missing ( & self , pcx : & PatCtxt < ' _ , ' _ , ' tcx > ) -> bool {
10601060 self . iter_missing ( pcx) . next ( ) . is_some ( )
10611061 }
10621062
10631063 /// Iterate over the constructors for this type that are not present in the matrix.
10641064 pub ( super ) fn iter_missing < ' a , ' p > (
10651065 & ' a self ,
1066- pcx : PatCtxt < ' a , ' p , ' tcx > ,
1066+ pcx : & ' a PatCtxt < ' a , ' p , ' tcx > ,
10671067 ) -> impl Iterator < Item = & ' a Constructor < ' tcx > > + Captures < ' p > {
10681068 self . all_ctors . iter ( ) . filter ( move |ctor| !ctor. is_covered_by_any ( pcx, & self . matrix_ctors ) )
10691069 }
10701070
10711071 /// Return the set of constructors resulting from splitting the wildcard. As explained at the
10721072 /// top of the file, if any constructors are missing we can ignore the present ones.
1073- fn into_ctors ( self , pcx : PatCtxt < ' _ , ' _ , ' tcx > ) -> SmallVec < [ Constructor < ' tcx > ; 1 ] > {
1073+ fn into_ctors ( self , pcx : & PatCtxt < ' _ , ' _ , ' tcx > ) -> SmallVec < [ Constructor < ' tcx > ; 1 ] > {
10741074 if self . any_missing ( pcx) {
10751075 // Some constructors are missing, thus we can specialize with the special `Missing`
10761076 // constructor, which stands for those constructors that are not seen in the matrix,
@@ -1285,7 +1285,7 @@ impl<'p, 'tcx> DeconstructedPat<'p, 'tcx> {
12851285 /// Construct a pattern that matches everything that starts with this constructor.
12861286 /// For example, if `ctor` is a `Constructor::Variant` for `Option::Some`, we get the pattern
12871287 /// `Some(_)`.
1288- pub ( super ) fn wild_from_ctor ( pcx : PatCtxt < ' _ , ' p , ' tcx > , ctor : Constructor < ' tcx > ) -> Self {
1288+ pub ( super ) fn wild_from_ctor ( pcx : & PatCtxt < ' _ , ' p , ' tcx > , ctor : Constructor < ' tcx > ) -> Self {
12891289 let fields = Fields :: wildcards ( pcx. cx , pcx. ty , & ctor) ;
12901290 DeconstructedPat :: new ( ctor, fields, pcx. ty , DUMMY_SP )
12911291 }
0 commit comments