diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 7b31cd81567..4c440b15988 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -1389,8 +1389,7 @@ impl<'tcx> cmt_<'tcx> { } /// Returns `FreelyAliasable(_)` if this lvalue represents a freely aliasable pointer type. - pub fn freely_aliasable(&self, ctxt: &TyCtxt<'tcx>) - -> Aliasability { + pub fn freely_aliasable(&self) -> Aliasability { // Maybe non-obvious: copied upvars can only be considered // non-aliasable in once closures, since any other kind can be // aliased and eventually recused. @@ -1403,11 +1402,11 @@ impl<'tcx> cmt_<'tcx> { Categorization::Downcast(ref b, _) | Categorization::Interior(ref b, _) => { // Aliasability depends on base cmt - b.freely_aliasable(ctxt) + b.freely_aliasable() } Categorization::Deref(ref b, _, Unique) => { - let sub = b.freely_aliasable(ctxt); + let sub = b.freely_aliasable(); if b.mutbl.is_mutable() { // Aliasability depends on base cmt alone sub diff --git a/src/librustc_borrowck/borrowck/gather_loans/mod.rs b/src/librustc_borrowck/borrowck/gather_loans/mod.rs index 152524e26e4..21787505b8a 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/mod.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/mod.rs @@ -178,7 +178,7 @@ fn check_aliasability<'a, 'tcx>(bccx: &BorrowckCtxt<'a, 'tcx>, req_kind: ty::BorrowKind) -> Result<(),()> { - let aliasability = cmt.freely_aliasable(bccx.tcx); + let aliasability = cmt.freely_aliasable(); debug!("check_aliasability aliasability={:?} req_kind={:?}", aliasability, req_kind);