]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0253.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0253.md
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.