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 :
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
You can’t perform that action at this time.
0 commit comments