Skip to content

Commit dcc1b0d

Browse files
committed
add a test
1 parent 1fbf172 commit dcc1b0d

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ force-host
2+
//@ no-prefer-dynamic
3+
4+
#![crate_type = "proc-macro"]
5+
6+
extern crate proc_macro;
7+
8+
// Doesn't do anything, but has a helper attribute.
9+
#[proc_macro_derive(WithHelperAttr, attributes(x))]
10+
pub fn derive(_input: proc_macro::TokenStream) -> proc_macro::TokenStream {
11+
proc_macro::TokenStream::new()
12+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//@ check-pass
2+
//@ aux-build:helper-attr.rs
3+
//@ edition:2021
4+
5+
// This test checks that helper attributes of a derive proc macro can be used together with
6+
// other built-in derive macros.
7+
8+
#[macro_use]
9+
extern crate helper_attr;
10+
11+
use helper_attr::WithHelperAttr;
12+
13+
#[derive(WithHelperAttr, Debug, Clone, PartialEq)]
14+
struct MyStruct<#[x] 'a, #[x] const A: usize, #[x] B> {
15+
#[x]
16+
field: &'a [B; A],
17+
}
18+
19+
fn main() {}

0 commit comments

Comments
 (0)