Skip to content

Commit

Permalink
Auto merge of #17469 - roife:fix-issue-17425, r=Veykril
Browse files Browse the repository at this point in the history
fix: use ItemInNs::Macros to convert ModuleItem to ItemInNs

fix #17425.

When converting `PathResolution` to `ItemInNs`, we should convert `ModuleDef::Macro` to `ItemInNs::Macros` to ensure that it can be found in `DefMap`.
  • Loading branch information
bors committed Jun 21, 2024
2 parents 398e3a3 + 51b138c commit 9b33872
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/crates/hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2784,6 +2784,7 @@ impl From<ModuleDef> for ItemInNs {
ModuleDef::Static(_) | ModuleDef::Const(_) | ModuleDef::Function(_) => {
ItemInNs::Values(module_def)
}
ModuleDef::Macro(it) => ItemInNs::Macros(it),
_ => ItemInNs::Types(module_def),
}
}
Expand Down

0 comments on commit 9b33872

Please sign in to comment.