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

cleanup long error explanations #67017

Merged
merged 4 commits into from
Dec 6, 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
1 change: 1 addition & 0 deletions src/librustc_error_codes/error_codes/E0109.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
You tried to provide a generic argument to a type which doesn't need it.

Erroneous code example:

```compile_fail,E0109
Expand Down
10 changes: 7 additions & 3 deletions src/librustc_error_codes/error_codes/E0116.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
You can only define an inherent implementation for a type in the same crate
where the type was defined. For example, an `impl` block as below is not allowed
since `Vec` is defined in the standard library:
An inherent implementation was defined for a type outside the current crate.

Erroneous code example:

```compile_fail,E0116
impl Vec<u8> { } // error
```

You can only define an inherent implementation for a type in the same crate
where the type was defined. For example, an `impl` block as above is not allowed
since `Vec` is defined in the standard library.

To fix this problem, you can do either of these things:

- define a trait that has the desired associated functions/types/constants and
Expand Down
14 changes: 8 additions & 6 deletions src/librustc_error_codes/error_codes/E0117.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
The `Drop` trait was implemented on a non-struct type.

Erroneous code example:

```compile_fail,E0117
impl Drop for u32 {}
```

This error indicates a violation of one of Rust's orphan rules for trait
implementations. The rule prohibits any implementation of a foreign trait (a
trait defined in another crate) where
Expand All @@ -6,12 +14,6 @@ trait defined in another crate) where
- all of the parameters being passed to the trait (if there are any) are also
foreign.

Here's one example of this error:

```compile_fail,E0117
impl Drop for u32 {}
```

To avoid this kind of error, ensure that at least one local type is referenced
by the `impl`:

Expand Down
6 changes: 4 additions & 2 deletions src/librustc_error_codes/error_codes/E0118.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
You're trying to write an inherent implementation for something which isn't a
struct nor an enum. Erroneous code example:
An inherent implementation was defined for something which isn't a struct nor
an enum.

Erroneous code example:

```compile_fail,E0118
impl (u8, u8) { // error: no base type found for inherent implementation
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_error_codes/error_codes/E0119.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
There are conflicting trait implementations for the same type.
Example of erroneous code:

Erroneous code example:

```compile_fail,E0119
trait MyTrait {
Expand Down