-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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: 'assertion failed: !self.substitutions.is_empty()', compiler/rustc_errors/src/lib.rs #78651
Comments
Can you confirm if this still ICEs with the latest nightly? |
|
After further review, I can confirm that this does cause an ICE with |
Locally running `cargo run` and running `rustc` directly produced different results. Call rustc on 78651 directly instead of indirectly (through cargo). Issue: rust-lang/rust#78651
Locally running `cargo run` and running `rustc` directly produced different results. Call rustc on 78651 directly instead of indirectly (through cargo). Issue: rust-lang/rust#78651
I think this regression was introduced in https://github.com/rust-lang/rust/pull/72603/files#diff-7e4444c107c648eec7167c8fd88b2665cf1f6e68e2a77d7992001677c09dca81R534
Edit: it was not introduced there, but I've found where it is coming from. It is because of an invalid suggestion with empty substitutions because we were filtering them away. PR incoming. |
I think there's another issue as I describe here: #82092 (comment) Namely Fixing that function (or the call site) would also fix this issue. |
Assigning |
@rustbot label -I-prioritize +P-medium |
$ cargo bisect-rustc --test-dir=. --start=2020-01-01 --regress=ice
...
ERROR: the end of the range (nightly-2021-02-17) does not reproduce the regression
It happens only on Rust 2015. |
This still panics with current nightly ee88f46:
|
This is rather strange. $ cargo bisect-rustc --test-dir=. --end=ee88f46bb5e27c4d9f30326e69ff2298dcbeecb1 --regress=ice
...
ERROR: the commit at the end of the range (ee88f46bb5e27c4d9f30326e69ff2298dcbeecb1) does not reproduce the regression
$ cargo build
Compiling bisect v0.1.0 (/home/habbasi/bisect)
error[E0573]: expected type, found module `result`
--> src/main.rs:2:6
|
2 | impl result {
| ^^^^^^ help: an enum with a similar name exists: `Result`
error[E0573]: expected type, found variant `Err`
--> src/main.rs:3:25
|
3 | fn into_future() -> Err {}
| ^^^ not a type
|
help: try using the variant's enum
|
3 | fn into_future() -> core::result::Result {}
| ^^^^^^^^^^^^^^^^^^^^
3 | fn into_future() -> crate::result::Result {}
| ^^^^^^^^^^^^^^^^^^^^^
3 | fn into_future() -> std::result::Result {}
| ^^^^^^^^^^^^^^^^^^^
error[E0601]: `main` function not found in crate `bisect`
--> src/main.rs:1:1
|
1 | / use std::result;
2 | | impl result {
3 | | fn into_future() -> Err {}
4 | | }
| |_^ consider adding a `main` function to `src/main.rs`
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0573, E0601.
For more information about an error, try `rustc --explain E0573`.
error: could not compile `bisect`
To learn more, run the command again with --verbose. Edit: It happens only when compiling with Rust 2015 edition. |
As stated in the edited message above, this ICE only happens on Rust 2015 edition.
|
The problem is an empty suggestion, #82087 fixes this. |
Fix ICE caused by suggestion with no code substitutions Change suggestion logic to filter and checking _before_ creating specific resolution suggestion. Assert earlier that suggestions contain code substitions to make it easier in the future to debug invalid uses. If we find this becomes too noisy in the wild, we can always make the emitter resilient to these cases and remove the assertions. Fix rust-lang#78651.
Code
Meta
rustc --version --verbose
:Error output
Backtrace
NOTE: The bug is found by our work-in-progress compiler testing tool Kira, and the test program is reduced/minimized by Perses
The text was updated successfully, but these errors were encountered: