1
Fork 0

Clean up E0116 error code long explanation

This commit is contained in:
Guillaume Gomez 2019-12-04 13:27:17 +01:00
parent 5f1d6c4403
commit c2ce7dd756

View file

@ -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<u8> { } // 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