-
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
Compiler panic with associated constant #58435
Comments
This is broken on stable and beta but works on nightly. Reduced: struct _S<T>(T);
impl<T> _S<T> {
const _ID: fn(_S<T>) = |_| {};
pub fn _id(self) {
_S::<T>::_ID(self)
}
}
fn _foo() {
_S(())._id();
} Might be worth beta-backporting whatever we did to fix it on nightly? |
Bug was fixed between 01f8e25...bf669d1 (nightly-2019-01-24 and 01-25) |
triage: assigning to self to attempt to identify backport. |
The bors merges in this range were: % git log 01f8e25...bf669d1 --author bors --format=oneline
|
Initial guesses as to which PR(s) in list above seem most relevant: #57606 ... (That's assuming that the const-eval bit in the stack trace is the most relevant clue as to the cause of the ICE.) all the others don't seem to touch const-eval. |
But, wait, what am I doing here... at this point enough time has passed that the current beta is able to handle the example without ICE'ing. This bug does not seem worthy of attempting a backport all the way to stable. (In other words, the time to attempt a backport would have been prior to when the beta-next was cut from the nightly, which was around a week ago.) |
Oh wait, lets at least add a regression test |
…t, r=alexcrichton Regression test for rust-lang#58435. Fix rust-lang#58435
Rollup of 24 pull requests Successful merges: - #58080 (Add FreeBSD armv6 and armv7 targets) - #58204 (On return type `impl Trait` for block with no expr point at last semi) - #58269 (Add librustc and libsyntax to rust-src distribution.) - #58369 (Make the Entry API of HashMap<K, V> Sync and Send) - #58861 (Expand where negative supertrait specific error is shown) - #58877 (Suggest removal of `&` when borrowing macro and appropriate) - #58883 (Suggest appropriate code for unused field when destructuring pattern) - #58891 (Remove stray ` in the docs for the FromIterator implementation for Option) - #58893 (race condition in thread local storage example) - #58906 (Monomorphize generator field types for debuginfo) - #58911 (Regression test for #58435.) - #58912 (Regression test for #58813) - #58916 (Fix release note problems noticed after merging.) - #58918 (Regression test added for an async ICE.) - #58921 (Add an explicit test for issue #50582) - #58926 (Make the lifetime parameters of tcx consistent.) - #58931 (Elide invalid method receiver error when it contains TyErr) - #58940 (Remove JSBackend from config.toml) - #58950 (Add self to mailmap) - #58961 (On incorrect cfg literal/identifier, point at the right span) - #58963 (libstd: implement Error::source for io::Error) - #58970 (delay_span_bug in wfcheck's ty.lift_to_tcx unwrap) - #58984 (Teach `-Z treat-err-as-bug` to take a number of errors to emit) - #59007 (Add a test for invalid const arguments) Failed merges: - #58959 (Add release notes for PR #56243) r? @ghost
The compiler panics when I use a generic associated constant from within the impl.
I was able to reproduce it with this code:
Meta
rustc --version --verbose
:rustc 1.32.0 (9fda7c2 2019-01-16)
binary: rustc
commit-hash: 9fda7c2
commit-date: 2019-01-16
host: x86_64-unknown-linux-gnu
release: 1.32.0
LLVM version: 8.0
Backtrace:
The text was updated successfully, but these errors were encountered: