Skip to content

Commit d4f5956

Browse files
authored
Rollup merge of #66880 - aDotInTheVoid:add-E0203-long, r=GuillaumeGomez
Add long error code explanation message for E0203 Addressed some of #61137 r? @GuillaumeGomez
2 parents d91e63b + a52eb05 commit d4f5956

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/librustc_error_codes/error_codes.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ E0199: include_str!("./error_codes/E0199.md"),
107107
E0200: include_str!("./error_codes/E0200.md"),
108108
E0201: include_str!("./error_codes/E0201.md"),
109109
E0202: include_str!("./error_codes/E0202.md"),
110+
E0203: include_str!("./error_codes/E0203.md"),
110111
E0204: include_str!("./error_codes/E0204.md"),
111112
E0205: include_str!("./error_codes/E0205.md"),
112113
E0206: include_str!("./error_codes/E0206.md"),
@@ -446,8 +447,6 @@ E0745: include_str!("./error_codes/E0745.md"),
446447
// E0190, // deprecated: can only cast a &-pointer to an &-object
447448
// E0194, // merged into E0403
448449
// E0196, // cannot determine a type for this closure
449-
E0203, // type parameter has more than one relaxed default bound,
450-
// and only one is supported
451450
E0208,
452451
// E0209, // builtin traits can only be implemented on structs or enums
453452
E0212, // cannot extract an associated type from a higher-ranked trait bound
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Having multiple relaxed default bounds is unsupported.
2+
3+
Erroneous code example:
4+
5+
```compile_fail,E0203
6+
struct Bad<T: ?Sized + ?Send>{
7+
inner: T
8+
}
9+
```
10+
11+
Here the type `T` cannot have a relaxed bound for multiple default traits
12+
(`Sized` and `Send`). This can be fixed by only using one relaxed bound.
13+
14+
```
15+
struct Good<T: ?Sized>{
16+
inner: T
17+
}
18+
```

src/test/ui/maybe-bounds-where.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ LL | struct S5<T>(*const T) where T: ?Trait<'static> + ?Sized;
4242

4343
error: aborting due to 6 previous errors
4444

45+
For more information about this error, try `rustc --explain E0203`.

0 commit comments

Comments
 (0)