resolve: Adjust hygienic_lexical_parent to account for enum and trait modules
This commit is contained in:
parent
0d084670d7
commit
56f635304b
2 changed files with 15 additions and 1 deletions
14
src/test/ui/resolve/block-with-trait-parent.rs
Normal file
14
src/test/ui/resolve/block-with-trait-parent.rs
Normal file
|
|
@ -0,0 +1,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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue