about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorJulien Philippon <julien.philippon@epitech.eu>2020-03-30 02:50:53 +0200
committerJulien Philippon <julien.philippon@epitech.eu>2020-03-30 02:51:25 +0200
commit8f7eb6229cb301c2ee7900a36a13f2906518378f (patch)
tree2ca61bb3f1f33ad379710afa0e60cf3132f01a0f /src/librustc_error_codes/error_codes
parent699f83f525c985000c1f70bf85117ba383adde87 (diff)
downloadrust-8f7eb6229cb301c2ee7900a36a13f2906518378f.tar.gz
rust-8f7eb6229cb301c2ee7900a36a13f2906518378f.zip
Add long error code for error E0226
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0226.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/librustc_error_codes/error_codes/E0226.md b/src/librustc_error_codes/error_codes/E0226.md
new file mode 100644
index 00000000000..e485771fc1b
--- /dev/null
+++ b/src/librustc_error_codes/error_codes/E0226.md
@@ -0,0 +1,20 @@
+Only a single explicit lifetime bound is permitted on trait objects.
+
+Example of erroneous code:
+
+```compile_fail
+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.
+
+To fix this error, consider removing one of the lifetime bounds:
+
+```
+trait Foo {}
+
+type T<'a> = dyn Foo + 'a;
+```