summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2019-12-06 15:37:08 +0900
committerGitHub <noreply@github.com>2019-12-06 15:37:08 +0900
commit662a225f1d251cd9f07e9c06a24094659a8c7242 (patch)
treec7c00b85d109dc1855854bd1bb928b1476a2d57c
parentRollup merge of #66979 - reese:E0631-long-error, r=GuillaumeGomez (diff)
parentsome error codes long explanation (diff)
downloadrust-662a225f1d251cd9f07e9c06a24094659a8c7242.tar.gz
rust-662a225f1d251cd9f07e9c06a24094659a8c7242.tar.bz2
rust-662a225f1d251cd9f07e9c06a24094659a8c7242.tar.xz
Rollup merge of #67017 - GuillaumeGomez:long-err-explanations-2, r=Dylan-DPC
cleanup long error explanations r? @Dylan-DPC
-rw-r--r--src/librustc_error_codes/error_codes/E0109.md1
-rw-r--r--src/librustc_error_codes/error_codes/E0116.md10
-rw-r--r--src/librustc_error_codes/error_codes/E0117.md14
-rw-r--r--src/librustc_error_codes/error_codes/E0118.md6
-rw-r--r--src/librustc_error_codes/error_codes/E0119.md3
5 files changed, 22 insertions, 12 deletions
diff --git a/src/librustc_error_codes/error_codes/E0109.md b/src/librustc_error_codes/error_codes/E0109.md
index 5bc229a..2eab972 100644
--- a/src/librustc_error_codes/error_codes/E0109.md
+++ b/src/librustc_error_codes/error_codes/E0109.md
@@ -1,4 +1,5 @@
1You tried to provide a generic argument to a type which doesn't need it. 1You tried to provide a generic argument to a type which doesn't need it.
2
2Erroneous code example: 3Erroneous code example:
3 4
4```compile_fail,E0109 5```compile_fail,E0109
diff --git a/src/librustc_error_codes/error_codes/E0116.md b/src/librustc_error_codes/error_codes/E0116.md
index 27759a4..ca849c2 100644
--- a/src/librustc_error_codes/error_codes/E0116.md
+++ b/src/librustc_error_codes/error_codes/E0116.md
@@ -1,11 +1,15 @@
1You can only define an inherent implementation for a type in the same crate 1An inherent implementation was defined for a type outside the current crate.
2where the type was defined. For example, an `impl` block as below is not allowed 2
3since `Vec` is defined in the standard library: 3Erroneous code example:
4 4
5```compile_fail,E0116 5```compile_fail,E0116
6impl Vec<u8> { } // error 6impl Vec<u8> { } // error
7``` 7```
8 8
9You can only define an inherent implementation for a type in the same crate
10where the type was defined. For example, an `impl` block as above is not allowed
11since `Vec` is defined in the standard library.
12
9To fix this problem, you can do either of these things: 13To fix this problem, you can do either of these things:
10 14
11 - define a trait that has the desired associated functions/types/constants and 15 - define a trait that has the desired associated functions/types/constants and
diff --git a/src/librustc_error_codes/error_codes/E0117.md b/src/librustc_error_codes/error_codes/E0117.md
index bd36230..7fa211d 100644
--- a/src/librustc_error_codes/error_codes/E0117.md
+++ b/src/librustc_error_codes/error_codes/E0117.md
@@ -1,3 +1,11 @@
1The `Drop` trait was implemented on a non-struct type.
2
3Erroneous code example:
4
5```compile_fail,E0117
6impl Drop for u32 {}
7```
8
1This error indicates a violation of one of Rust's orphan rules for trait 9This error indicates a violation of one of Rust's orphan rules for trait
2implementations. The rule prohibits any implementation of a foreign trait (a 10implementations. The rule prohibits any implementation of a foreign trait (a
3trait defined in another crate) where 11trait defined in another crate) where
@@ -6,12 +14,6 @@ trait defined in another crate) where
6 - all of the parameters being passed to the trait (if there are any) are also 14 - all of the parameters being passed to the trait (if there are any) are also
7 foreign. 15 foreign.
8 16
9Here's one example of this error:
10
11```compile_fail,E0117
12impl Drop for u32 {}
13```
14
15To avoid this kind of error, ensure that at least one local type is referenced 17To avoid this kind of error, ensure that at least one local type is referenced
16by the `impl`: 18by the `impl`:
17 19
diff --git a/src/librustc_error_codes/error_codes/E0118.md b/src/librustc_error_codes/error_codes/E0118.md
index baf35ff..5cb5f50 100644
--- a/src/librustc_error_codes/error_codes/E0118.md
+++ b/src/librustc_error_codes/error_codes/E0118.md
@@ -1,5 +1,7 @@
1You're trying to write an inherent implementation for something which isn't a 1An inherent implementation was defined for something which isn't a struct nor
2struct nor an enum. Erroneous code example: 2an enum.
3
4Erroneous code example:
3 5
4```compile_fail,E0118 6```compile_fail,E0118
5impl (u8, u8) { // error: no base type found for inherent implementation 7impl (u8, u8) { // error: no base type found for inherent implementation
diff --git a/src/librustc_error_codes/error_codes/E0119.md b/src/librustc_error_codes/error_codes/E0119.md
index 0af3bd4..e596349 100644
--- a/src/librustc_error_codes/error_codes/E0119.md
+++ b/src/librustc_error_codes/error_codes/E0119.md
@@ -1,5 +1,6 @@
1There are conflicting trait implementations for the same type. 1There are conflicting trait implementations for the same type.
2Example of erroneous code: 2
3Erroneous code example:
3 4
4```compile_fail,E0119 5```compile_fail,E0119
5trait MyTrait { 6trait MyTrait {