about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-05-27 03:02:03 +0200
committerGitHub <noreply@github.com>2021-05-27 03:02:03 +0200
commitf2810d5fa0fb5930a02e2bb4827b037292a83cea (patch)
tree808ec000a1d4eee798f114b5401c8a3cd0eca5c5 /compiler/rustc_codegen_llvm/src/llvm_util.rs
parent9111b8ae9793f18179a1336417618fc07a9cac85 (diff)
parent5d8e6ea7b9e668578917940d2ab1ba1a51b291b5 (diff)
downloadrust-f2810d5fa0fb5930a02e2bb4827b037292a83cea.tar.gz
rust-f2810d5fa0fb5930a02e2bb4827b037292a83cea.zip
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,
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions