]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | Attempt was made to import an unimportable value. This can happen when trying |
2 | to import a method from a trait. | |
3 | ||
4 | Erroneous code example: | |
5 | ||
6 | ```compile_fail,E0253 | |
7 | mod foo { | |
8 | pub trait MyTrait { | |
9 | fn do_something(); | |
10 | } | |
11 | } | |
12 | ||
13 | use foo::MyTrait::do_something; | |
14 | // error: `do_something` is not directly importable | |
15 | ||
16 | fn main() {} | |
17 | ``` | |
18 | ||
19 | It's invalid to directly import methods belonging to a trait or concrete type. |