about summary refs log tree commit diff
path: root/src/librustdoc/scrape_examples.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-10-04 22:59:03 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-10-04 22:59:03 +0000
commite057c43382a1eacc5941bc4e78b36dc122b32419 (patch)
treeabda526cbeee6688402fd015df83ebcb3427ecea /src/librustdoc/scrape_examples.rs
parent14f303bc1430a78ddaa91b3e104bbe4c0413184e (diff)
downloadrust-e057c43382a1eacc5941bc4e78b36dc122b32419.tar.gz
rust-e057c43382a1eacc5941bc4e78b36dc122b32419.zip
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 */ {
   |               ++++++++++++++
```
Diffstat (limited to 'src/librustdoc/scrape_examples.rs')
0 files changed, 0 insertions, 0 deletions