Skip to content

Commit 538cdef

Browse files
Use & to do deref coercion for ReadOnlyBodyAndCache
1 parent b641e9e commit 538cdef

File tree

19 files changed

+22
-22
lines changed

19 files changed

+22
-22
lines changed

src/librustc_codegen_ssa/mir/analyze.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
2020
let mir = fx.mir;
2121
let mut analyzer = LocalAnalyzer::new(fx);
2222

23-
analyzer.visit_body(*mir);
23+
analyzer.visit_body(&mir);
2424

2525
for (local, decl) in mir.local_decls.iter_enumerated() {
2626
let ty = fx.monomorphize(&decl.ty);

src/librustc_mir/borrow_check/borrow_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl LocalsStateAtExit {
107107
LocalsStateAtExit::AllAreInvalidated
108108
} else {
109109
let mut has_storage_dead = HasStorageDead(BitSet::new_empty(body.local_decls.len()));
110-
has_storage_dead.visit_body(*body);
110+
has_storage_dead.visit_body(&body);
111111
let mut has_storage_dead_or_moved = has_storage_dead.0;
112112
for move_out in &move_data.moves {
113113
if let Some(index) = move_data.base_local(move_out.path) {

src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
15611561
}
15621562
}
15631563
let mut visitor = FakeReadCauseFinder { place, cause: None };
1564-
visitor.visit_body(*self.body);
1564+
visitor.visit_body(&self.body);
15651565
match visitor.cause {
15661566
Some(FakeReadCause::ForMatchGuard) => Some("match guard"),
15671567
Some(FakeReadCause::ForIndex) => Some("indexing expression"),

src/librustc_mir/borrow_check/invalidation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub(super) fn generate_invalidates<'tcx>(
3737
body: &body,
3838
dominators,
3939
};
40-
ig.visit_body(*body);
40+
ig.visit_body(&body);
4141
}
4242
}
4343

src/librustc_mir/borrow_check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ fn do_mir_borrowck<'a, 'tcx>(
299299
}
300300

301301
dataflow::visit_results(
302-
&*body,
303-
traversal::reverse_postorder(&*body).map(|(bb, _)| bb),
302+
&body,
303+
traversal::reverse_postorder(&body).map(|(bb, _)| bb),
304304
&results,
305305
&mut mbcx,
306306
);

src/librustc_mir/borrow_check/type_check/liveness/local_use_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl LocalUseMap {
8181
live_locals.iter().for_each(|&local| locals_with_use_data[local] = true);
8282

8383
LocalUseMapBuild { local_use_map: &mut local_use_map, elements, locals_with_use_data }
84-
.visit_body(*body);
84+
.visit_body(&body);
8585

8686
local_use_map
8787
}

src/librustc_mir/borrow_check/type_check/liveness/polonius.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub(super) fn populate_access_facts(
101101
location_table,
102102
move_data,
103103
};
104-
extractor.visit_body(*body);
104+
extractor.visit_body(&body);
105105

106106
facts.var_dropped_at.extend(
107107
dropped_at.iter().map(|&(local, location)| (local, location_table.mid_index(location))),

src/librustc_mir/borrow_check/type_check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ fn type_check_internal<'a, 'tcx, R>(
210210
);
211211
let errors_reported = {
212212
let mut verifier = TypeVerifier::new(&mut checker, *body, promoted);
213-
verifier.visit_body(*body);
213+
verifier.visit_body(&body);
214214
verifier.errors_reported
215215
};
216216

@@ -563,7 +563,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
563563

564564
swap_constraints(self);
565565

566-
self.visit_body(*promoted_body);
566+
self.visit_body(&promoted_body);
567567

568568
if !self.errors_reported {
569569
// if verifier failed, don't do further checks to avoid ICEs

src/librustc_mir/borrow_check/used_muts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
3232
never_initialized_mut_locals: &mut never_initialized_mut_locals,
3333
mbcx: self,
3434
};
35-
visitor.visit_body(*visitor.mbcx.body);
35+
visitor.visit_body(&visitor.mbcx.body);
3636
}
3737

3838
// Take the union of the existed `used_mut` set with those variables we've found were

src/librustc_mir/const_eval/eval_queries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ pub fn const_eval_raw_provider<'tcx>(
307307
);
308308

309309
let res = ecx.load_mir(cid.instance.def, cid.promoted);
310-
res.and_then(|body| eval_body_using_ecx(&mut ecx, cid, *body))
310+
res.and_then(|body| eval_body_using_ecx(&mut ecx, cid, &body))
311311
.and_then(|place| {
312312
Ok(RawConst { alloc_id: place.ptr.assert_ptr().alloc_id, ty: place.layout.ty })
313313
})

0 commit comments

Comments
 (0)