-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 on sized-chunks crate #4121
Comments
Going to investigate this now and try to get a minimal repro case. |
Minimal repro: use std::mem::{self};
pub struct Foo<A, B>(A, B);
impl<A, B> Foo<A, B> {
const HOST_SIZE: usize = mem::size_of::<B>();
pub fn crash() -> bool {
Self::HOST_SIZE == 0
}
} The conditional triggers the crash. It crashes here, called from the rust-clippy/clippy_lints/src/consts.rs Line 342 in 2cc23a5
Unfortunately I ran out of time for today, so if someone want's to continue with this, feel free. |
cc @oli-obk |
Managed to further reduce the example (updated above) and got some initial debug output of the data that causes the crash. Unfortunately there's nothing that stands out as outright wrong so far:
Perhaps we should just skip generics in |
One thing that I see that's odd is rust-clippy/clippy_lints/src/consts.rs Line 331 in 2cc23a5
This will always be true. |
I've found the problem, it is in rustc. Currently trying to create a rustc-only ICE |
Can anyone confirm that the bug is no longer present? ( |
#4121 (comment) doesn't crash with |
I checked both the reduced code and the sized-chunks crate and neither crashed clippy. |
I'll add a test in a minute 👍 |
Test for melted ICE #4121 resolves #4121 r? @matthiaskrgr changelog: none
Uh... how was this fixed without rust-lang/rust#63497 ? Did we accidentally add a workaround in clippy? |
The sized-chunks v0.3.0 crate is causing an ICE in latest clippy. I do not know where to start debugging this.
The text was updated successfully, but these errors were encountered: