File tree 5 files changed +22
-12
lines changed
src/librustc_error_codes/error_codes
5 files changed +22
-12
lines changed Original file line number Diff line number Diff line change 1
1
You tried to provide a generic argument to a type which doesn't need it.
2
+
2
3
Erroneous code example:
3
4
4
5
``` compile_fail,E0109
Original file line number Diff line number Diff line change 1
- You can only define an inherent implementation for a type in the same crate
2
- where the type was defined. For example, an ` impl ` block as below is not allowed
3
- since ` Vec ` is defined in the standard library :
1
+ An inherent implementation was defined for a type outside the current crate.
2
+
3
+ Erroneous code example :
4
4
5
5
``` compile_fail,E0116
6
6
impl Vec<u8> { } // error
7
7
```
8
8
9
+ You can only define an inherent implementation for a type in the same crate
10
+ where the type was defined. For example, an ` impl ` block as above is not allowed
11
+ since ` Vec ` is defined in the standard library.
12
+
9
13
To fix this problem, you can do either of these things:
10
14
11
15
- define a trait that has the desired associated functions/types/constants and
Original file line number Diff line number Diff line change
1
+ The ` Drop ` trait was implemented on a non-struct type.
2
+
3
+ Erroneous code example:
4
+
5
+ ``` compile_fail,E0117
6
+ impl Drop for u32 {}
7
+ ```
8
+
1
9
This error indicates a violation of one of Rust's orphan rules for trait
2
10
implementations. The rule prohibits any implementation of a foreign trait (a
3
11
trait defined in another crate) where
@@ -6,12 +14,6 @@ trait defined in another crate) where
6
14
- all of the parameters being passed to the trait (if there are any) are also
7
15
foreign.
8
16
9
- Here's one example of this error:
10
-
11
- ``` compile_fail,E0117
12
- impl Drop for u32 {}
13
- ```
14
-
15
17
To avoid this kind of error, ensure that at least one local type is referenced
16
18
by the ` impl ` :
17
19
Original file line number Diff line number Diff line change 1
- You're trying to write an inherent implementation for something which isn't a
2
- struct nor an enum. Erroneous code example:
1
+ An inherent implementation was defined for something which isn't a struct nor
2
+ an enum.
3
+
4
+ Erroneous code example:
3
5
4
6
``` compile_fail,E0118
5
7
impl (u8, u8) { // error: no base type found for inherent implementation
Original file line number Diff line number Diff line change 1
1
There are conflicting trait implementations for the same type.
2
- Example of erroneous code:
2
+
3
+ Erroneous code example:
3
4
4
5
``` compile_fail,E0119
5
6
trait MyTrait {
You can’t perform that action at this time.
0 commit comments