rust/src/test/ui/methods
Dylan DPC f2810d5fa0
Rollup merge of #84221 - ABouttefeux:generic-arg-elision, r=estebank
E0599 suggestions and elision of generic argument if no canditate is found

fixes #81576
changes: In error E0599 (method not found) generic argument are eluded if the method was not found anywhere. If the method was found in another inherent implementation suggest that it was found elsewhere.

Example
```rust

struct Wrapper<T>(T);

struct Wrapper2<T> {
    x: T,
}

impl Wrapper2<i8> {
    fn method(&self) {}
}

fn main() {
    let wrapper = Wrapper(i32);
    wrapper.method();
    let wrapper2 = Wrapper2{x: i32};
    wrapper2.method();
}
```

```
Error[E0599]: no method named `method` found for struct `Wrapper<_>` in the current scope
....
error[E0599]: no method named `method` found for struct `Wrapper2<i32>` in the current scope
...
   = note: The method was found for Wrapper2<i8>.

```
I am not very happy with the ```no method named `test` found for struct `Vec<_, _>` in the current scope```. I think it might be better to show only one generic argument `Vec<_>` if there is a default one. But I haven't yet found a way to do that,
2021-05-27 03:02:03 +02:00
..
auxiliary
assign-to-method.rs
assign-to-method.stderr
method-ambig-one-trait-unknown-int-type.rs
method-ambig-one-trait-unknown-int-type.stderr Say "doesn't" instead of "wouldn't" in convert message 2020-09-29 19:27:58 -07:00
method-ambig-two-traits-cross-crate.rs
method-ambig-two-traits-cross-crate.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
method-ambig-two-traits-from-bounds.rs
method-ambig-two-traits-from-bounds.stderr
method-ambig-two-traits-from-impls.rs
method-ambig-two-traits-from-impls.stderr
method-ambig-two-traits-from-impls2.rs
method-ambig-two-traits-from-impls2.stderr
method-ambig-two-traits-with-default-method.rs
method-ambig-two-traits-with-default-method.stderr
method-argument-inference-associated-type.rs
method-call-err-msg.rs Avoid describing a method as 'not found' when bounds are unsatisfied 2021-01-26 23:59:50 -05:00
method-call-err-msg.stderr Avoid describing a method as 'not found' when bounds are unsatisfied 2021-01-26 23:59:50 -05:00
method-call-lifetime-args-fail.rs improve diagnosts for GATs 2021-05-11 14:09:46 +02:00
method-call-lifetime-args-fail.stderr improve diagnosts for GATs 2021-05-11 14:09:46 +02:00
method-call-lifetime-args-lint-fail.rs
method-call-lifetime-args-lint-fail.stderr
method-call-lifetime-args-lint.rs
method-call-lifetime-args-lint.stderr
method-call-lifetime-args-subst-index.rs
method-call-lifetime-args-unresolved.rs Fix tests and AstConv -> dyn AstConv 2021-03-31 10:16:37 -04:00
method-call-lifetime-args-unresolved.stderr Fix tests and AstConv -> dyn AstConv 2021-03-31 10:16:37 -04:00
method-call-lifetime-args.rs
method-call-lifetime-args.stderr
method-call-type-binding.rs
method-call-type-binding.stderr
method-deref-to-same-trait-object-with-separate-params.rs Make tidy happy 2020-10-27 14:45:34 -03:00
method-deref-to-same-trait-object-with-separate-params.stderr Make tidy happy 2020-10-27 14:45:34 -03:00
method-early-bound-lifetimes-on-self.rs
method-lookup-order.rs Test exploring the interactions between all of the different kinds of method collisions I could imagine. 2021-02-01 17:08:37 -05:00
method-macro-backtrace.rs
method-macro-backtrace.stderr
method-missing-call.rs
method-missing-call.stderr pretty: trim paths of unique symbols 2020-09-02 22:26:37 +03:00
method-mut-self-modifies-mut-slice-lvalue.rs
method-normalize-bounds-issue-20604.rs
method-not-found-generic-arg-elision.rs change from review and show full type if it can be deref 2021-05-22 12:38:48 +02:00
method-not-found-generic-arg-elision.stderr show list of candidates 2021-05-25 16:55:30 +02:00
method-on-ambiguous-numeric-type.rs
method-on-ambiguous-numeric-type.stderr
method-path-in-pattern.rs
method-path-in-pattern.stderr
method-probe-no-guessing-dyn-trait.rs
method-projection.rs
method-recursive-blanket-impl.rs
method-resolvable-path-in-pattern.rs
method-resolvable-path-in-pattern.stderr
method-self-arg-1.rs
method-self-arg-1.stderr
method-self-arg-2.rs
method-self-arg-2.stderr
method-self-arg-aux1.rs
method-self-arg-aux2.rs
method-self-arg-trait.rs
method-self-arg.rs
method-trait-object-with-hrtb.rs
method-two-trait-defer-resolution-1.rs
method-two-trait-defer-resolution-2.rs
method-two-traits-distinguished-via-where-clause.rs
method-where-clause.rs