Skip to content

Commit 8600a67

Browse files
committed
mem_categorization: freely_aliasable doesn't need to take TyCtxt.
1 parent 6e29099 commit 8600a67

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/librustc/middle/mem_categorization.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,8 +1389,7 @@ impl<'tcx> cmt_<'tcx> {
13891389
}
13901390

13911391
/// Returns `FreelyAliasable(_)` if this lvalue represents a freely aliasable pointer type.
1392-
pub fn freely_aliasable(&self, ctxt: &TyCtxt<'tcx>)
1393-
-> Aliasability {
1392+
pub fn freely_aliasable(&self) -> Aliasability {
13941393
// Maybe non-obvious: copied upvars can only be considered
13951394
// non-aliasable in once closures, since any other kind can be
13961395
// aliased and eventually recused.
@@ -1403,11 +1402,11 @@ impl<'tcx> cmt_<'tcx> {
14031402
Categorization::Downcast(ref b, _) |
14041403
Categorization::Interior(ref b, _) => {
14051404
// Aliasability depends on base cmt
1406-
b.freely_aliasable(ctxt)
1405+
b.freely_aliasable()
14071406
}
14081407

14091408
Categorization::Deref(ref b, _, Unique) => {
1410-
let sub = b.freely_aliasable(ctxt);
1409+
let sub = b.freely_aliasable();
14111410
if b.mutbl.is_mutable() {
14121411
// Aliasability depends on base cmt alone
14131412
sub

src/librustc_borrowck/borrowck/gather_loans/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ fn check_aliasability<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>,
178178
req_kind: ty::BorrowKind)
179179
-> Result<(),()> {
180180

181-
let aliasability = cmt.freely_aliasable(bccx.tcx);
181+
let aliasability = cmt.freely_aliasable();
182182
debug!("check_aliasability aliasability={:?} req_kind={:?}",
183183
aliasability, req_kind);
184184

0 commit comments

Comments
 (0)