mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
feat: Make unqualified derive attributes flyimportable
This commit is contained in:
parent
7fdbdc4ab2
commit
ebd63ec1cf
11 changed files with 124 additions and 31 deletions
|
@ -33,7 +33,7 @@ fn derive_censoring() {
|
|||
//- proc_macros: derive_identity
|
||||
#[attr1]
|
||||
#[derive(Foo)]
|
||||
#[derive(proc_macros::derive_identity)]
|
||||
#[derive(proc_macros::DeriveIdentity)]
|
||||
#[derive(Bar)]
|
||||
#[attr2]
|
||||
struct S;
|
||||
|
@ -41,7 +41,7 @@ struct S;
|
|||
expect![[r##"
|
||||
#[attr1]
|
||||
#[derive(Foo)]
|
||||
#[derive(proc_macros::derive_identity)]
|
||||
#[derive(proc_macros::DeriveIdentity)]
|
||||
#[derive(Bar)]
|
||||
#[attr2]
|
||||
struct S;
|
||||
|
|
|
@ -103,7 +103,7 @@ pub struct DefMap {
|
|||
/// Side table with additional proc. macro info, for use by name resolution in downstream
|
||||
/// crates.
|
||||
///
|
||||
/// (the primary purpose is to resolve derive helpers)
|
||||
/// (the primary purpose is to resolve derive helpers and fetch a proc-macros name)
|
||||
exported_proc_macros: FxHashMap<MacroDefId, ProcMacroDef>,
|
||||
|
||||
edition: Edition,
|
||||
|
@ -279,7 +279,9 @@ impl DefMap {
|
|||
pub fn modules(&self) -> impl Iterator<Item = (LocalModuleId, &ModuleData)> + '_ {
|
||||
self.modules.iter()
|
||||
}
|
||||
|
||||
pub fn exported_proc_macros(&self) -> impl Iterator<Item = (MacroDefId, Name)> + '_ {
|
||||
self.exported_proc_macros.iter().map(|(id, def)| (*id, def.name.clone()))
|
||||
}
|
||||
pub fn root(&self) -> LocalModuleId {
|
||||
self.root
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue