about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-31 15:59:41 +0200
committerGitHub <noreply@github.com>2020-03-31 15:59:41 +0200
commitcbe3266c651a252bfb53156d4ac0df1f8fb0cf9a (patch)
tree81225cdb5168c0be465714eda2b7f684f2374e3e /src/librustc_error_codes/error_codes
parent9ee373fd945511669775b8fd2c00990373ded8c7 (diff)
parent32103b127f088906ea6a99a12c565c4013762fa3 (diff)
downloadrust-cbe3266c651a252bfb53156d4ac0df1f8fb0cf9a.tar.gz
rust-cbe3266c651a252bfb53156d4ac0df1f8fb0cf9a.zip
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
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0226.md21
1 files changed, 21 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..4e65132ff0d
--- /dev/null
+++ b/src/librustc_error_codes/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;
+```