]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0253.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0253.md
CommitLineData
60c5eb7d
XL
1Attempt was made to import an unimportable value. This can happen when trying
2to import a method from a trait.
3
4Erroneous code example:
5
6```compile_fail,E0253
7mod foo {
8 pub trait MyTrait {
9 fn do_something();
10 }
11}
12
13use foo::MyTrait::do_something;
14// error: `do_something` is not directly importable
15
16fn main() {}
17```
18
19It's invalid to directly import methods belonging to a trait or concrete type.