-
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_const_eval/pattern.rs:283: encountered errors lowering pattern #42285
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Comments
Reduced: const EMPTY_STRING: String = String::new();
fn main() {
let init_value = "".to_owned();
if let EMPTY_STRING = init_value {}
} ICE happens since 1.18 (no ICE on 1.17, only compile-error). Probably related to #38180, ICE #![feature(const_fn)]
#[derive(PartialEq, Eq)]
struct S;
const fn new() -> S { S }
const ES: S = new();
fn main() {
match S {
ES => {}
}
} Backtrace
|
People keep using |
Mark-Simulacrum
added
A-const-fn
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
labels
May 29, 2017
Same problem as #38180. |
RalfJung
added
the
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
label
Dec 1, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
I was trying to do something admittedly a little weird. 1)
match foo.into() { }
wherefoo
isInto<String>
. 2) Declare a const empty string to avoid creating a local temporary to match against (defined in a different module):pub const EMPTY_STRING: String = String::new();
.The offending code:
The text was updated successfully, but these errors were encountered: