-
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
Extra type parameters make compiler panic calling Option::unwrap()
on None
#36954
Comments
OK, nightly compiler 2016-09-21 does not ICE, narrowing the range to >2016-09-21. |
OK, nightly compiler 2016-09-22 does not ICE either. |
OK, nightly compiler 2016-09-27 does ICE. rustup tells me there are no nightly toolchains to download for Sep 2016 23, 24, 25 or 26. |
Minimized:
#![feature(const_fn)]
#![crate_type = "lib"]
const fn foo(i: i32) -> i32 {
i
}
pub const FOO: i32 = foo(1);
extern crate lib;
fn main() {
let _ = lib::FOO;
} The |
Wow - that's impressive finding the cause that quickly. |
cc @rust-lang/compiler |
We don't seem to have any tests for cross-crate The fix would involve using Such ugly hacks will go away once @solson merges miri and we hook it up for early const eval. |
I think I might be hitting this issue too but my project is too big to track down the cause properly. |
I get the same stack backtrace on macOS 10.12.1 Beta (16B2338c) with the nightly. The same code compiles just fine in an ubuntu docker container. |
@eddyb Any chance of a short term fix or reversion of change? Please? I know |
@raphaelcohn I'm sorry if it wasn't clear, I described a quick fix in my comment and am willing to mentor it on IRC. |
@eddyb Sorry for the late reply, I've been child rearing over half term. I appreciate the offer to mentor it, but I've not got the current time to commit. If someone else wants to take up your offer (@datariot, @HeroesGrave perhaps?) I'd be happy to test a fix. Since this is a blocker for my team, we may fork the upstream crates we depend on and strip out their use of |
Use DefId's in const eval for cross-crate const fn's Fixes rust-lang#36954. r? @eddyb cc @raphaelcohn
I'm tagging with I'm also nominating for @rust-lang/compiler to discuss whether to bump this to P-high. It is a regression, but only affecting |
@nikomatsakis Thanks, but #37557 is in the queue already. |
Argh, I see it now. For some reason I always overlook those "citations". Sorry for the noise. |
Use DefId's in const eval for cross-crate const fn's Fixes rust-lang#36954. r? @eddyb cc @raphaelcohn
Use DefId's in const eval for cross-crate const fn's Fixes rust-lang#36954. r? @eddyb cc @raphaelcohn
Use DefId's in const eval for cross-crate const fn's Fixes rust-lang#36954. r? @eddyb cc @raphaelcohn
There's been a change in the Rust nightly compiler sometime between 2016-09-15 and 2016-09-28 (both inclusive) that causes it to ICE on the code in this repository. Compiling on Mac OS X El Capitan, using
TARGET_CC=x86_64-linux-musl-cc exec cargo build --target=x86_64-unknown-linux-musl
(this assumesbrew install FiloSottile/musl-cross/musl-cross
using Homebrew).There are no code changes. A backtrace shows the following:-
When the code compiles with the older Rust compiler, the output is:-
I'll try to triage further.
The text was updated successfully, but these errors were encountered: