@@ -569,8 +569,10 @@ pub fn ensure_sufficient_stack<R>(f: impl FnOnce() -> R) -> R {
569569}
570570
571571/// Context that provides information local to a place under investigation.
572- #[ derive( Clone ) ]
572+ #[ derive( derivative:: Derivative ) ]
573+ #[ derivative( Debug ( bound = "" ) , Clone ( bound = "" ) , Copy ( bound = "" ) ) ]
573574pub ( crate ) struct PlaceCtxt < ' a , ' p , Cx : TypeCx > {
575+ #[ derivative( Debug = "ignore" ) ]
574576 pub ( crate ) mcx : MatchCtxt < ' a , ' p , Cx > ,
575577 /// Type of the place under investigation.
576578 pub ( crate ) ty : Cx :: Ty ,
@@ -596,14 +598,6 @@ impl<'a, 'p, Cx: TypeCx> PlaceCtxt<'a, 'p, Cx> {
596598 }
597599}
598600
599- impl < ' a , ' p , Cx : TypeCx > Copy for PlaceCtxt < ' a , ' p , Cx > { }
600-
601- impl < ' a , ' p , Cx : TypeCx > fmt:: Debug for PlaceCtxt < ' a , ' p , Cx > {
602- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
603- f. debug_struct ( "PlaceCtxt" ) . field ( "ty" , & self . ty ) . finish ( )
604- }
605- }
606-
607601/// Serves two purposes:
608602/// - in a wildcard, tracks whether the wildcard matches only valid values (i.e. is a binding `_a`)
609603/// or also invalid values (i.e. is a true `_` pattern).
@@ -670,7 +664,8 @@ impl fmt::Display for ValidityConstraint {
670664// - 'a allocated by us
671665// - 'p coming from the input
672666// - Cx global compilation context
673- #[ derive( Clone ) ]
667+ #[ derive( derivative:: Derivative ) ]
668+ #[ derivative( Clone ( bound = "" ) ) ]
674669struct PatStack < ' a , ' p , Cx : TypeCx > {
675670 // Rows of len 1 are very common, which is why `SmallVec[_; 2]` works well.
676671 pats : SmallVec < [ & ' a DeconstructedPat < ' p , Cx > ; 2 ] > ,
@@ -845,8 +840,7 @@ impl<'a, 'p, Cx: TypeCx> Matrix<'a, 'p, Cx> {
845840 scrut_ty : Cx :: Ty ,
846841 scrut_validity : ValidityConstraint ,
847842 ) -> Self {
848- let wild_pattern =
849- wildcard_arena. alloc ( DeconstructedPat :: wildcard ( scrut_ty, Default :: default ( ) ) ) ;
843+ let wild_pattern = wildcard_arena. alloc ( DeconstructedPat :: wildcard ( scrut_ty) ) ;
850844 let wildcard_row = PatStack :: from_pattern ( wild_pattern) ;
851845 let mut matrix = Matrix {
852846 rows : Vec :: with_capacity ( arms. len ( ) ) ,
@@ -1022,7 +1016,8 @@ impl<'a, 'p, Cx: TypeCx> fmt::Debug for Matrix<'a, 'p, Cx> {
10221016/// The final `Pair(Some(_), true)` is then the resulting witness.
10231017///
10241018/// See the top of the file for more detailed explanations and examples.
1025- #[ derive( Debug , Clone ) ]
1019+ #[ derive( derivative:: Derivative ) ]
1020+ #[ derivative( Debug ( bound = "" ) , Clone ( bound = "" ) ) ]
10261021struct WitnessStack < Cx : TypeCx > ( Vec < WitnessPat < Cx > > ) ;
10271022
10281023impl < Cx : TypeCx > WitnessStack < Cx > {
@@ -1069,7 +1064,8 @@ impl<Cx: TypeCx> WitnessStack<Cx> {
10691064///
10701065/// Just as the `Matrix` starts with a single column, by the end of the algorithm, this has a single
10711066/// column, which contains the patterns that are missing for the match to be exhaustive.
1072- #[ derive( Debug , Clone ) ]
1067+ #[ derive( derivative:: Derivative ) ]
1068+ #[ derivative( Debug ( bound = "" ) , Clone ( bound = "" ) ) ]
10731069struct WitnessMatrix < Cx : TypeCx > ( Vec < WitnessStack < Cx > > ) ;
10741070
10751071impl < Cx : TypeCx > WitnessMatrix < Cx > {
0 commit comments