-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[BETA] Universe leak check #58641
[BETA] Universe leak check #58641
Conversation
In our type inference system, when we "generalize" a type T to become a suitable value for a type variable V, we sometimes wind up creating new inference variables. So, for example, if we are making V be some subtype of `&'X u32`, then we might instantiate V with `&'Y u32`. This generalized type is then related `&'Y u32 <: &'X u32`, resulting in a region constriant `'Y: 'X`. Previously, however, we were making these fresh variables like `'Y` in the "current universe", but they should be created in the universe of V. Moreover, we sometimes cheat in an invariant context and avoid creating fresh variables if we know the result must be equal -- we can only do that when the universes work out.
This set of diffs was produced by combing through b68fad6 and seeing where the `leak_check` used to be invoked and how.
One surprise: old-lub-glb-object.rs, may indicate a bug
This preserves the error you currently get on stable for the old-lub-glb-object.rs test.
This comment has been minimized.
This comment has been minimized.
|
Can you rollup (cherry-picking) all the other beta-accepted PRs with this one? r=me when you do that |
We'll probably roll this up with one or two other backports, so not yet approving this PR. |
@bors try |
Not sure if try is a good idea or not, but I know we had talked about crater runs, so might as well get started just in case? |
I don't think we want/need a crater run here - the one on master should be sufficient. |
☀️ Test successful - checks-travis |
@Mark-Simulacrum ok, then this is ready to go, and I leave it to you to decide how/when to merge |
Backport of #58592 and #58056 to beta.