-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #70548 - Ersikan:master, r=GuillaumeGomez
Add long error code for error E0226 Added a long description message for error E0226, which previously did not exist. As requested in issue #61137 r? @GuillaumeGomez
- Loading branch information
Showing
3 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
More than one explicit lifetime bound was used on a trait object. | ||
|
||
Example of erroneous code: | ||
|
||
```compile_fail,E0226 | ||
trait Foo {} | ||
type T<'a, 'b> = dyn Foo + 'a + 'b; // error: Trait object `arg` has two | ||
// lifetime bound, 'a and 'b. | ||
``` | ||
|
||
Here `T` is a trait object with two explicit lifetime bounds, 'a and 'b. | ||
|
||
Only a single explicit lifetime bound is permitted on trait objects. | ||
To fix this error, consider removing one of the lifetime bounds: | ||
|
||
``` | ||
trait Foo {} | ||
type T<'a> = dyn Foo + 'a; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters