Skip to content

Commit 7ec351e

Browse files
committed
Back out "Fix IDE resolution of item macros"
This backs out commit 3e0ab7219a5464999652beca22698cd46e1e48e8.
1 parent 711546a commit 7ec351e

File tree

3 files changed

+0
-14
lines changed

3 files changed

+0
-14
lines changed

src/tools/rust-analyzer/crates/hir-def/src/db.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ fn macro_def(db: &dyn DefDatabase, id: MacroId) -> MacroDefId {
422422
let makro = &item_tree[loc.id.value];
423423
MacroDefId {
424424
krate: loc.container.krate,
425-
block: loc.container.block.map(|block| salsa::plumbing::AsId::as_id(&block)),
426425
kind: kind(loc.expander, loc.id.file_id(), makro.ast_id.upcast()),
427426
local_inner: false,
428427
allow_internal_unsafe: loc.allow_internal_unsafe,
@@ -436,7 +435,6 @@ fn macro_def(db: &dyn DefDatabase, id: MacroId) -> MacroDefId {
436435
let makro = &item_tree[loc.id.value];
437436
MacroDefId {
438437
krate: loc.container.krate,
439-
block: loc.container.block.map(|block| salsa::plumbing::AsId::as_id(&block)),
440438
kind: kind(loc.expander, loc.id.file_id(), makro.ast_id.upcast()),
441439
local_inner: loc.flags.contains(MacroRulesLocFlags::LOCAL_INNER),
442440
allow_internal_unsafe: loc
@@ -452,7 +450,6 @@ fn macro_def(db: &dyn DefDatabase, id: MacroId) -> MacroDefId {
452450
let makro = &item_tree[loc.id.value];
453451
MacroDefId {
454452
krate: loc.container.krate,
455-
block: None,
456453
kind: MacroDefKind::ProcMacro(
457454
InFile::new(loc.id.file_id(), makro.ast_id),
458455
loc.expander,

src/tools/rust-analyzer/crates/hir-def/src/resolver.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -696,15 +696,6 @@ impl<'db> Resolver<'db> {
696696
&def_map[local_id].scope
697697
}
698698

699-
pub fn item_scopes(&self) -> impl Iterator<Item = &ItemScope> {
700-
self.scopes()
701-
.filter_map(move |scope| match scope {
702-
Scope::BlockScope(m) => Some(&m.def_map[m.module_id].scope),
703-
_ => None,
704-
})
705-
.chain(std::iter::once(&self.module_scope.def_map[self.module_scope.module_id].scope))
706-
}
707-
708699
pub fn krate(&self) -> Crate {
709700
self.module_scope.def_map.krate()
710701
}

src/tools/rust-analyzer/crates/hir-expand/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,6 @@ pub struct MacroCallLoc {
258258
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
259259
pub struct MacroDefId {
260260
pub krate: Crate,
261-
// FIXME: In `hir-expand` we can't refer to `BlockId`.
262-
pub block: Option<salsa::Id>,
263261
pub edition: Edition,
264262
pub kind: MacroDefKind,
265263
pub local_inner: bool,

0 commit comments

Comments
 (0)