Skip to content

Commit c2ce7dd

Browse files
Clean up E0116 error code long explanation
1 parent 5f1d6c4 commit c2ce7dd

File tree

1 file changed

+7
-3
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+7
-3
lines changed

src/librustc_error_codes/error_codes/E0116.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
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
66
impl 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+
913
To fix this problem, you can do either of these things:
1014

1115
- define a trait that has the desired associated functions/types/constants and

0 commit comments

Comments
 (0)