Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add long error code explanation message for E0203 #66880

Merged
merged 2 commits into from
Dec 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/librustc_error_codes/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ E0199: include_str!("./error_codes/E0199.md"),
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"),
Expand Down Expand Up @@ -446,8 +447,6 @@ E0745: include_str!("./error_codes/E0745.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
Expand Down
18 changes: 18 additions & 0 deletions src/librustc_error_codes/error_codes/E0203.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Having multiple relaxed default bounds is unsupported.

Erroneous code example:

```compile_fail,E0203
struct Bad<T: ?Sized + ?Send>{
inner: T
}
```

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 Good<T: ?Sized>{
inner: T
}
```
1 change: 1 addition & 0 deletions src/test/ui/maybe-bounds-where.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`.