-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 during migration to Rust 2021, crate: stm32h7xx-hal #87426
Labels
A-edition-2021
Area: The 2021 edition
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
hargoniX
added
C-bug
Category: This is a bug.
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.
labels
Jul 24, 2021
jyn514
added
A-edition-2021
Area: The 2021 edition
requires-nightly
This issue requires a nightly compiler in some way.
labels
Jul 24, 2021
Thanks for the report! Here's a somewhat minimized reproduction: pub fn foo() {
let ref_x_ck = 123;
let _y = || match ref_x_ck {
2_000_000..=3_999_999 => {}
_ => {}
};
} |
cc @rust-lang/wg-rfc-2229 |
@rustbot claim |
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Jul 29, 2021
…matsakis 2229: Discr should be read when PatKind is Range This PR fixes an issue related to pattern matching in closures when Edition 2021 is enabled. - If any of the patterns the discr is being matched on is `PatKind::Range` then the discr should be read r? `@nikomatsakis` Closes rust-lang#87426
fee1-dead
added a commit
to fee1-dead-contrib/rust
that referenced
this issue
Jul 29, 2021
…matsakis 2229: Discr should be read when PatKind is Range This PR fixes an issue related to pattern matching in closures when Edition 2021 is enabled. - If any of the patterns the discr is being matched on is `PatKind::Range` then the discr should be read r? ``@nikomatsakis`` Closes rust-lang#87426
bors bot
added a commit
to stm32-rs/stm32h7xx-hal
that referenced
this issue
Jan 3, 2022
236: Migrate to Rust 2021 as part of the public testing r=richardeoin a=hargoniX Migration to Rust 2021 as part of the public testing. We did actually catch one ICE bug with this \o/: rust-lang/rust#87426 Co-authored-by: Henrik Böving <[email protected]> Co-authored-by: Richard Meadows <[email protected]>
bors bot
added a commit
to stm32-rs/stm32h7xx-hal
that referenced
this issue
Jan 3, 2022
236: Migrate to Rust 2021 as part of the public testing r=richardeoin a=hargoniX Migration to Rust 2021 as part of the public testing. We did actually catch one ICE bug with this \o/: rust-lang/rust#87426 305: remove release mode requirement from USB examples r=richardeoin a=newAM This was fixed in usb-device: rust-embedded-community/usb-device#41 Co-authored-by: Henrik Böving <[email protected]> Co-authored-by: Richard Meadows <[email protected]> Co-authored-by: Alex Martens <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-edition-2021
Area: The 2021 edition
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Code
Regarding a minimal example I am afraid I'm not quite able to provide one, this bug occured when i was migrating
https://github.com/stm32-rs/stm32h7xx-hal to Rust 2021 as part of the testing efforts. The branch/PR with the
Rust 2021 modifications can be found here stm32-rs/stm32h7xx-hal#236. I did cfgment all
modules except the ones that are required to trigger the bug out: https://github.com/stm32-rs/stm32h7xx-hal/blob/rust2021/src/lib.rs#L250-L253. And removed most code and modules from the rcc module: https://github.com/stm32-rs/stm32h7xx-hal/blob/rust2021/src/rcc/mod.rs#L144-L155, nailing the bug down to src/rcc/pll.rs (as the error message suggested). Then i minized further in pll.rs (its 200 lines now, the rest is just tests) And I was in fact able to pin point the panic to this piece of code:
https://github.com/stm32-rs/stm32h7xx-hal/blob/rust2021/src/rcc/pll.rs#L95-L104, if I comment it out the ICE doesn't occur anymore so I would guess that this is what the compiler is having issues with.
Meta
rustc --version --verbose
:Error output
Compilation command I used was:
cargo +nightly build --features=rt,stm32h743
Backtrace
The text was updated successfully, but these errors were encountered: