Skip to content

Better error message when using ~ in statics #10487

Closed
@emberian

Description

@emberian
static x: ~[int] = ~[123, 456];

fn main() {}
foo.rs:1:19: 1:30 error: constant contains unimplemented expression type
foo.rs:1 static x: ~[int] = ~[123, 456];
                            ^~~~~~~~~~~
error: aborting due to previous error

While not inaccurate, it should explain that ~ is not supported in statics and won't be, not that it's just unimplemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions