rust/tests/ui/resolve/block-with-trait-parent.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
285 B
Rust
Raw Normal View History

// check-pass
trait Trait {
fn method(&self) {
// Items inside a block turn it into a module internally.
struct S;
impl Trait for S {}
// OK, `Trait` is in scope here from method resolution point of view.
S.method();
}
}
fn main() {}