Don't try and handle unfed type_of on anon consts#133831
Merged
bors merged 2 commits intorust-lang:masterfrom Dec 4, 2024
Merged
Don't try and handle unfed type_of on anon consts#133831bors merged 2 commits intorust-lang:masterfrom
type_of on anon consts#133831bors merged 2 commits intorust-lang:masterfrom
Conversation
BoxyUwU
commented
Dec 4, 2024
| //@ check-pass | ||
|
|
||
| // Regression test for #128176. | ||
| // Regression test for #128176. Previously we would call `type_of` on the `1` anon const |
Member
Author
There was a problem hiding this comment.
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
| trait X { | ||
| fn test() -> Self::Assoc<{ async {} }>; | ||
| //~^ ERROR associated type `Assoc` not found for `Self` | ||
| //~| ERROR associated type `Assoc` not found for `Self` |
Member
Author
There was a problem hiding this comment.
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.
compiler-errors
approved these changes
Dec 4, 2024
Contributor
|
@bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 4, 2024
…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
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 4, 2024
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`
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 free
to 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.
The
type_ofquery 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