Closed
Description
#![feature(trait_alias)]
mod some_module {
pub trait Foo {
fn foo(&self);
}
pub struct Qux;
impl Foo for Qux {
fn foo(&self) {}
}
pub trait Bar = Foo;
}
use some_module::{Bar, Qux};
fn use_baz(object: Qux) {
// Should this work because Bar is in scope?
object.foo();
}
(playground) currently produces an error:
error[E0599]: no method named `foo` found for type `some_module::Qux` in the current scope
--> src/lib.rs:21:12
|
8 | pub struct Qux;
| --------------- method `foo` not found for this
...
21 | object.foo();
| ^^^
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
17 | use some_module::Foo;
|
cc #41517