File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +7
-3
lines changed 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
You can’t perform that action at this time.
0 commit comments