From f8fb24f18fcdea9b5ae7dcdb90fa68d618eb1e0b Mon Sep 17 00:00:00 2001 From: Nixon Date: Fri, 29 Nov 2019 22:16:26 +0000 Subject: Add explanation message for E0203 --- src/librustc_error_codes/error_codes/E0203.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/librustc_error_codes/error_codes/E0203.md (limited to 'src/librustc_error_codes/error_codes') diff --git a/src/librustc_error_codes/error_codes/E0203.md b/src/librustc_error_codes/error_codes/E0203.md new file mode 100644 index 00000000000..792ed3cb8bb --- /dev/null +++ b/src/librustc_error_codes/error_codes/E0203.md @@ -0,0 +1,12 @@ +Having multiple relaxed default bounds is unsuported. + +Erroneous code example: + +```compile_fail,E0203 + +trait Foo {} + +struct S5(*const T) where T: ?Foo + ?Sized; +``` + +Here the type `T` cannot have a relaxed bound for both `Foo` and `Sized` -- cgit 1.4.1-3-g733a5 From a52eb05ec6407054a0549b336fa746b62e1d22c0 Mon Sep 17 00:00:00 2001 From: Nixon Date: Sat, 30 Nov 2019 10:56:07 +0000 Subject: Address review comments --- src/librustc_error_codes/error_codes/E0203.md | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/librustc_error_codes/error_codes') diff --git a/src/librustc_error_codes/error_codes/E0203.md b/src/librustc_error_codes/error_codes/E0203.md index 792ed3cb8bb..1edb519275f 100644 --- a/src/librustc_error_codes/error_codes/E0203.md +++ b/src/librustc_error_codes/error_codes/E0203.md @@ -1,12 +1,18 @@ -Having multiple relaxed default bounds is unsuported. +Having multiple relaxed default bounds is unsupported. Erroneous code example: ```compile_fail,E0203 +struct Bad{ + inner: T +} +``` -trait Foo {} +Here the type `T` cannot have a relaxed bound for multiple default traits +(`Sized` and `Send`). This can be fixed by only using one relaxed bound. -struct S5(*const T) where T: ?Foo + ?Sized; ``` - -Here the type `T` cannot have a relaxed bound for both `Foo` and `Sized` +struct Good{ + inner: T +} +``` -- cgit 1.4.1-3-g733a5