-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Rustc panic when building bobbin-sdk #58767
Comments
cc @oli-obk |
Minimal repro: pub struct Hz;
impl Hz {
pub const fn num(&self) -> u32 {
42
}
pub const fn normalized(&self) -> Hz {
Hz
}
pub const fn as_u32(&self) -> u32 {
self.normalized().num()
}
} you need both the |
Ok, so promotion is indeed screwing up. The MIR is promoting the 4c4
< // disambiguator = before
---
> // disambiguator = after
14,24c14
< StorageLive(_3); // bb0[1]: scope 0 at src/lib.rs:12:9: 12:26
< StorageLive(_4); // bb0[2]: scope 0 at src/lib.rs:12:9: 12:13
< _4 = &(*_1); // bb0[3]: scope 0 at src/lib.rs:12:9: 12:13
< _3 = const Hz::normalized(move _4) -> [return: bb2, unwind: bb1]; // bb0[4]: scope 0 at src/lib.rs:12:9: 12:26
< // ty::Const
< // + ty: for<'r> fn(&'r Hz) -> Hz {Hz::normalized}
< // + val: Scalar(Bits { size: 0, bits: 0 })
< // mir::Constant
< // + span: src/lib.rs:12:14: 12:24
< // + ty: for<'r> fn(&'r Hz) -> Hz {Hz::normalized}
< // + literal: Evaluated(Const { ty: for<'r> fn(&'r Hz) -> Hz {Hz::normalized}, val: Scalar(Bits { size: 0, bits: 0 }) })
---
> goto -> bb2; // bb0[1]: scope 0 at src/lib.rs:12:9: 12:26
32,34c22,23
< _2 = &_3; // bb2[0]: scope 0 at src/lib.rs:12:9: 12:26
< StorageDead(_4); // bb2[1]: scope 0 at src/lib.rs:12:25: 12:26
< _0 = const Hz::num(move _2) -> [return: bb3, unwind: bb1]; // bb2[2]: scope 0 at src/lib.rs:12:9: 12:32
---
> _2 = &(promoted[0]: Hz); // bb2[0]: scope 0 at src/lib.rs:12:9: 12:26
> _0 = const Hz::num(move _2) -> [return: bb3, unwind: bb1]; // bb2[1]: scope 0 at src/lib.rs:12:9: 12:32
46,47c35
< StorageDead(_3); // bb3[1]: scope 0 at src/lib.rs:13:5: 13:6
< return; // bb3[2]: scope 0 at src/lib.rs:13:6: 13:6
---
> return; // bb3[1]: scope 0 at src/lib.rs:13:6: 13:6
|
triage: P-high. Looks under control. |
Just to confirm, this has not made it out to the nightly, correct? As of today I am still seeing the same error when attempting to build bobbin-hz as part of bobbin-sdk. |
No, #58784 is still open, I'll bump its priority |
While attempting to build the current bobbin-sdk under Ubuntu 18.04 using rust 1.34.0-nightly (02c4c28 2019-02-26) I get a panic in rustc.
The text was updated successfully, but these errors were encountered: