Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E0034: provide disambiguated syntax for candidates #38168

Merged
merged 1 commit into from
Jan 18, 2017

Commits on Jan 12, 2017

  1. E0034: provide disambiguated syntax for candidates

    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 rust-lang#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 rust-lang#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)
      |     ^^^
    ```
    estebank committed Jan 12, 2017
    Configuration menu
    Copy the full SHA
    f595ea2 View commit details
    Browse the repository at this point in the history