mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Add a mirror function-like proc-macro expander for tests
This commit is contained in:
parent
8b1e8197fe
commit
ba84b91e78
4 changed files with 45 additions and 10 deletions
|
@ -10,7 +10,7 @@ use crate::{fixture, FileRange, HlTag, TextRange};
|
|||
fn test_highlighting() {
|
||||
check_highlighting(
|
||||
r#"
|
||||
//- proc_macros: identity
|
||||
//- proc_macros: identity, mirror
|
||||
//- /main.rs crate:main deps:foo
|
||||
use inner::{self as inner_mod};
|
||||
mod inner {}
|
||||
|
@ -36,10 +36,11 @@ pub mod ops {
|
|||
pub trait Fn<Args>: FnMut<Args> {}
|
||||
}
|
||||
|
||||
|
||||
struct Foo {
|
||||
pub x: i32,
|
||||
pub y: i32,
|
||||
proc_macros::mirror! {
|
||||
{
|
||||
,i32 :x pub
|
||||
,i32 :y pub
|
||||
} Foo struct
|
||||
}
|
||||
|
||||
trait Bar where Self: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue