-
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
Don't try and handle unfed type_of
on anon consts
#133831
Conversation
@@ -1,6 +1,7 @@ | |||
//@ check-pass | |||
|
|||
// Regression test for #128176. | |||
// Regression test for #128176. Previously we would call `type_of` on the `1` anon const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test being an example of the hir-based logic being wrong resulting in an ICE, which was fixed by no longer calling type_of
before the anon const had been lowered
@@ -3,8 +3,6 @@ | |||
trait X { | |||
fn test() -> Self::Assoc<{ async {} }>; | |||
//~^ ERROR associated type `Assoc` not found for `Self` | |||
//~| ERROR associated type `Assoc` not found for `Self` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the "const args in unresolved paths will not have type_of fed", previously we would attempt to use the hir based logic which re-lowered the hir path resulting in a second error, now we just use TyKind::Error
.
@bors r+ |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#133737 (Include LLDB and GDB visualizers in MSVC distribution) - rust-lang#133774 (Make CoercePointee errors translatable) - rust-lang#133831 (Don't try and handle unfed `type_of` on anon consts) - rust-lang#133847 (Remove `-Zshow-span`.) - rust-lang#133849 (coverage: Use a separate counter type and simplification step during counter creation) - rust-lang#133850 (Avoid `opaque type not constrained` errors in the presence of other errors) - rust-lang#133851 (Stop git from merging generated files) - rust-lang#133856 (Update sysinfo version to 0.33.0) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#133831 - BoxyUwU:ice_on_unfed_type_of, r=compiler-errors Don't try and handle unfed `type_of` on anon consts The `type_of` query for anon consts in the type system is actually implemented by feeding the return value during hir ty lowering, not the hir-based logic in `const_arg_anon_type_of`. The HIR based logic is incomplete (doesn't handle all hir nodes) and also generally wrong to call (re-lowers HIR or invokes typeck which can result in query cycles). r? `@compiler-errors`
The
type_of
query for anon consts in the type system is actually implemented by feeding the return value during hir ty lowering, not the hir-based logic inconst_arg_anon_type_of
. The HIR based logic is incomplete (doesn't handle all hir nodes) and also generally wrong to call (re-lowers HIR or invokes typeck which can result in query cycles).r? @compiler-errors