-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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: src/librustc_typeck/check/mod.rs:2406: no type for node #57924
Comments
Panics on Somewhat minimized: pub trait AeadCipher {
fn new(key: &[u8]) -> Self;
}
pub trait BlockCipher {
fn new(key: &[u8]) -> Self;
}
struct Processor<E> {
block_cipher: E,
}
pub struct Gcm<E>(Processor<E>);
impl<E: BlockCipher> AeadCipher for Gcm<E> {
fn new(key: &[u8]) -> Self {
// Gcm::<E>(Processor::<E>::new(key))
Self::<E>(Processor::<E>::new(key)) // ICE
}
}
impl<E: BlockCipher> Processor<E> {
fn new(key: &[u8]) -> Self {
Self {
block_cipher: E::new(key),
}
}
} |
ICEs occur on 1.31 and 1.30 as well. Previously, 1.29 produced the error.
|
cargo bisect rustc helped narrow the regression to edit: #53751 seems possible. there has been a bit of changes to the code since, including fixes to other ICEs dealing with |
Minified: pub struct Gcm<E>(E);
impl<E> Gcm<E> {
pub fn crash(e: E) -> Self {
Self::<E>(e)
}
} ICE does not happen with |
Tried to figure out the root cause by creating a similar, but passing, test case (using
Specifically, what I'm seeing is that, when starting out from The Later, it calls into The first element popped off the stack is AFAIU, this is because we calculated I tried to move the part that rewrites the [0] |
Rewrite the SelfCtor early and use the replacement Def when calculating the path_segs. Note that this also changes which def is seen by the code that computes user_self_ty and is_alias_variant_ctor; I don't see a immediate issue with that, but I'm not 100% clear on the implications. Fixes rust-lang#57924
Fix generic argument lookup for Self Rewrite the SelfCtor early and use the replacement Def when calculating the path_segs. Note that this also changes which def is seen by the code that computes user_self_ty and is_alias_variant_ctor; I don't see a immediate issue with that, but I'm not 100% clear on the implications. Fixes rust-lang#57924 r? @eddyb
Fix generic argument lookup for Self Rewrite the SelfCtor early and use the replacement Def when calculating the path_segs. Note that this also changes which def is seen by the code that computes user_self_ty and is_alias_variant_ctor; I don't see a immediate issue with that, but I'm not 100% clear on the implications. Fixes rust-lang#57924 r? @eddyb
Fix generic argument lookup for Self Rewrite the SelfCtor early and use the replacement Def when calculating the path_segs. Note that this also changes which def is seen by the code that computes user_self_ty and is_alias_variant_ctor; I don't see a immediate issue with that, but I'm not 100% clear on the implications. Fixes rust-lang#57924 r? @eddyb
Fix generic argument lookup for Self Rewrite the SelfCtor early and use the replacement Def when calculating the path_segs. Note that this also changes which def is seen by the code that computes user_self_ty and is_alias_variant_ctor; I don't see a immediate issue with that, but I'm not 100% clear on the implications. Fixes rust-lang#57924 r? @eddyb
Fix generic argument lookup for Self Rewrite the SelfCtor early and use the replacement Def when calculating the path_segs. Note that this also changes which def is seen by the code that computes user_self_ty and is_alias_variant_ctor; I don't see a immediate issue with that, but I'm not 100% clear on the implications. Fixes rust-lang#57924 r? @eddyb
Fix generic argument lookup for Self Rewrite the SelfCtor early and use the replacement Def when calculating the path_segs. Note that this also changes which def is seen by the code that computes user_self_ty and is_alias_variant_ctor; I don't see a immediate issue with that, but I'm not 100% clear on the implications. Fixes rust-lang#57924 r? @eddyb
May be related to #47713
I tried this code: Compiling the project here, but at this line replacing
Gcm
withSelf
I expected to see this happen: Code compiles or gives error messages
Instead, this happened: Compiler panicked with stack trace below
Meta
rustc --version --verbose
:Backtrace:
The text was updated successfully, but these errors were encountered: