@@ -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 ] > ,
@@ -1022,7 +1017,8 @@ impl<'a, 'p, Cx: TypeCx> fmt::Debug for Matrix<'a, 'p, Cx> {
10221017/// The final `Pair(Some(_), true)` is then the resulting witness.
10231018///
10241019/// See the top of the file for more detailed explanations and examples.
1025- #[ derive( Debug , Clone ) ]
1020+ #[ derive( derivative:: Derivative ) ]
1021+ #[ derivative( Debug ( bound = "" ) , Clone ( bound = "" ) ) ]
10261022struct WitnessStack < Cx : TypeCx > ( Vec < WitnessPat < Cx > > ) ;
10271023
10281024impl < Cx : TypeCx > WitnessStack < Cx > {
@@ -1069,7 +1065,8 @@ impl<Cx: TypeCx> WitnessStack<Cx> {
10691065///
10701066/// Just as the `Matrix` starts with a single column, by the end of the algorithm, this has a single
10711067/// column, which contains the patterns that are missing for the match to be exhaustive.
1072- #[ derive( Debug , Clone ) ]
1068+ #[ derive( derivative:: Derivative ) ]
1069+ #[ derivative( Debug ( bound = "" ) , Clone ( bound = "" ) ) ]
10731070struct WitnessMatrix < Cx : TypeCx > ( Vec < WitnessStack < Cx > > ) ;
10741071
10751072impl < Cx : TypeCx > WitnessMatrix < Cx > {
0 commit comments