Implement use
associated items of traits
This commit is contained in:
parent
4e5fec2f1e
commit
5079acc060
21 changed files with 374 additions and 42 deletions
|
@ -1,10 +1,10 @@
|
|||
mod foo {
|
||||
pub trait MyTrait {
|
||||
fn do_something();
|
||||
type SomeType;
|
||||
}
|
||||
}
|
||||
|
||||
use foo::MyTrait::do_something;
|
||||
use foo::MyTrait::SomeType;
|
||||
//~^ ERROR E0253
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
error[E0253]: `do_something` is not directly importable
|
||||
error[E0253]: `SomeType` is not directly importable
|
||||
--> $DIR/E0253.rs:7:5
|
||||
|
|
||||
LL | use foo::MyTrait::do_something;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly
|
||||
LL | use foo::MyTrait::SomeType;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue