-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE on self-referential typedef #62364
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Note in my original code I used the |
Reduced: struct Struct<P1> {
field: P1,
}
type Alias<'l1, P2> = Struct<*const Self>; Backtrace:
|
Would this be a good issue for a beginner such as myself to take a crack at? |
triage: P-high, removing nomination. Assigning to @alexreg (as well as self to ensure follow-up) |
@imbrem Probably not the easiest. :-) I'm going to look at solving this, but maybe take a look at what I do if you like. |
Turned out to be far easier than thought, though identifying the solution wasn't so straightforward perhaps... PR fix upcoming. |
@alexreg nice! I'll probably have a look when I have more time on the weekend. Also are those Silmarils in your profile picture? |
@imbrem Sure. The actual change itself is mainly just removal of a few lines that I'd inserted in a previous PR. Most of the PR will be tests heh. And yep, the Silmarils with one of the Two Trees. :-) |
…nkfelix Fix ICEs when `Self` is used in type aliases I think it is right just to disallow this at resolution stage rather than let typeck produce a cyclic error. This is in line with previous behaviour. There was probably no need at all for the change that introduced this bug in rust-lang#57428, so I've simply reversed it. Fixes rust-lang#62263, rust-lang#62364, rust-lang#62305. r? @eddyb
…nkfelix Fix ICEs when `Self` is used in type aliases I think it is right just to disallow this at resolution stage rather than let typeck produce a cyclic error. This is in line with previous behaviour. There was probably no need at all for the change that introduced this bug in rust-lang#57428, so I've simply reversed it. Fixes rust-lang#62263, rust-lang#62364, rust-lang#62305. r? @eddyb
Fixed by #62364 |
I think it is #62417. |
So, while writing some really nasty code for an interpreter, I ended up with an overcomplicated version of this code:
(Playground link)
Alas, it leads to an ICE, with this message:
I wonder how an unchecked overflow got in there (18446744073709551615 == -1)...
Funnily enough, if I remove the
'ctx
or theT
(or both) it compiles just fine, without error. But with both thectx
andT
in, crash.The text was updated successfully, but these errors were encountered: