diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-20 22:07:38 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-20 22:07:38 +0000 |
commit | 70f7a10013775c1dce10b0d7a7724a48bb76b065 (patch) | |
tree | 2f3c97e5f45a8579cc860dc9a57123dbb5302b8b /crates/hir_def/src/attr.rs | |
parent | 7d5ed18c42c4ee80e776d04254d69750b70e14ba (diff) | |
parent | 82146737acc74b2483f39f1dd0ae4dfffcfda824 (diff) |
Merge #7366
7366: Treat BlockExpr as a potential module origin r=jonas-schievink a=jonas-schievink
A block containing inner items acts like the root module of a crate, so it needs to be representable as a `ModuleSource` and `ModuleOrigin`.
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/attr.rs')
-rw-r--r-- | crates/hir_def/src/attr.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index 1b09ff816..c72649c41 100644 --- a/crates/hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs | |||
@@ -207,6 +207,7 @@ impl Attrs { | |||
207 | mod_data.definition_source(db).as_ref().map(|src| match src { | 207 | mod_data.definition_source(db).as_ref().map(|src| match src { |
208 | ModuleSource::SourceFile(file) => file as &dyn AttrsOwner, | 208 | ModuleSource::SourceFile(file) => file as &dyn AttrsOwner, |
209 | ModuleSource::Module(module) => module as &dyn AttrsOwner, | 209 | ModuleSource::Module(module) => module as &dyn AttrsOwner, |
210 | ModuleSource::BlockExpr(block) => block as &dyn AttrsOwner, | ||
210 | }), | 211 | }), |
211 | ), | 212 | ), |
212 | } | 213 | } |