diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2021-10-14 21:44:43 +0200 |
|---|---|---|
| committer | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2022-02-18 20:40:08 +0100 |
| commit | 4bed7485da0706dfc30f019f94f07fcdf5122358 (patch) | |
| tree | 96f2c77c5845e754b2906ea1bae4b8b1dcb6ba99 /compiler/rustc_llvm/llvm-wrapper | |
| parent | b8c56fa8c30821129b0960180f528d4a1a4f9316 (diff) | |
| download | rust-4bed7485da0706dfc30f019f94f07fcdf5122358.tar.gz rust-4bed7485da0706dfc30f019f94f07fcdf5122358.zip | |
Suggest `impl Trait` return type
Address #85991 Suggest the `impl Trait` return type syntax if the user tried to return a generic parameter and we get a type mismatch The suggestion is not emitted if the param appears in the function parameters, and only get the bounds that actually involve `T: ` directly It also checks whether the generic param is contained in any where bound (where it isn't the self type), and if one is found (like `Option<T>: Send`), it is not suggested. This also adds `TyS::contains`, which recursively vistits the type and looks if the other type is contained anywhere
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper')
0 files changed, 0 insertions, 0 deletions
