Uh oh!
There was an error while loading. Please reload this page.
Normalize struct tail type when checking Pointee trait - #92248
Merged
bors merged 1 commit intoJan 10, 2022
Conversation
rust-highfive
commented
Dec 24, 2021
Contributor
(rust-highfive has picked a reviewer for you, use r? to override) |
compiler-errors
commented
Dec 24, 2021
ContributorAuthor
cc: @SimonSapin, who implemented the code that is modified here. |
michaelwoerister
commented
Jan 3, 2022
Member
Thanks for the PR, @compiler-errors! I don't really know the code involved here. r? rust-lang/compiler |
Aaron1011
commented
Jan 6, 2022
Contributor
cc @jackh726 |
jackh726
commented
Jan 6, 2022
Member
LGTM. Do you think we should add the test from #92577, or do you think the current test covers it? |
Aaron1011
commented
Jan 6, 2022
Contributor
It looks like they're pretty much the same, so I think this is fine as is. |
jackh726
commented
Jan 6, 2022
Member
@bors r+ |
bors
commented
Jan 6, 2022
Collaborator
📌 Commit 5a1c460 has been approved by |
matthiaskrgr added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 6, 2022
…pointee, r=jackh726 Normalize struct tail type when checking Pointee trait Let's go ahead and implement the FIXMEs by properly normalizing the struct-tail type when satisfying a Pointee obligation. This should fix the ICE when we try to calculate a layout depending on `<Ty as Pointee>::Metadata` later. Fixesrust-lang#92128 Additionally, mark the obligation as ambiguous if there are any infer types in that struct-tail type. This has the effect of causing `<_ as Pointee>::Metadata` to be properly replaced with an infer variable ([here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/traits/project.rs#L813)) and registered as an obligation... this turns out to be very important in unifying function parameters with formals that are assoc types. Fixesrust-lang#91446Fixesrust-lang#92248
matthiaskrgr added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 9, 2022
…pointee, r=jackh726 Normalize struct tail type when checking Pointee trait Let's go ahead and implement the FIXMEs by properly normalizing the struct-tail type when satisfying a Pointee obligation. This should fix the ICE when we try to calculate a layout depending on `<Ty as Pointee>::Metadata` later. Fixesrust-lang#92128Fixesrust-lang#92577 Additionally, mark the obligation as ambiguous if there are any infer types in that struct-tail type. This has the effect of causing `<_ as Pointee>::Metadata` to be properly replaced with an infer variable ([here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/traits/project.rs#L813)) and registered as an obligation... this turns out to be very important in unifying function parameters with formals that are assoc types. Fixesrust-lang#91446
bors added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 10, 2022
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#92248 (Normalize struct tail type when checking Pointee trait) - rust-lang#92357 (Fix invalid removal of newlines from doc comments) - rust-lang#92602 (Make source links look cleaner) - rust-lang#92636 (Normalize generator-local types with unevaluated constants) - rust-lang#92693 (Release notes: add `Result::unwrap_{,err_}unchecked`) - rust-lang#92702 (Clean up lang_items::extract) - rust-lang#92717 (update miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
4 tasks
This file contains hidden or 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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Let's go ahead and implement the FIXMEs by properly normalizing the struct-tail type when satisfying a Pointee obligation. This should fix the ICE when we try to calculate a layout depending on
<Ty as Pointee>::Metadatalater.Fixes#92128
Fixes#92577
Additionally, mark the obligation as ambiguous if there are any infer types in that struct-tail type. This has the effect of causing
<_ as Pointee>::Metadatato be properly replaced with an infer variable (here) and registered as an obligation... this turns out to be very important in unifying function parameters with formals that are assoc types.Fixes#91446