Add a mirror function-like proc-macro expander for tests

This commit is contained in:
Lukas Wirth 2021-09-21 14:55:54 +02:00
parent 8b1e8197fe
commit ba84b91e78
4 changed files with 45 additions and 10 deletions

View file

@ -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: {