Skip to content

APITIT get treated as ordinary params in "not all trait impls implemented" error #126395

Open
@lcnr

Description

@lcnr
// crate dep
pub trait Trait {
    fn foo(_: impl Sized);
    fn bar<T>(_: impl Sized);
}
// root
use dep::*;

struct Local;
impl Trait for Local {}

results in the following error:

error[E0046]: not all trait items implemented, missing: `foo`, `bar`
 --> src/main.rs:4:1
  |
4 | impl Trait for Local {}
  | ^^^^^^^^^^^^^^^^^^^^ missing `foo`, `bar` in implementation
  |
  = help: implement the missing item: `fn foo<impl Sized>(_: impl Sized) { todo!() }`
  = help: implement the missing item: `fn bar<T, impl Sized>(_: impl Sized) { todo!() }`

This wrongly includes the APITIT in the generic args. It should be

  = help: implement the missing item: `fn foo(_: impl Sized) { todo!() }`
  = help: implement the missing item: `fn bar<T>(_: impl Sized) { todo!() }`

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsD-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.D-papercutDiagnostics: An error or lint that needs small tweaks.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions