about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKonrad Borowski <konrad@borowski.pw>2019-10-09 12:33:24 +0200
committerGitHub <noreply@github.com>2019-10-09 12:33:24 +0200
commit3f9d834fb3c32b67a5f368c8265a9ca6d83de7c3 (patch)
treeb56eab40b0204b059b08a11e6f909144303b4986
parent7dc4bf4f935a929d1a9b8beb5d72ae1daa117f34 (diff)
downloadrust-3f9d834fb3c32b67a5f368c8265a9ca6d83de7c3.tar.gz
rust-3f9d834fb3c32b67a5f368c8265a9ca6d83de7c3.zip
Add failing example for Self in supertrait listing in E0038 documentation
-rw-r--r--src/librustc/error_codes.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc/error_codes.rs b/src/librustc/error_codes.rs
index caa7282c701..f3f1c9c6c7d 100644
--- a/src/librustc/error_codes.rs
+++ b/src/librustc/error_codes.rs
@@ -259,7 +259,7 @@ trait Foo {
 This is similar to the second sub-error, but subtler. It happens in situations
 like the following:
 
-```
+```compile_fail,E0038
 trait Super<A: ?Sized> {}
 
 trait Trait: Super<Self> {
@@ -270,6 +270,10 @@ struct Foo;
 impl Super<Foo> for Foo{}
 
 impl Trait for Foo {}
+
+fn main() {
+    let x: Box<dyn Trait>;
+}
 ```
 
 Here, the supertrait might have methods as follows: