-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Normalize struct tail type when checking Pointee trait #92248
Normalize struct tail type when checking Pointee trait #92248
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
cc: @SimonSapin, who implemented the code that is modified here. |
Thanks for the PR, @compiler-errors! I don't really know the code involved here. r? rust-lang/compiler |
cc @jackh726 |
LGTM. Do you think we should add the test from #92577, or do you think the current test covers it? |
It looks like they're pretty much the same, so I think this is fine as is. |
@bors r+ |
📌 Commit 5a1c460 has been approved by |
…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. Fixes rust-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. Fixes rust-lang#91446 Fixes rust-lang#92248
…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. Fixes rust-lang#92128 Fixes rust-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. Fixes rust-lang#91446
…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
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.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>::Metadata
to 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