Skip to content

Odd types in mismatch #18115

Open
Open

Description

fn t(
    parents: &[&()],
)  {}
   
fn a() {
    let x: ();
    t(&[x])
}

Just an observation which might be unactionable but the snippet above yields expected &[&()], found &[!; 1]rust-analyzer[E0308](https://doc.rust-lang.org/stable/error_codes/E0308.html). Notably the never type in there is odd. I'd expect &[(); 1] given we know the type of x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsdiagnostics / error reportingA-tytype system / type inference / traits / method resolutionC-enhancementCategory: enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions