File tree Expand file tree Collapse file tree 5 files changed +22
-12
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 5 files changed +22
-12
lines changed Original file line number Diff line number Diff line change 11You tried to provide a generic argument to a type which doesn't need it.
2+
23Erroneous code example:
34
45``` 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 :
44
55``` compile_fail,E0116
66impl Vec<u8> { } // error
77```
88
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+
913To fix this problem, you can do either of these things:
1014
1115 - 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+
19This error indicates a violation of one of Rust's orphan rules for trait
210implementations. The rule prohibits any implementation of a foreign trait (a
311trait defined in another crate) where
@@ -6,12 +14,6 @@ trait defined in another crate) where
614 - all of the parameters being passed to the trait (if there are any) are also
715 foreign.
816
9- Here's one example of this error:
10-
11- ``` compile_fail,E0117
12- impl Drop for u32 {}
13- ```
14-
1517To avoid this kind of error, ensure that at least one local type is referenced
1618by the ` impl ` :
1719
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:
35
46``` compile_fail,E0118
57impl (u8, u8) { // error: no base type found for inherent implementation
Original file line number Diff line number Diff line change 11There are conflicting trait implementations for the same type.
2- Example of erroneous code:
2+
3+ Erroneous code example:
34
45``` compile_fail,E0119
56trait MyTrait {
You can’t perform that action at this time.
0 commit comments