]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0226.md
docs: revert removal of `E0729`
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0226.md
1 More than one explicit lifetime bound was used on a trait object.
2
3 Example of erroneous code:
4
5 ```compile_fail,E0226
6 trait Foo {}
7
8 type T<'a, 'b> = dyn Foo + 'a + 'b; // error: Trait object `arg` has two
9                                     //        lifetime bound, 'a and 'b.
10 ```
11
12 Here `T` is a trait object with two explicit lifetime bounds, 'a and 'b.
13
14 Only a single explicit lifetime bound is permitted on trait objects.
15 To fix this error, consider removing one of the lifetime bounds:
16
17 ```
18 trait Foo {}
19
20 type T<'a> = dyn Foo + 'a;
21 ```