-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE: assertion failed: prev_const.is_none() || prev_const == Some(llconst) #24644
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
Comments
I'm getting the same ICE as well. |
Possibly useful information: it's the braces around trait Trait {}
struct Bar;
impl Trait for Bar {}
fn main() {
let x: &[&Trait] = &[&Bar];
} Putting braces around Tested on latest nightly. |
This is the specific ICE issue: rust-lang/rust#24644
The slice is superfluous: trait Trait {}
struct Bar;
impl Trait for Bar {}
const FOO: &'static Trait = &Bar;
const BAR: &'static Trait = FOO;
fn main() { let x = BAR; } The assertion is triggered by |
Another example, from #25748: pub struct UTF8Encoding;
pub const UTF_8: &'static UTF8Encoding = &UTF8Encoding;
pub trait Encoding {}
impl Encoding for UTF8Encoding {}
pub fn f() -> &'static Encoding { UTF_8 as &'static Encoding } In this case, the explicit cast is redundant and there's an automatic unsizing from |
Code
Output
Rust Version
The text was updated successfully, but these errors were encountered: