mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Do not replace items annotated with builtin attrs with the attr input
This commit is contained in:
parent
8dd3a71730
commit
351cec0cb4
4 changed files with 25 additions and 18 deletions
|
@ -17,11 +17,12 @@ macro_rules! register_builtin {
|
|||
db: &dyn AstDatabase,
|
||||
id: MacroCallId,
|
||||
tt: &tt::Subtree,
|
||||
item: &tt::Subtree,
|
||||
) -> Result<tt::Subtree, mbe::ExpandError> {
|
||||
let expander = match *self {
|
||||
$( BuiltinAttrExpander::$variant => $expand, )*
|
||||
};
|
||||
expander(db, id, tt)
|
||||
expander(db, id, tt, item)
|
||||
}
|
||||
|
||||
fn find_by_name(name: &name::Name) -> Option<Self> {
|
||||
|
@ -61,7 +62,8 @@ pub fn find_builtin_attr(
|
|||
fn dummy_attr_expand(
|
||||
_db: &dyn AstDatabase,
|
||||
_id: MacroCallId,
|
||||
tt: &tt::Subtree,
|
||||
_tt: &tt::Subtree,
|
||||
item: &tt::Subtree,
|
||||
) -> Result<tt::Subtree, mbe::ExpandError> {
|
||||
Ok(tt.clone())
|
||||
Ok(item.clone())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue