Skip to content
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

Remove the "leak check" in favor of "universes" #48407

Closed
wants to merge 22 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
48df576
Revert "change skolemizations to use universe index"
sgrif Mar 6, 2018
50bd71c
Revert "fix tests in `librustc_driver`"
sgrif Mar 6, 2018
5dad682
Revert "fix tidy error"
sgrif Mar 6, 2018
2a94f30
Revert "change skolemizations to use universe index"
sgrif Mar 6, 2018
f6e6d23
Revert "introduce `UniverseIndex` into `ParamEnv`"
sgrif Mar 6, 2018
26d1fc7
Revert "add universes to type inference variables"
sgrif Mar 6, 2018
3d4791b
introduce `UniverseIndex` into `InferCtxt`
sgrif Feb 7, 2018
ff17bd7
add universes to type inference variables
sgrif Feb 7, 2018
66520ff
change skolemizations to use universe index
sgrif Feb 7, 2018
534d5d1
store RegionVariableInfo and not just RegionVariableOrigin
sgrif Feb 7, 2018
59f3b20
give a universe to region variables
sgrif Feb 7, 2018
ad9e9d9
make solving "universe aware", in a simplistic way
sgrif Feb 7, 2018
24478c4
kill higher_ranked_lub and higher_ranked_glb
sgrif Feb 7, 2018
367be87
remove `hr_match` -- no longer needed
nikomatsakis Aug 23, 2017
5aca3b9
move param-env from CombineFields into the individual operations
nikomatsakis Aug 21, 2017
afb4010
Wrap `InferCtxt::universe` in a cell
sgrif Feb 8, 2018
3b8008f
track skol levels in the InferCtxt rather than via counter
sgrif Feb 8, 2018
0bc324a
remove pop_skolemized and friends
sgrif Feb 8, 2018
17e0577
DO NOT MERGE THIS COMMIT
sgrif Mar 6, 2018
bd90fb5
Fix rustdoc breakage
sgrif Mar 6, 2018
725eeb0
[DO NOT MERGE THIS COMMIT] Remove more failing tests
sgrif Mar 7, 2018
3f599ad
Fix rebase issues
sgrif Mar 19, 2018
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
introduce UniverseIndex into InferCtxt
Always using root environment for now.
sgrif committed Mar 14, 2018
commit 3d4791b68c0f9b3fbd83e3f6ebdcf0c171c838a3
12 changes: 12 additions & 0 deletions src/librustc/infer/mod.rs
Original file line number Diff line number Diff line change
@@ -182,6 +182,17 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
// obligations within. This is expected to be done 'late enough'
// that all type inference variables have been bound and so forth.
pub region_obligations: RefCell<Vec<(ast::NodeId, RegionObligation<'tcx>)>>,

/// What is the innermost universe we have created? Starts out as
/// `UniverseIndex::root()` but grows from there as we enter
/// universal quantifiers.
///
/// NB: At present, we exclude the universal quantifiers on the
/// item we are type-checking, and just consider those names as
/// part of the root universe. So this would only get incremented
/// when we enter into a higher-ranked (`for<..>`) type or trait
/// bound.
pub universe: ty::UniverseIndex,
}

/// A map returned by `skolemize_late_bound_regions()` indicating the skolemized
@@ -454,6 +465,7 @@ impl<'a, 'gcx, 'tcx> InferCtxtBuilder<'a, 'gcx, 'tcx> {
err_count_on_creation: tcx.sess.err_count(),
in_snapshot: Cell::new(false),
region_obligations: RefCell::new(vec![]),
universe: ty::UniverseIndex::ROOT,
}))
}
}
4 changes: 1 addition & 3 deletions src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
@@ -1334,9 +1334,7 @@ pub struct UniverseIndex(u32);
impl UniverseIndex {
/// The root universe, where things that the user defined are
/// visible.
pub fn root() -> UniverseIndex {
UniverseIndex(0)
}
pub const ROOT: Self = UniverseIndex(0);

/// A "subuniverse" corresponds to being inside a `forall` quantifier.
/// So, for example, suppose we have this type in universe `U`: