Go to file
bors c3bab96b80 Auto merge of #14989 - lowr:fix/nested-macro-in-assoc-item-panic, r=Veykril
fix: derive source scope from syntax node to be transformed

Fixes #14534

When we use `PathTransform` for associated items of a trait, we have been feeding `SemanticsScope` for the trait definition to it as source scope. `PathTransform` uses the source scope to resolve paths in associated items to find which path to transform. In the course of path resolution, the scope is responsible for lowering `ast::MacroType`s (because they can be written within a path) using `AstIdMap` for the scope's `HirFileId`.

The problem here is that when an associated item is generated by a macro, the scope for the trait is different from the scope for that associated item. The former can only resolve the top-level macros within the trait definition but not the macro calls generated by those top-level macros. We need the latter to resolve such nested macros.

This PR makes sure that we pass `SemanticsScope` for each associated item we're applying path transformation to.
2023-06-11 07:10:27 +00:00
.cargo
.github Auto merge of #14827 - davidlattimore:autopublish-offset, r=Veykril 2023-06-10 11:33:06 +00:00
.vscode Spelling 2023-04-19 09:45:55 -04:00
assets
bench_data Spelling 2023-04-19 09:45:55 -04:00
crates fix(completion): derive source scope from syntax node to be transformed 2023-06-11 15:25:43 +09:00
docs Document the sysroot field in JsonProject 2023-06-08 14:56:37 -07:00
editors/code Add render configs for memory layout hovers 2023-05-30 18:36:06 +02:00
lib Slightly shrink DefMap 2023-06-01 14:46:36 +02:00
xtask Add version placeholder to changelog template 2023-02-12 10:55:49 +02:00
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore
Cargo.lock Fix dependency warning 2023-06-07 12:34:38 +03:00
Cargo.toml Update builtin attribute list 2023-06-04 10:02:11 +02:00
LICENSE-APACHE
LICENSE-MIT
PRIVACY.md
README.md
rustfmt.toml
triagebot.toml ⬆️ rust-analyzer 2022-11-09 21:49:10 +02:00

rust-analyzer logo

rust-analyzer is a modular compiler frontend for the Rust language. It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust.

Quick Start

https://rust-analyzer.github.io/manual.html#installation

Documentation

If you want to contribute to rust-analyzer or are just curious about how things work under the hood, check the ./docs/dev folder.

If you want to use rust-analyzer's language server with your editor of choice, check the manual folder. It also contains some tips & tricks to help you be more productive when using rust-analyzer.

Security and Privacy

See the corresponding sections of the manual.

Communication

For usage and troubleshooting requests, please use "IDEs and Editors" category of the Rust forum:

https://users.rust-lang.org/c/ide/14

For questions about development and implementation, join rust-analyzer working group on Zulip:

https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer

License

rust-analyzer is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.