Skip to content

Split the type context into a global and a local (inference-only) one. #33425

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
May 11, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b5122d5
rustc: Always refer to TyCtxt as tcx.
eddyb May 3, 2016
0907c19
infer: Use methods for creating an InferCtxt.
eddyb Mar 11, 2016
6e29099
infer: Turn normalize_associated_type into a method on TyCtxt.
eddyb Mar 11, 2016
8600a67
mem_categorization: freely_aliasable doesn't need to take TyCtxt.
eddyb Mar 11, 2016
e387e6c
typeck: merge CollectCtxt and collect::CollectCtxt.
eddyb Mar 11, 2016
ef2f5f6
typeck: Avoid passing &TyCtxt around where possible.
eddyb Mar 11, 2016
d7ee56e
typeck: Turn everything operating on FnCtxt into a method.
eddyb Mar 12, 2016
f8ea24e
rustc: Avoid free functions taking &TyCtxt and &InferCtxt.
eddyb Mar 16, 2016
8fc2c46
regionck: Use methods on RegionCtxt instead of free functions.
eddyb Mar 16, 2016
513d392
rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.
eddyb May 3, 2016
2fbbaf2
rustc: Use set recovery APIs in the TyCtxt interners.
eddyb Mar 23, 2016
166dbc3
rustc: Keep a reference to the interners in TyCtxt.
eddyb Apr 28, 2016
76affa5
rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.
eddyb May 3, 2016
0053b44
rustc_typeck: Use Deref for FnCtxt, Inherited and InferCtxt fields an…
eddyb Mar 24, 2016
8a704f6
rustc: Remove the TyCtxt field from ParameterEnvironment.
eddyb Mar 25, 2016
12e56ea
rustc: Wrap users of InferCtxt in an anonymous scope.
eddyb Mar 25, 2016
f0b2b3c
rustc: Remove a redundant lifetime parameter from ExprUseVisitor.
eddyb Mar 25, 2016
8f72d81
rustc: Generalize a minimum set of functions over 'tcx != 'gcx.
eddyb Apr 29, 2016
2065216
rustc: More interning for data used in Ty<'tcx>.
eddyb Apr 29, 2016
3a30136
rustc: Remove the unnecessary ast_ty_to_ty_cache.
eddyb May 2, 2016
31a07b0
rustc_typeck: Generalize over 'tcx != 'gcx.
eddyb May 2, 2016
a1c170f
rustc: Split local type contexts interners from the global one.
eddyb May 11, 2016
42eb703
Fixup indentation after methodification.
eddyb May 11, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
mem_categorization: freely_aliasable doesn't need to take TyCtxt.
  • Loading branch information
eddyb committed May 11, 2016
commit 8600a67782ec3ee26dafa6a059f22a30ed285f15
7 changes: 3 additions & 4 deletions src/librustc/middle/mem_categorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_borrowck/borrowck/gather_loans/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down