-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
ICE in 1.60.0-beta.1: thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1160:9
#94291
Labels
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
Comments
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1160:9
thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1160:9
@rustbot claim |
Sorry, that i didn't claim this before, |
I am just about to open my pull request |
Oh, okay |
terrarier2111
added a commit
to terrarier2111/rust
that referenced
this issue
Feb 25, 2022
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 25, 2022
Add one more case to avoid ICE Fix for the rust-lang#94291, added one more case to related function to avoid ICE. Not sure if my test is in the correct place 😅
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Feb 25, 2022
Add one more case to avoid ICE Fix for the rust-lang#94291, added one more case to related function to avoid ICE. Not sure if my test is in the correct place 😅
Fixed by #94355 |
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Mar 1, 2022
…-once, r=davidtwco Check method input expressions once If the user mistakenly forgets to wrap their method args in a tuple, then the compiler tries to check that types within the tuple match the expression args. This means we call `check_expr` once within this diagnostic code, so when we check the expr once again in `demand_compatible`, we attempt to apply expr adjustments twice, leading to ICEs. This PR attempts to fix this by skipping the expression type check in `demand_compatible` if we have detected an method arg mismatch at all. This does lead to a single UI test regressing slightly, due to a diagnostic disappearing, though I don't know if it is generally meaningful to even raise an type error after noting that the argument count is incorrect in a function call, since the user might be providing (in-context) meaningless expressions to the wrong method. I can adjust this to be a bit more targeted (to just skip checking exprs in `demand_compatible` in the tuple case) if this UI test regression is a problem. fixes rust-lang#94334 cc rust-lang#94291 Also drive-by fixup of `.node_type(expr.hir_id)` to `.expr_ty(expr)`, since that method exists.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
glacier
ICE tracked in rust-lang/glacier.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=8246316eaa144bdcfc3f421aa56fd785
Note: In the example above, there are parens missing around the tuple being passed to
.push_back()
, which once added in, resolves the ICE.Meta
rustc --version --verbose
:This also reproduces using nightly on playground:
rustc 1.61.0-nightly (68369a041 2022-02-22) running on x86_64-unknown-linux-gnu
Error output
Backtrace
The text was updated successfully, but these errors were encountered: