Skip to content

False non-primitive cast diagnostic #18626

@Veykril

Description

@Veykril
fn f() {
    trait T {
        fn f() {}
    }
    impl T for i32 {}
    impl T for u32 {}
    &[i32::f, u32::f] as &[fn()];
}

triggers two false diagnostics

non-primitive cast: `&[fn f<i32>(); 2]` as `&[fn()]`rust-analyzer[E0605](https://doc.rust-lang.org/stable/error_codes/E0605.html)
expected fn f<i32>(), found fn f<u32>()rust-analyzer[E0308](https://doc.rust-lang.org/stable/error_codes/E0308.html)

Metadata

Metadata

Labels

A-diagnosticsdiagnostics / error reportingA-tytype system / type inference / traits / method resolutionC-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions