mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-30 03:27:44 +00:00
Make global_asm!() work
Because apparently, we were not accepting inline asm in item position, completely breaking it.
This commit is contained in:
parent
bd8087e86e
commit
95c04c4503
13 changed files with 58 additions and 36 deletions
|
|
@ -1441,9 +1441,11 @@ fn scope_for(
|
|||
) -> Option<ScopeId> {
|
||||
node.ancestors_with_macros(db)
|
||||
.take_while(|it| {
|
||||
!ast::Item::can_cast(it.kind())
|
||||
|| ast::MacroCall::can_cast(it.kind())
|
||||
|| ast::Use::can_cast(it.kind())
|
||||
let kind = it.kind();
|
||||
!ast::Item::can_cast(kind)
|
||||
|| ast::MacroCall::can_cast(kind)
|
||||
|| ast::Use::can_cast(kind)
|
||||
|| ast::AsmExpr::can_cast(kind)
|
||||
})
|
||||
.filter_map(|it| it.map(ast::Expr::cast).transpose())
|
||||
.filter_map(|it| source_map.node_expr(it.as_ref())?.as_expr())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue