forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#64177 - petrochenkov:curmod, r=matthewjasper
resolve: Do not afraid to set current module to enums and traits After rust-lang@cfbb60b it's ok. This is likely required for rust-lang#63468 to work correctly, because that PR starts resolving attributes on enum variants. r? @matthewjasper @c410-f3r
- Loading branch information
Showing
3 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |