summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0226.md
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0226.md')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0226.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0226.md b/compiler/rustc_error_codes/src/error_codes/E0226.md
new file mode 100644
index 000000000..4e65132ff
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0226.md
@@ -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;
+```