-
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
repr(packed)
triggers internal compiler error
#48638
Comments
@bitshifter can you reproduce? |
@gnzlbg I can try, this is from Mar 2nd so not related to my recent changes right? |
Yes this is unrelated to that PR (I think there isn't a nightly including it yet). But since this is related to |
I started expanding the minimal example so that it didn't depend on nalgebra, it has expanded into quite a lot of code https://gist.github.com/bitshifter/afa4a3403802eebf9516ae7c3d174ba8 This example is enough to break the compiler but doesn't compile if the ICE is fixed (e.g. if the It appears to be the associated type that is hitting the ICE. |
Yeah @robsmith11 's example is huge. Maybe he doesn't know that minimal examples should have no dependencies. @robsmith11 if you don't provide minimal examples in bug reports (that is: no dependencies; they should compile in the play ground) they'll take much longer than necessary to fix. |
@gnzlbg I am able to work around this issue in my own code, so it's not that important to me, but I figured it might be easy for someone more experienced to spot what was going wrong. If you don't think it's worth the effort to investigate further, I have no problem with you closing this until a more simple manifestation is discovered. |
I've reduced it to the following (https://play.rust-lang.org/?gist=8678d365f2499392b15f00bc60eb42b8&version=stable): pub trait D {}
pub struct DT;
impl D for DT {}
pub trait A<R: D>: Sized {
type AS;
}
pub struct As<R: D>(R);
pub struct AT;
impl<R: D> A<R> for AT {
type AS = As<R>;
}
#[repr(packed)] // comment to make this pass
struct S(<AT as A<DT>>::AS);
fn main() {} |
It's no longer reproduced an ICE on the latest nightly, it seems from 1.38.0. marked as E-needstest |
Add some tests for fixed ICEs Fixes rust-lang#44153 (from 1.23.0) Fixes rust-lang#47486 (from 1.36.0) Fixes rust-lang#48010 (from 1.38.0) Fixes rust-lang#48027 (from nightly) Fixes rust-lang#48638 (from nightly)
Minimal example:
The text was updated successfully, but these errors were encountered: