Skip to content

Can't implement methods with the same name on non-overlapping generic specializations #10699

Closed
@jdm

Description

@jdm
struct Foo<T>;
impl Foo<int> {
  fn foo() {}
}
impl Foo<f64> {
  fn foo() {}
}
t.rs:6:2: 6:13 error: duplicate definition of value `foo`
t.rs:6   fn foo() {}
         ^~~~~~~~~~~
t.rs:3:2: 3:13 note: first definition of value `foo` here
t.rs:3   fn foo() {}
         ^~~~~~~~~~~

This is frustrating.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions