11use crate :: hir:: def_id:: DefId ;
22use crate :: ty:: subst:: SubstsRef ;
3- use crate :: ty:: { CanonicalUserTypeAnnotation , ClosureSubsts , GeneratorSubsts , Region , Ty } ;
3+ use crate :: ty:: { CanonicalUserTypeAnnotation , ClosureSubsts , GeneratorSubsts , Ty } ;
44use crate :: mir:: * ;
55use syntax_pos:: Span ;
66
@@ -147,14 +147,14 @@ macro_rules! make_mir_visitor {
147147
148148 fn visit_place( & mut self ,
149149 place: & $( $mutability) ? Place <' tcx>,
150- context: PlaceContext < ' tcx> ,
150+ context: PlaceContext ,
151151 location: Location ) {
152152 self . super_place( place, context, location) ;
153153 }
154154
155155 fn visit_projection( & mut self ,
156156 place: & $( $mutability) ? PlaceProjection <' tcx>,
157- context: PlaceContext < ' tcx> ,
157+ context: PlaceContext ,
158158 location: Location ) {
159159 self . super_projection( place, context, location) ;
160160 }
@@ -252,7 +252,7 @@ macro_rules! make_mir_visitor {
252252
253253 fn visit_local( & mut self ,
254254 _local: & $( $mutability) ? Local ,
255- _context: PlaceContext < ' tcx> ,
255+ _context: PlaceContext ,
256256 _location: Location ) {
257257 }
258258
@@ -576,16 +576,16 @@ macro_rules! make_mir_visitor {
576576 self . visit_region( r, location) ;
577577 let ctx = match bk {
578578 BorrowKind :: Shared => PlaceContext :: NonMutatingUse (
579- NonMutatingUseContext :: SharedBorrow ( * r )
579+ NonMutatingUseContext :: SharedBorrow
580580 ) ,
581581 BorrowKind :: Shallow => PlaceContext :: NonMutatingUse (
582- NonMutatingUseContext :: ShallowBorrow ( * r )
582+ NonMutatingUseContext :: ShallowBorrow
583583 ) ,
584584 BorrowKind :: Unique => PlaceContext :: NonMutatingUse (
585- NonMutatingUseContext :: UniqueBorrow ( * r )
585+ NonMutatingUseContext :: UniqueBorrow
586586 ) ,
587587 BorrowKind :: Mut { .. } =>
588- PlaceContext :: MutatingUse ( MutatingUseContext :: Borrow ( * r ) ) ,
588+ PlaceContext :: MutatingUse ( MutatingUseContext :: Borrow ) ,
589589 } ;
590590 self . visit_place( path, ctx, location) ;
591591 }
@@ -716,7 +716,7 @@ macro_rules! make_mir_visitor {
716716
717717 fn super_place( & mut self ,
718718 place: & $( $mutability) ? Place <' tcx>,
719- context: PlaceContext < ' tcx> ,
719+ context: PlaceContext ,
720720 location: Location ) {
721721 match place {
722722 Place :: Base ( PlaceBase :: Local ( local) ) => {
@@ -736,7 +736,7 @@ macro_rules! make_mir_visitor {
736736
737737 fn super_projection( & mut self ,
738738 proj: & $( $mutability) ? PlaceProjection <' tcx>,
739- context: PlaceContext < ' tcx> ,
739+ context: PlaceContext ,
740740 location: Location ) {
741741 let Projection { base, elem } = proj;
742742 let context = if context. is_mutating_use( ) {
@@ -948,19 +948,19 @@ pub enum TyContext {
948948}
949949
950950#[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
951- pub enum NonMutatingUseContext < ' tcx > {
951+ pub enum NonMutatingUseContext {
952952 /// Being inspected in some way, like loading a len.
953953 Inspect ,
954954 /// Consumed as part of an operand.
955955 Copy ,
956956 /// Consumed as part of an operand.
957957 Move ,
958958 /// Shared borrow.
959- SharedBorrow ( Region < ' tcx > ) ,
959+ SharedBorrow ,
960960 /// Shallow borrow.
961- ShallowBorrow ( Region < ' tcx > ) ,
961+ ShallowBorrow ,
962962 /// Unique borrow.
963- UniqueBorrow ( Region < ' tcx > ) ,
963+ UniqueBorrow ,
964964 /// Used as base for another place, e.g., `x` in `x.y`. Will not mutate the place.
965965 /// For example, the projection `x.y` is not marked as a mutation in these cases:
966966 ///
@@ -971,7 +971,7 @@ pub enum NonMutatingUseContext<'tcx> {
971971}
972972
973973#[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
974- pub enum MutatingUseContext < ' tcx > {
974+ pub enum MutatingUseContext {
975975 /// Appears as LHS of an assignment.
976976 Store ,
977977 /// Can often be treated as a `Store`, but needs to be separate because
@@ -983,7 +983,7 @@ pub enum MutatingUseContext<'tcx> {
983983 /// Being dropped.
984984 Drop ,
985985 /// Mutable borrow.
986- Borrow ( Region < ' tcx > ) ,
986+ Borrow ,
987987 /// Used as base for another place, e.g., `x` in `x.y`. Could potentially mutate the place.
988988 /// For example, the projection `x.y` is marked as a mutation in these cases:
989989 ///
@@ -1006,13 +1006,13 @@ pub enum NonUseContext {
10061006}
10071007
10081008#[ derive( Copy , Clone , Debug , PartialEq , Eq ) ]
1009- pub enum PlaceContext < ' tcx > {
1010- NonMutatingUse ( NonMutatingUseContext < ' tcx > ) ,
1011- MutatingUse ( MutatingUseContext < ' tcx > ) ,
1009+ pub enum PlaceContext {
1010+ NonMutatingUse ( NonMutatingUseContext ) ,
1011+ MutatingUse ( MutatingUseContext ) ,
10121012 NonUse ( NonUseContext ) ,
10131013}
10141014
1015- impl < ' tcx > PlaceContext < ' tcx > {
1015+ impl < ' tcx > PlaceContext {
10161016 /// Returns `true` if this place context represents a drop.
10171017 pub fn is_drop ( & self ) -> bool {
10181018 match * self {
@@ -1024,10 +1024,10 @@ impl<'tcx> PlaceContext<'tcx> {
10241024 /// Returns `true` if this place context represents a borrow.
10251025 pub fn is_borrow ( & self ) -> bool {
10261026 match * self {
1027- PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: SharedBorrow ( .. ) ) |
1028- PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: ShallowBorrow ( .. ) ) |
1029- PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: UniqueBorrow ( .. ) ) |
1030- PlaceContext :: MutatingUse ( MutatingUseContext :: Borrow ( .. ) ) => true ,
1027+ PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: SharedBorrow ) |
1028+ PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: ShallowBorrow ) |
1029+ PlaceContext :: NonMutatingUse ( NonMutatingUseContext :: UniqueBorrow ) |
1030+ PlaceContext :: MutatingUse ( MutatingUseContext :: Borrow ) => true ,
10311031 _ => false ,
10321032 }
10331033 }
0 commit comments