@@ -719,14 +719,14 @@ pub struct PatField {
719719#[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
720720#[ derive( Encodable , Decodable , HashStable_Generic ) ]
721721pub enum ByRef {
722- Yes ( Mutability ) ,
722+ Yes ( Pinnedness , Mutability ) ,
723723 No ,
724724}
725725
726726impl ByRef {
727727 #[ must_use]
728728 pub fn cap_ref_mutability ( mut self , mutbl : Mutability ) -> Self {
729- if let ByRef :: Yes ( old_mutbl) = & mut self {
729+ if let ByRef :: Yes ( _ , old_mutbl) = & mut self {
730730 * old_mutbl = cmp:: min ( * old_mutbl, mutbl) ;
731731 }
732732 self
@@ -744,20 +744,33 @@ pub struct BindingMode(pub ByRef, pub Mutability);
744744
745745impl BindingMode {
746746 pub const NONE : Self = Self ( ByRef :: No , Mutability :: Not ) ;
747- pub const REF : Self = Self ( ByRef :: Yes ( Mutability :: Not ) , Mutability :: Not ) ;
747+ pub const REF : Self = Self ( ByRef :: Yes ( Pinnedness :: Not , Mutability :: Not ) , Mutability :: Not ) ;
748+ pub const REF_PIN : Self =
749+ Self ( ByRef :: Yes ( Pinnedness :: Pinned , Mutability :: Not ) , Mutability :: Not ) ;
748750 pub const MUT : Self = Self ( ByRef :: No , Mutability :: Mut ) ;
749- pub const REF_MUT : Self = Self ( ByRef :: Yes ( Mutability :: Mut ) , Mutability :: Not ) ;
750- pub const MUT_REF : Self = Self ( ByRef :: Yes ( Mutability :: Not ) , Mutability :: Mut ) ;
751- pub const MUT_REF_MUT : Self = Self ( ByRef :: Yes ( Mutability :: Mut ) , Mutability :: Mut ) ;
751+ pub const REF_MUT : Self = Self ( ByRef :: Yes ( Pinnedness :: Not , Mutability :: Mut ) , Mutability :: Not ) ;
752+ pub const REF_PIN_MUT : Self =
753+ Self ( ByRef :: Yes ( Pinnedness :: Pinned , Mutability :: Mut ) , Mutability :: Not ) ;
754+ pub const MUT_REF : Self = Self ( ByRef :: Yes ( Pinnedness :: Not , Mutability :: Not ) , Mutability :: Mut ) ;
755+ pub const MUT_REF_PIN : Self =
756+ Self ( ByRef :: Yes ( Pinnedness :: Pinned , Mutability :: Not ) , Mutability :: Mut ) ;
757+ pub const MUT_REF_MUT : Self =
758+ Self ( ByRef :: Yes ( Pinnedness :: Not , Mutability :: Mut ) , Mutability :: Mut ) ;
759+ pub const MUT_REF_PIN_MUT : Self =
760+ Self ( ByRef :: Yes ( Pinnedness :: Pinned , Mutability :: Mut ) , Mutability :: Mut ) ;
752761
753762 pub fn prefix_str ( self ) -> & ' static str {
754763 match self {
755764 Self :: NONE => "" ,
756765 Self :: REF => "ref " ,
766+ Self :: REF_PIN => "ref pin const " ,
757767 Self :: MUT => "mut " ,
758768 Self :: REF_MUT => "ref mut " ,
769+ Self :: REF_PIN_MUT => "ref pin mut " ,
759770 Self :: MUT_REF => "mut ref " ,
771+ Self :: MUT_REF_PIN => "mut ref pin " ,
760772 Self :: MUT_REF_MUT => "mut ref mut " ,
773+ Self :: MUT_REF_PIN_MUT => "mut ref pin mut " ,
761774 }
762775 }
763776}
0 commit comments