-
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
ICE: cannot convert ReEarlyBound(0, 'a)
to a region vid
#68532
Comments
The ICE also goes away if I change |
Ok. I minimized it to just: fn main() {}
struct A<'a>(&'a ());
impl<'a> A<'a> {
const N: usize = 68;
fn foo(&self) {
let mut b = [0; Self::N];
}
} It ICEs on latest nightly: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=7cc81a6eead5acb39f6a3ca58131ed0f |
triage: P-high, assiging to self, removing nomination label |
Following example fails to compile: pub struct A<T>(T);
impl<T> A<T> {
pub const N: usize = 68;
pub fn foo(&self) {
let b = [0; Self::N];
println!("{}", b.len());
}
} Error
Even if I add pub fn foo(&self) where T: Sized {
let b = [0; Self::N];
println!("{}", b.len());
} or impl<T: Sized> A<T> {
pub const N: usize = 68;
pub fn foo(&self) {
let b = [0; Self::N];
println!("{}", b.len());
}
} Error
But this works: pub struct A<T>(T);
impl<T> A<T> {
pub const N: usize = 68;
pub fn foo(&self) {
let b = Self::N;
println!("{}", b);
}
} |
Also just got this; no idea how to minimize it and the trace doesn't seem useful:-
|
If this is referring to the field |
Inlining |
Add some regression tests Closes rust-lang#68532 Closes rust-lang#70121 Closes rust-lang#71042 CC rust-lang#56445 r? @matthewjasper since they (except for rust-lang#71042) are related to rust-lang#72362.
I got an internal compiler error at commit 95th/btrs@f2eb533 . I dont know how to minimize it.
Relevant code is:
If I remove the const field and directly put the array size like below, the ICE goes away and I get the expected compilation error that [u8; 68] is not
Debug
.Backtrace:
Version info
The text was updated successfully, but these errors were encountered: