-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
error: the compiler unexpectedly panicked. this is a bug. #132920
Comments
The linked reproduction repo appears to no longer exist. |
I'm sorry. I changed the visibility because I thought you had already found the issue. I had already modified the code to not cause a compiler error. |
Made it public again. malezjaa/game@7fa40a6 this commit contains old code in |
Thanks for making it public again. @rustbot label: +S-has-mcve -E-needs-mcve +regression-from-stable-to-nightly |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
cc @estebank in case the ping for this issue went under the radar |
Revert diagnostics hack to fix ICE 132920 This reverts 8a568d9 from rust-lang#128849 to fix the diagnostics ICE in rust-lang#132920. The hack mentioned in that commit was supposed to be tailored to E277, but that codepath is used actually shared with other errors, e.g. at least the E283 from the linked issue. We may have to eat the slightly worse diagnostics until a non-hacky way to make this error less verbose is implemented (or I guess a different hack specializing even more to E277's structure). Sorry `@estebank` 🙏. I can close this if you'd prefer to fix it in a different way. Since it seems unexpected that rust-lang#128849 would impact the repro, here's how the error used to look before that PR. ```console warning: unused import: `minirapier::Ray` --> src/main.rs:2:5 | 2 | use minirapier::Ray; | ^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default error[E0283]: type annotations needed --> src/main.rs:10:5 | 10 | insert_resource(Res.into()); | ^^^^^^^^^^^^^^^ ---------- type must be known at this point | | | cannot infer type of the type parameter `R` declared on the function `insert_resource` | = note: cannot satisfy `_: Resource` = help: the trait `Resource` is implemented for `Res` note: required by a bound in `insert_resource` --> src/main.rs:4:23 | 4 | fn insert_resource<R: Resource>(_resource: R) {} | ^^^^^^^^ required by this bound in `insert_resource` help: consider specifying the generic argument | 10 | insert_resource::<R>(Res.into()); | +++++ help: consider removing this method call, as the receiver has type `Res` and `Res: Resource` trivially holds | 10 - insert_resource(Res.into()); 10 + insert_resource(Res); ``` And how it looks now without the ICE. ```console warning: unused import: `minirapier::Ray` --> src/main.rs:2:5 | 2 | use minirapier::Ray; | ^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default error[E0283]: type annotations needed --> src/main.rs:10:5 | 10 | insert_resource(Res.into()); | ^^^^^^^^^^^^^^^ ---------- type must be known at this point | | | cannot infer type of the type parameter `R` declared on the function `insert_resource` | = note: cannot satisfy `_: Resource` note: there are multiple different versions of crate `minibevy` in the dependency graph --> /home/lqd/rust/tmp/minimization/issue-132920/rustc-ice-version-conflict/minibevy_b/src/lib.rs:1:1 | 1 | pub trait Resource {} | ^^^^^^^^^^^^^^^^^^ this is the required trait | ::: src/main.rs:1:5 | 1 | use minibevy::Resource; | -------- one version of crate `minibevy` is used here, as a direct dependency of the current crate 2 | use minirapier::Ray; | ---------- one version of crate `minibevy` is used here, as a dependency of crate `minirapier` | ::: /home/lqd/rust/tmp/minimization/issue-132920/rustc-ice-version-conflict/minibevy_a/src/lib.rs:1:1 | 1 | pub trait Resource {} | ------------------ this is the found trait = help: you can use `cargo tree` to explore your dependency tree note: required by a bound in `insert_resource` --> src/main.rs:4:23 | 4 | fn insert_resource<R: Resource>(_resource: R) {} | ^^^^^^^^ required by this bound in `insert_resource` help: consider specifying the generic argument | 10 | insert_resource::<R>(Res.into()); | +++++ help: consider removing this method call, as the receiver has type `Res` and `Res: Resource` trivially holds | 10 - insert_resource(Res.into()); 10 + insert_resource(Res); | ``` The improvements from rust-lang#128849 are still present and the note about the trait coming from the 2 versions of bevy is more explanatory/helpful than before, albeit a bit verbosely. Fixes rust-lang#132920.
Rollup merge of rust-lang#133304 - lqd:issue-132920, r=estebank Revert diagnostics hack to fix ICE 132920 This reverts 8a568d9 from rust-lang#128849 to fix the diagnostics ICE in rust-lang#132920. The hack mentioned in that commit was supposed to be tailored to E277, but that codepath is used actually shared with other errors, e.g. at least the E283 from the linked issue. We may have to eat the slightly worse diagnostics until a non-hacky way to make this error less verbose is implemented (or I guess a different hack specializing even more to E277's structure). Sorry ``@estebank`` 🙏. I can close this if you'd prefer to fix it in a different way. Since it seems unexpected that rust-lang#128849 would impact the repro, here's how the error used to look before that PR. ```console warning: unused import: `minirapier::Ray` --> src/main.rs:2:5 | 2 | use minirapier::Ray; | ^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default error[E0283]: type annotations needed --> src/main.rs:10:5 | 10 | insert_resource(Res.into()); | ^^^^^^^^^^^^^^^ ---------- type must be known at this point | | | cannot infer type of the type parameter `R` declared on the function `insert_resource` | = note: cannot satisfy `_: Resource` = help: the trait `Resource` is implemented for `Res` note: required by a bound in `insert_resource` --> src/main.rs:4:23 | 4 | fn insert_resource<R: Resource>(_resource: R) {} | ^^^^^^^^ required by this bound in `insert_resource` help: consider specifying the generic argument | 10 | insert_resource::<R>(Res.into()); | +++++ help: consider removing this method call, as the receiver has type `Res` and `Res: Resource` trivially holds | 10 - insert_resource(Res.into()); 10 + insert_resource(Res); ``` And how it looks now without the ICE. ```console warning: unused import: `minirapier::Ray` --> src/main.rs:2:5 | 2 | use minirapier::Ray; | ^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default error[E0283]: type annotations needed --> src/main.rs:10:5 | 10 | insert_resource(Res.into()); | ^^^^^^^^^^^^^^^ ---------- type must be known at this point | | | cannot infer type of the type parameter `R` declared on the function `insert_resource` | = note: cannot satisfy `_: Resource` note: there are multiple different versions of crate `minibevy` in the dependency graph --> /home/lqd/rust/tmp/minimization/issue-132920/rustc-ice-version-conflict/minibevy_b/src/lib.rs:1:1 | 1 | pub trait Resource {} | ^^^^^^^^^^^^^^^^^^ this is the required trait | ::: src/main.rs:1:5 | 1 | use minibevy::Resource; | -------- one version of crate `minibevy` is used here, as a direct dependency of the current crate 2 | use minirapier::Ray; | ---------- one version of crate `minibevy` is used here, as a dependency of crate `minirapier` | ::: /home/lqd/rust/tmp/minimization/issue-132920/rustc-ice-version-conflict/minibevy_a/src/lib.rs:1:1 | 1 | pub trait Resource {} | ------------------ this is the found trait = help: you can use `cargo tree` to explore your dependency tree note: required by a bound in `insert_resource` --> src/main.rs:4:23 | 4 | fn insert_resource<R: Resource>(_resource: R) {} | ^^^^^^^^ required by this bound in `insert_resource` help: consider specifying the generic argument | 10 | insert_resource::<R>(Res.into()); | +++++ help: consider removing this method call, as the receiver has type `Res` and `Res: Resource` trivially holds | 10 - insert_resource(Res.into()); 10 + insert_resource(Res); | ``` The improvements from rust-lang#128849 are still present and the note about the trait coming from the 2 versions of bevy is more explanatory/helpful than before, albeit a bit verbosely. Fixes rust-lang#132920.
Code
The reproduction is a simple game in bevy: https://github.com/malezjaa/game
Meta
rustc --version --verbose
:Error output
rustc-ice-2024-11-11T21_25_06-29784.txt
The text was updated successfully, but these errors were encountered: