Fix syntax in E0191 explanation.

This trait needs `dyn` in modern Rust.

Fixes #115042.
This commit is contained in:
Bruce Mitchener 2023-08-21 18:45:02 +07:00
parent c40cfcf049
commit fd2982c0a7

View file

@ -7,8 +7,8 @@ trait Trait {
type Bar;
}
type Foo = Trait; // error: the value of the associated type `Bar` (from
// the trait `Trait`) must be specified
type Foo = dyn Trait; // error: the value of the associated type `Bar` (from
// the trait `Trait`) must be specified
```
Trait objects need to have all associated types specified. Please verify that
@ -20,5 +20,5 @@ trait Trait {
type Bar;
}
type Foo = Trait<Bar=i32>; // ok!
type Foo = dyn Trait<Bar=i32>; // ok!
```