Skip to content

Odd "mismatched types" error message #9249

Closed
@jruderman

Description

@jruderman
static DATA:&'static [&'static str] = ["my string"];
fn main() { }

The error message seems to confuse lifetime with size:

error: mismatched types:
    expected `&'static [&'static str]` 
    but found `[&'static str, .. 1]`
    ([] storage differs: expected &'static  but found 1)

Also note the extra space after &'static.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions