• E
    E0034: provide disambiguated syntax for candidates · f595ea25
    Esteban Küber 提交于
    For a given file
    
    ```rust
    trait A { fn foo(&self) {} }
    trait B : A { fn foo(&self) {} }
    
    fn bar<T: B>(a: &T) {
      a.foo()
    }
    ```
    
    provide the following output
    
    ```
    error[E0034]: multiple applicable items in scope
     --> file.rs:6:5
      |
    6 |   a.foo(1)
      |     ^^^ multiple `foo` found
      |
    note: candidate #1 is defined in the trait `A`
     --> file.rs:2:11
      |
    2 | trait A { fn foo(&self, a: usize) {} }
      |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
    help: to use it here write `A::foo(&a, 1)` instead
     --> file.rs:6:5
      |
    6 |   a.foo(1)
      |     ^^^
    note: candidate #2 is defined in the trait `B`
     --> file.rs:3:15
      |
    3 | trait B : A { fn foo(&self, a: usize) {} }
      |               ^^^^^^^^^^^^^^^^^^^^^^^^^^
    help: to use it here write `B::foo(&a, 1)` instead
     --> file.rs:6:5
      |
    6 |   a.foo(1)
      |     ^^^
    ```
    f595ea25
issue-37767.rs 858 字节