-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 when accessing an associated constant of a generic impl #55219
Comments
I tried bisecting this but quite a few commits in that PR throw out errors starting with:
Bisect log:
|
This is triggered by accessing an associated constant of a generic impl. Here's a minimized testcase that ICEs on nightly (playground link): pub struct Foo<T>(T);
impl<T> Foo<T> {
const HASH_LEN: usize = 20;
fn stuff() {
let _ = Self::HASH_LEN;
}
} If a lifetime parameter is used instead of a type parameter, no ICE occurs. This is all I know, someone else will have to figure out what it means. :) |
@tmandry Aha! That does happen in mysql_common as well, a few lines above the location I pointed out before: |
I reverted only commit e94959b locally, and both |
rustc 1.31.0-nightly (78ff609d7 2018-10-19)
an NLL PR injected this so it seems fair that someone from WG-compiler-nll should have to fix it. Tagging with NLL-complete. Note that migration does not mitigate this because it is an ICE. |
Tagging as a Release blocker. But does not need to block RC2; instead, will probably need a beta backport. |
Have a pending fix. |
Add regression tests for rust-lang#55219 and rust-lang#55241 Also another test where a duplicate-like error appears to have been suppressed; I'm not 100% sure why this output changes, though I could imagine that some duplicate suppression is enabled by this PR.
(minimized test case provided by @tmandry )
This is triggered by accessing an associated constant of a generic impl. Here's a minimized testcase that ICEs on nightly (playground link):
If a lifetime parameter is used instead of a type parameter, no ICE occurs.
Original bug report follows
Compiling mysql_common fails on
rustc 1.31.0-nightly (78ff609d7 2018-10-19)
, but works on the previous nightlyrustc 1.31.0-nightly (e7f5d4805 2018-10-18)
.Some additional detail with RUST_LOG=debug before and after the stack trace:
The problematic code appears to be https://github.com/blackbeam/rust_mysql_common/blob/master/src/crypto/rsa.rs#L88
PR #55152 looks like a likely cause as it touched the failing
assert!
and nearby code, cc @nikomatsakisEDIT: typo in PR number.
The text was updated successfully, but these errors were encountered: