1 2 3 4 5 6 7 8 9 10 11 12 13 14
// 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() {}