@@ -5,12 +5,11 @@ use rustc_middle::mir::{BorrowKind, Mutability, Operand};
55use rustc_middle:: mir:: { InlineAsmOperand , Terminator , TerminatorKind } ;
66use rustc_middle:: mir:: { Statement , StatementKind } ;
77use rustc_middle:: ty:: TyCtxt ;
8- use std:: iter;
98
109use crate :: {
1110 borrow_set:: BorrowSet , facts:: AllFacts , location:: LocationTable , path_utils:: * , AccessDepth ,
12- Activation , ArtificialField , BorrowIndex , Deep , JustWrite , LocalMutationIsAllowed , MutateMode ,
13- Read , ReadKind , ReadOrWrite , Reservation , Shallow , Write , WriteAndRead , WriteKind ,
11+ Activation , ArtificialField , BorrowIndex , Deep , LocalMutationIsAllowed , Read , ReadKind ,
12+ ReadOrWrite , Reservation , Shallow , Write , WriteKind ,
1413} ;
1514
1615pub ( super ) fn generate_invalidates < ' tcx > (
@@ -59,37 +58,13 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
5958 StatementKind :: Assign ( box ( lhs, rhs) ) => {
6059 self . consume_rvalue ( location, rhs) ;
6160
62- self . mutate_place ( location, * lhs, Shallow ( None ) , JustWrite ) ;
61+ self . mutate_place ( location, * lhs, Shallow ( None ) ) ;
6362 }
6463 StatementKind :: FakeRead ( box ( _, _) ) => {
6564 // Only relevant for initialized/liveness/safety checks.
6665 }
6766 StatementKind :: SetDiscriminant { place, variant_index : _ } => {
68- self . mutate_place ( location, * * place, Shallow ( None ) , JustWrite ) ;
69- }
70- StatementKind :: LlvmInlineAsm ( asm) => {
71- for ( o, output) in iter:: zip ( & asm. asm . outputs , & * asm. outputs ) {
72- if o. is_indirect {
73- // FIXME(eddyb) indirect inline asm outputs should
74- // be encoded through MIR place derefs instead.
75- self . access_place (
76- location,
77- * output,
78- ( Deep , Read ( ReadKind :: Copy ) ) ,
79- LocalMutationIsAllowed :: No ,
80- ) ;
81- } else {
82- self . mutate_place (
83- location,
84- * output,
85- if o. is_rw { Deep } else { Shallow ( None ) } ,
86- if o. is_rw { WriteAndRead } else { JustWrite } ,
87- ) ;
88- }
89- }
90- for ( _, input) in asm. inputs . iter ( ) {
91- self . consume_operand ( location, input) ;
92- }
67+ self . mutate_place ( location, * * place, Shallow ( None ) ) ;
9368 }
9469 StatementKind :: CopyNonOverlapping ( box rustc_middle:: mir:: CopyNonOverlapping {
9570 ref src,
@@ -142,7 +117,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
142117 target : _,
143118 unwind : _,
144119 } => {
145- self . mutate_place ( location, * drop_place, Deep , JustWrite ) ;
120+ self . mutate_place ( location, * drop_place, Deep ) ;
146121 self . consume_operand ( location, new_value) ;
147122 }
148123 TerminatorKind :: Call {
@@ -158,7 +133,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
158133 self . consume_operand ( location, arg) ;
159134 }
160135 if let Some ( ( dest, _ /*bb*/ ) ) = destination {
161- self . mutate_place ( location, * dest, Deep , JustWrite ) ;
136+ self . mutate_place ( location, * dest, Deep ) ;
162137 }
163138 }
164139 TerminatorKind :: Assert { ref cond, expected : _, ref msg, target : _, cleanup : _ } => {
@@ -181,7 +156,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
181156 }
182157 }
183158
184- self . mutate_place ( location, * resume_arg, Deep , JustWrite ) ;
159+ self . mutate_place ( location, * resume_arg, Deep ) ;
185160 }
186161 TerminatorKind :: Resume | TerminatorKind :: Return | TerminatorKind :: GeneratorDrop => {
187162 // Invalidate all borrows of local places
@@ -208,13 +183,13 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
208183 }
209184 InlineAsmOperand :: Out { reg : _, late : _, place, .. } => {
210185 if let Some ( place) = place {
211- self . mutate_place ( location, place, Shallow ( None ) , JustWrite ) ;
186+ self . mutate_place ( location, place, Shallow ( None ) ) ;
212187 }
213188 }
214189 InlineAsmOperand :: InOut { reg : _, late : _, ref in_value, out_place } => {
215190 self . consume_operand ( location, in_value) ;
216191 if let Some ( out_place) = out_place {
217- self . mutate_place ( location, out_place, Shallow ( None ) , JustWrite ) ;
192+ self . mutate_place ( location, out_place, Shallow ( None ) ) ;
218193 }
219194 }
220195 InlineAsmOperand :: Const { value : _ }
@@ -238,13 +213,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
238213
239214impl < ' cx , ' tcx > InvalidationGenerator < ' cx , ' tcx > {
240215 /// Simulates mutation of a place.
241- fn mutate_place (
242- & mut self ,
243- location : Location ,
244- place : Place < ' tcx > ,
245- kind : AccessDepth ,
246- _mode : MutateMode ,
247- ) {
216+ fn mutate_place ( & mut self , location : Location , place : Place < ' tcx > , kind : AccessDepth ) {
248217 self . access_place (
249218 location,
250219 place,
0 commit comments