-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Internal compiler error when creating a static constant #31577
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
Labels
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
Here's a backtrace from
|
Minified: static FOO: () = match () {
_x => ()
}; |
This is actually filed here (#29093) already |
ryan-scott-dev
pushed a commit
to ryan-scott-dev/rust
that referenced
this issue
Apr 4, 2017
…ixes rust-lang#31577, fixes rust-lang#29093, and fixes rust-lang#40012.
bors
added a commit
that referenced
this issue
Apr 8, 2017
…, r=arielb1 Fixed ICEs with pattern matching in const expression Fixed 2 ICEs with when pattern matching inside a constant expression. Both of these ICEs now resolve to an appropriate compiler error. 1. ICE was caused by a compiler bug to implement discriminant const qualify. I removed this intentionally thrown bug and changed it to a FIXME as the unimplemented expression type is handled as a compiler error elsewhere. 2. ICE was caused during a drop check when checking if a variable lifetime outlives the current scope if there was no parent scope . I've changed it to stop checking if there is no parent scope for the current scope. It is valid syntax for a const variable to be assigned a match expression with no enclosing scope. The ICE seemed to mainly be used as a defensive check for bugs elsewhere. Fixes #38199. Fixes #31577. Fixes #29093. Fixes #40012.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to create static or constant from matching the env::home_dir:
But I'm getting a compiler bug:
I know that my code is broken but compiller should not crush anyway.
rustc 1.6.0 (c30b771 2016-01-19)
binary: rustc
commit-hash: c30b771
commit-date: 2016-01-19
host: x86_64-unknown-linux-gnu
release: 1.6.0
The text was updated successfully, but these errors were encountered: