mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
internal: add integrated test for token censoring
This commit is contained in:
parent
a88344152d
commit
634f047d90
7 changed files with 105 additions and 71 deletions
|
@ -270,6 +270,10 @@ fn test_proc_macros(proc_macros: &[String]) -> (Vec<ProcMacro>, String) {
|
|||
pub fn identity(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
item
|
||||
}
|
||||
#[proc_macro_derive(derive_identity)]
|
||||
pub fn derive_identity(item: TokenStream) -> TokenStream {
|
||||
item
|
||||
}
|
||||
#[proc_macro_attribute]
|
||||
pub fn input_replace(attr: TokenStream, _item: TokenStream) -> TokenStream {
|
||||
attr
|
||||
|
@ -285,6 +289,11 @@ pub fn mirror(input: TokenStream) -> TokenStream {
|
|||
kind: crate::ProcMacroKind::Attr,
|
||||
expander: Arc::new(IdentityProcMacroExpander),
|
||||
},
|
||||
ProcMacro {
|
||||
name: "derive_identity".into(),
|
||||
kind: crate::ProcMacroKind::CustomDerive,
|
||||
expander: Arc::new(IdentityProcMacroExpander),
|
||||
},
|
||||
ProcMacro {
|
||||
name: "input_replace".into(),
|
||||
kind: crate::ProcMacroKind::Attr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue