Skip to content

error message misleading if expression unsupported in match #13626

Closed
@nwin

Description

@nwin

When compiling

static val: [u8, ..1] = [0];

fn main() {
    match [1] {
        val => (),
        _ => ()
    }
}

The error message

$ rustc errormsg.rs 
errormsg.rs:1:25: 1:28 error: unsupported constant expr
errormsg.rs:1 static val: [u8, ..1] = [0];
                                      ^~~

points towards the definition of the constant and not the match statement which is misleading because the definition of the static value is perfectly fine but not its usage inside the match.

I am using rust 0.10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions