diff --git a/src/librustc_error_codes/error_codes/E0109.md b/src/librustc_error_codes/error_codes/E0109.md index 5bc229ade52f4..2eab9725a6f59 100644 --- a/src/librustc_error_codes/error_codes/E0109.md +++ b/src/librustc_error_codes/error_codes/E0109.md @@ -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 diff --git a/src/librustc_error_codes/error_codes/E0116.md b/src/librustc_error_codes/error_codes/E0116.md index 27759a423433f..ca849c2a128f4 100644 --- a/src/librustc_error_codes/error_codes/E0116.md +++ b/src/librustc_error_codes/error_codes/E0116.md @@ -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 { } // 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 diff --git a/src/librustc_error_codes/error_codes/E0117.md b/src/librustc_error_codes/error_codes/E0117.md index bd36230566262..7fa211d4a27d4 100644 --- a/src/librustc_error_codes/error_codes/E0117.md +++ b/src/librustc_error_codes/error_codes/E0117.md @@ -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 @@ -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`: diff --git a/src/librustc_error_codes/error_codes/E0118.md b/src/librustc_error_codes/error_codes/E0118.md index baf35ffbb0b53..5cb5f506e0a4b 100644 --- a/src/librustc_error_codes/error_codes/E0118.md +++ b/src/librustc_error_codes/error_codes/E0118.md @@ -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 diff --git a/src/librustc_error_codes/error_codes/E0119.md b/src/librustc_error_codes/error_codes/E0119.md index 0af3bd4a0de79..e596349e5e2d1 100644 --- a/src/librustc_error_codes/error_codes/E0119.md +++ b/src/librustc_error_codes/error_codes/E0119.md @@ -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 {