-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
error: internal compiler error: "inference variables in ..." on packed type #61402
Comments
Still encountering this in Indepent of the issue, you can install specific compiler versions with necessary components according to this matrix and this installation process. |
This ICE itself arises from this line: rust/src/librustc_typeck/check/wfcheck.rs Line 264 in 51dc52b
|
triage: P-high, assigning to self. Removing nomination. |
Okay I've narrowed the test case down click for first reductionHere is a standalone file (play): #![allow(unused_imports, dead_code)]
pub struct U1;
pub trait ArrayLength { }
impl ArrayLength for U1 { }
pub trait Trait { type Output; }
impl Trait for U1 { type Output = U1; }
pub trait DimName { type Value; }
impl DimName for U1 { type Value = U1; }
pub struct ArrayStorage<R>
where
R: DimName,
R::Value: Trait,
<R::Value as Trait>::Output: ArrayLength,
{
data: <R::Value as Trait>::Output,
}
pub struct DefaultAllocator;
pub trait Allocator<R = U1> { type Buffer; }
impl<R: DimName> Allocator<R> for DefaultAllocator
where
R::Value: Trait,
<R::Value as Trait>::Output: ArrayLength,
{
type Buffer = ArrayStorage<R>;
}
#[repr(C, packed)]
struct Vertex {
pos: <DefaultAllocator as Allocator>::Buffer
}
fn main() { println!("Hello, world!"); } Update: Got a better reduction now (play): #![allow(unused_imports, dead_code)]
pub struct S;
pub trait Trait<R> { type Assoc; }
impl<X> Trait<X> for S { type Assoc = X; }
#[repr(C, packed)]
struct Packed {
pos: Box<<S as Trait<usize>>::Assoc>,
}
fn main() { println!("Hello, world!"); } |
This is a stable-to-stable regression, injected between rust 1.23 and 1.24. |
the fact that the bug goes away if you take away the |
(Also, bisection on my mac has shown this was injected by PR #44884 ) |
for last-field, rather than even a delayed ICE. Fix rust-lang#61402.
Normalization can leave some type-vars unresolved in its return type. Make sure to resolve them so we have an infcx-independent type that can be used with `needs_drop`. Fixes rust-lang#61402.
wfcheck: resolve the type-vars in `AdtField` types Normalization can leave some type-vars unresolved in its return type. Make sure to resolve them so we have an infcx-independent type that can be used with `needs_drop`. Fixes rust-lang#61402. Closes rust-lang#62212 - this PR fixes the root cause.
wfcheck: resolve the type-vars in `AdtField` types Normalization can leave some type-vars unresolved in its return type. Make sure to resolve them so we have an infcx-independent type that can be used with `needs_drop`. Fixes rust-lang#61402. Closes rust-lang#62212 - this PR fixes the root cause.
wfcheck: resolve the type-vars in `AdtField` types Normalization can leave some type-vars unresolved in its return type. Make sure to resolve them so we have an infcx-independent type that can be used with `needs_drop`. Fixes rust-lang#61402. Closes rust-lang#62212 - this PR fixes the root cause.
wfcheck: resolve the type-vars in `AdtField` types Normalization can leave some type-vars unresolved in its return type. Make sure to resolve them so we have an infcx-independent type that can be used with `needs_drop`. Fixes rust-lang#61402. Closes rust-lang#62212 - this PR fixes the root cause.
Given the following source code in both
release 1.35.0
and1.36.0-nightly (e305df184 2019-04-24)
, I encounter an internal compiler error using nalgebra 0.18.0.The code is probably not legal to begin with as I ran into it as I was moving from my own homebrewn math code to nalgebra. I have the impression that the compiler probably shouldn't ICE regardless of what junk you feed it, so I'm still reporting this.
Build output from
cargo +nightly build
:I unfortunately do not have a newer nightly to test with due to the lack of a more recent RLS blocking the rustup attempt.
The text was updated successfully, but these errors were encountered: