about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/async_fn_in_trait.rs
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-10-04 19:19:27 -0700
committerGitHub <noreply@github.com>2024-10-04 19:19:27 -0700
commit08689af7b4eb419645ee08834c86f07b53f8ac26 (patch)
treed980773c2ce720886e94df4382c9fa7a0e07f531 /compiler/rustc_lint/src/async_fn_in_trait.rs
parent3078b23bbf66966860c8a16fda8eb500f52fde73 (diff)
parente057c43382a1eacc5941bc4e78b36dc122b32419 (diff)
downloadrust-08689af7b4eb419645ee08834c86f07b53f8ac26.tar.gz
rust-08689af7b4eb419645ee08834c86f07b53f8ac26.zip
Rollup merge of #131273 - estebank:issue-131051, r=compiler-errors
Account for `impl Trait {` when `impl Trait for Type {` was intended

On editions where bare traits are never allowed, detect if the user has written `impl Trait` with no type, silence any dyn-compatibility errors, and provide a structured suggestion for the potentially missing type:

```
error[E0782]: trait objects must include the `dyn` keyword
  --> $DIR/missing-for-type-in-impl.rs:8:6
   |
LL | impl Foo<i64> {
   |      ^^^^^^^^
   |
help: add `dyn` keyword before this trait
   |
LL | impl dyn Foo<i64> {
   |      +++
help: you might have intended to implement this trait for a given type
   |
LL | impl Foo<i64> for /* Type */ {
   |               ++++++++++++++
```

CC #131051.
Diffstat (limited to 'compiler/rustc_lint/src/async_fn_in_trait.rs')
0 files changed, 0 insertions, 0 deletions