-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix NLL typeck ICEs #61488
Merged
Merged
Fix NLL typeck ICEs #61488
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jun 3, 2019
@bors r+ rollup |
📌 Commit 794239d has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jun 4, 2019
Centril
added a commit
to Centril/rust
that referenced
this pull request
Jun 4, 2019
…r=pnkfelix Fix NLL typeck ICEs * Don't ICE when a type containing a region is constrained by nothing * Don't ICE trying to normalize a type in a `ParamEnv` containing global bounds. To explain what was happening in the `issue-61311-normalize.rs` case: * When borrow checking the `the_fn` in the last `impl` we would try to normalize `Self::Proj` (`<Unit as HasProjFn>::Proj`). * We would find the `impl` that we're checking and and check its `where` clause. * This would need us to check `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound` * We find two possible implementations, the blanket impl and the bound in our `ParamEnv`. * The bound in our `ParamEnv` was canonicalized, so we don't see it as a global bound. As such we prefer it to the `impl`. * This means that we cannot normalize `<Box<dyn Obj + 'static> as HasProj>::Proj` to `Unit`. * The `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound` bound, which looks like it should be in our `ParamEnv` has been normalized to `Unit: Bound`. * We fail to prove `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound`. * We ICE, since we believe typeck have errored. Closes rust-lang#61311 Closes rust-lang#61315 Closes rust-lang#61320 r? @pnkfelix cc @nikomatsakis
pietroalbini
added a commit
to pietroalbini/rust
that referenced
this pull request
Jun 4, 2019
…r=pnkfelix Fix NLL typeck ICEs * Don't ICE when a type containing a region is constrained by nothing * Don't ICE trying to normalize a type in a `ParamEnv` containing global bounds. To explain what was happening in the `issue-61311-normalize.rs` case: * When borrow checking the `the_fn` in the last `impl` we would try to normalize `Self::Proj` (`<Unit as HasProjFn>::Proj`). * We would find the `impl` that we're checking and and check its `where` clause. * This would need us to check `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound` * We find two possible implementations, the blanket impl and the bound in our `ParamEnv`. * The bound in our `ParamEnv` was canonicalized, so we don't see it as a global bound. As such we prefer it to the `impl`. * This means that we cannot normalize `<Box<dyn Obj + 'static> as HasProj>::Proj` to `Unit`. * The `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound` bound, which looks like it should be in our `ParamEnv` has been normalized to `Unit: Bound`. * We fail to prove `<Box<dyn Obj + 'static> as HasProj>::Proj: Bound`. * We ICE, since we believe typeck have errored. Closes rust-lang#61311 Closes rust-lang#61315 Closes rust-lang#61320 r? @pnkfelix cc @nikomatsakis
bors
added a commit
that referenced
this pull request
Jun 4, 2019
Rollup of 5 pull requests Successful merges: - #61069 (Make MIR drop terminators borrow the dropped location) - #61453 (Remove unneeded feature attr from atomic integers doctests) - #61488 (Fix NLL typeck ICEs) - #61500 (Fix regression 61475) - #61523 (Hide gen_future API from documentation) Failed merges: r? @ghost
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ParamEnv
containing global bounds.To explain what was happening in the
issue-61311-normalize.rs
case:the_fn
in the lastimpl
we would try to normalizeSelf::Proj
(<Unit as HasProjFn>::Proj
).impl
that we're checking and and check itswhere
clause.<Box<dyn Obj + 'static> as HasProj>::Proj: Bound
ParamEnv
.ParamEnv
was canonicalized, so we don't see it as a global bound. As such we prefer it to theimpl
.<Box<dyn Obj + 'static> as HasProj>::Proj
toUnit
.<Box<dyn Obj + 'static> as HasProj>::Proj: Bound
bound, which looks like it should be in ourParamEnv
has been normalized toUnit: Bound
.<Box<dyn Obj + 'static> as HasProj>::Proj: Bound
.Closes #61311
Closes #61315
Closes #61320
r? @pnkfelix
cc @nikomatsakis