Skip to content
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 using 'match' on enum parameter inside const function #40808

Closed
frewsxcv opened this issue Mar 24, 2017 · 1 comment
Closed

ICE when using 'match' on enum parameter inside const function #40808

frewsxcv opened this issue Mar 24, 2017 · 1 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) ❄️

Comments

@frewsxcv
Copy link
Member

frewsxcv commented Mar 24, 2017

#![feature(const_fn)]

pub enum A {
    B,
    C,
}

const fn foo(a: A) {
    match a {
        A::B => (),
        A::C => (),
    }
}

fn main() {}

playpen: https://is.gd/n7pDFb

rustc 1.17.0-nightly (e703b33e3 2017-03-23)
error: internal compiler error: /checkout/src/librustc_mir/transform/qualify_consts.rs:733: implement discriminant const qualify

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:418
note: Run with `RUST_BACKTRACE=1` for a backtrace.
@frewsxcv frewsxcv added A-const-fn I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Mar 24, 2017
@frewsxcv frewsxcv changed the title ICE when 'match'ing inside const function ICE when using 'match' on enum parameter inside const function Mar 24, 2017
@frewsxcv
Copy link
Member Author

Duplicate of #40012

@RalfJung 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) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants