Skip to content

Commit c445f72

Browse files
authored
Rollup merge of rust-lang#145250 - fmease:regr-test-for-attr-meta-ice, r=jdonszelmann
Add regression test for former ICE involving malformed meta items containing interpolated tokens Add regression test for rust-lang#140612 from rust-lang#140601 or rather rust-lang#140859 that only added it to `stable` not `master`. Supersedes rust-lang#140584. r? ``@jdonszelmann`` or anyone
2 parents 1c42fe3 + 378dd7c commit c445f72

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
extern crate proc_macro;
2+
3+
use proc_macro::TokenStream;
4+
5+
#[proc_macro_derive(Derive, attributes(arg))]
6+
pub fn derive(_: TokenStream) -> TokenStream {
7+
TokenStream::new()
8+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Regression test for <https://github.com/rust-lang/rust/issues/140612>.
2+
//@ proc-macro: derive_macro_with_helper.rs
3+
//@ edition: 2018
4+
//@ check-pass
5+
6+
macro_rules! call_macro {
7+
($text:expr) => {
8+
#[derive(derive_macro_with_helper::Derive)]
9+
#[arg($text)]
10+
pub struct Foo;
11+
};
12+
}
13+
14+
call_macro!(1 + 1);
15+
16+
fn main() {}

0 commit comments

Comments
 (0)