Skip to content

Incomplete type inference: type annotations needed #22509

@Veykril

Description

@Veykril
struct LocalClient(*const ());
trait AmbiguousIfSend<A> {
    fn some_item() {}
}
impl<T: ?Sized> AmbiguousIfSend<()> for T {}
impl<T: ?Sized + Send> AmbiguousIfSend<u8> for T {}
fn _assert_not_send() {
    <LocalClient as AmbiguousIfSend<_>>::some_item();
//                                  ^
// type annotations needed
// full type: fn some_item<LocalClient, {unknown}>()
// (rust-analyzer E0282)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolutionC-bugCategory: bugS-unactionableIssue requires feedback, design decisions or is blocked on other work

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions