Skip to content

Commit

Permalink
Rollup merge of rust-lang#115054 - waywardmonkeys:fix-syntax-in-e0191…
Browse files Browse the repository at this point in the history
…, r=compiler-errors

Fix syntax in E0191 explanation.

This trait needs `dyn` in modern Rust.

Fixes rust-lang#115042.
  • Loading branch information
matthiaskrgr authored Aug 21, 2023
2 parents 4eb30bc + fd2982c commit 8a10d2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_error_codes/src/error_codes/E0191.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,5 +20,5 @@ trait Trait {
type Bar;
}
type Foo = Trait<Bar=i32>; // ok!
type Foo = dyn Trait<Bar=i32>; // ok!
```

0 comments on commit 8a10d2a

Please sign in to comment.