-
Notifications
You must be signed in to change notification settings - Fork 13k
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
thread 'rustc' panicked at 'called Option::unwrap()
on a None
value', /rustc/<snip>/compiler/rustc_hir/src/definitions.rs:452:14
#91696
Comments
I initially submitted an issue at rust-lang/rust-clippy#8102 happening on similar project, but I found that this error also happens when |
I too get "thread 'rustc' panicked at 'called |
@kud1ing Just curious, are you using |
@TonalidadeHidrica No, i am not. After a |
I've renamed another enum and hit it again right away:
|
This might be a duplicate of #91487 |
same, and a cargo clean also fix it, close to impossible to produce a mcve cause it's not even a code problem. Was renaming two structs. |
@kud1ing this is very interesting. We've been struggling to reproduce this kind of bug. If you have a case where just renaming an enum triggers the ICE, I'd be glad to investigate it! |
@cjgillot Thank you. Unfortunately it is not reliable. I couldn't reproduce it in a reduced project. In the real project i am using a workspace. Maybe that's a factor. |
It's still a step forward. Can you share a snapshot of your workspace before and after the incriminating edit? I'll do the reduction myself. |
One commonality is that i am on macOS too:
|
@TonalidadeHidrica I believe this is the same bug. If you have a reproducer (= last version that compiled successfully, and the change that triggered the ICE), even if it's a huge one, I'll take it. |
@cjgillot I have a pair of adjacent commits in which the older does not cause ICE but the newer does. I confirmed that every time I switch between two commits, the behavior is reproducible, as long as I use the same |
@cjgillot Or alternatively, I may encrypt these files with your SSH key and share the link for the encrypted file. Choose whichever you want. |
@TonalidadeHidrica let's keep it simple: can you send it the email address on my github profile? |
I have a project that reliably reproduces this bug, available here: https://drive.google.com/file/d/1ytZpN6UGrPaxBpuNdOGk8RFxGGP_oets/view?usp=sharing. The following sequence of actions triggers the bug for me:
Here is the error message with my environment information:
|
@lopsided98: Thanks - I've been able to reproduce this crash locally, and I'm working on minimizing it. |
This appears to be caused by the way we handle decoding query values from the incremental cache. Decoding a rust/compiler/rustc_middle/src/ty/codec.rs Lines 311 to 316 in 8f117a7
As a result, we can get a call stack like this:
Normally, the design of the various queries enforces a certain order for the list of edges for a particular It might be possible to make invoking queries during decoding work properly, but I think the query system is already quite complicated without adding in this weird form of recursion. We should ban new query execution inside the internals of the query system (in particular, during decoding), and encode the full contents of an Here's a stacktrace demonstrating the issue:
|
I reproduce this ICE when I modified some hyper source code and recompile
|
…lwoerister Fully serialize AdtDef This avoids needing to invoke the `adt_def` query during the decoding of another query's result. Split out from rust-lang#91919 See rust-lang#91696 (comment)
I also hit exactly the same ICE with my crate on stable 1.57, but in my case I only changed module item visibility, i.e. adding/ removing |
This should be fixed on the latest nightly. |
Code
The error happens when compiling this project. However, if I cloned this commit to another location (without copying
target
), it runs successfully. So I doubt that this is an issue of cache-ish stuff. I'm leaving the worktree as-is, so instruct me any steps required for troubleshooting if necessary.Meta
rustc --version --verbose
:export | grep RUST
:Error output
$ cargo run --bin collect-songs-2
Backtrace
The text was updated successfully, but these errors were encountered: