]> git.lizzy.rs Git - rust.git/commitdiff
Add explanation message for E0203
authorNixon <nixon.emoony@gmail.com>
Fri, 29 Nov 2019 22:16:26 +0000 (22:16 +0000)
committerNixon <nixon.emoony@gmail.com>
Fri, 29 Nov 2019 22:42:38 +0000 (22:42 +0000)
src/librustc_error_codes/error_codes.rs
src/librustc_error_codes/error_codes/E0203.md [new file with mode: 0644]
src/test/ui/maybe-bounds-where.stderr

index 709ccce517a36a2ea70f9c1234e0de7aa05f6fa7..7f111b42403b574e0e049fbbd9ffc8877cb0bfa2 100644 (file)
 E0200: include_str!("./error_codes/E0200.md"),
 E0201: include_str!("./error_codes/E0201.md"),
 E0202: include_str!("./error_codes/E0202.md"),
+E0203: include_str!("./error_codes/E0203.md"),
 E0204: include_str!("./error_codes/E0204.md"),
 E0205: include_str!("./error_codes/E0205.md"),
 E0206: include_str!("./error_codes/E0206.md"),
 //  E0190, // deprecated: can only cast a &-pointer to an &-object
 //  E0194, // merged into E0403
 //  E0196, // cannot determine a type for this closure
-    E0203, // type parameter has more than one relaxed default bound,
-           // and only one is supported
     E0208,
 //  E0209, // builtin traits can only be implemented on structs or enums
     E0212, // cannot extract an associated type from a higher-ranked trait bound
diff --git a/src/librustc_error_codes/error_codes/E0203.md b/src/librustc_error_codes/error_codes/E0203.md
new file mode 100644 (file)
index 0000000..792ed3c
--- /dev/null
@@ -0,0 +1,12 @@
+Having multiple relaxed default bounds is unsuported.
+
+Erroneous code example:
+
+```compile_fail,E0203
+
+trait Foo {}
+
+struct S5<T>(*const T) where T: ?Foo + ?Sized;
+```
+
+Here the type `T` cannot have a relaxed bound for both `Foo` and `Sized`
index 15cbce46f0a9b4887ae7835324ad9de36b19b3fd..19f9cd28a9a01251dce1c394cedb8f0badd1c692 100644 (file)
@@ -42,3 +42,4 @@ LL | struct S5<T>(*const T) where T: ?Trait<'static> + ?Sized;
 
 error: aborting due to 6 previous errors
 
+For more information about this error, try `rustc --explain E0203`.