Skip to content

Commit

Permalink
fix new failing proc macro tests
Browse files Browse the repository at this point in the history
  • Loading branch information
y21 committed May 30, 2023
1 parent de1f410 commit d816eba
Showing 1 changed file with 49 additions and 61 deletions.
110 changes: 49 additions & 61 deletions tests/ui/auxiliary/proc_macro_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,70 +90,58 @@ pub fn extra_lifetime(_input: TokenStream) -> TokenStream {
#[allow(unused)]
#[proc_macro_derive(ArithmeticDerive)]
pub fn arithmetic_derive(_: TokenStream) -> TokenStream {
<TokenStream as FromIterator<TokenTree>>::from_iter(
[
Ident::new("fn", Span::call_site()).into(),
Ident::new("_foo", Span::call_site()).into(),
Group::new(Delimiter::Parenthesis, TokenStream::new()).into(),
Group::new(
Delimiter::Brace,
<TokenStream as FromIterator<TokenTree>>::from_iter(
[
Ident::new("let", Span::call_site()).into(),
Ident::new("mut", Span::call_site()).into(),
Ident::new("_n", Span::call_site()).into(),
Punct::new('=', Spacing::Alone).into(),
Literal::i32_unsuffixed(9).into(),
Punct::new(';', Spacing::Alone).into(),
Ident::new("_n", Span::call_site()).into(),
Punct::new('=', Spacing::Alone).into(),
Literal::i32_unsuffixed(9).into(),
Punct::new('/', Spacing::Alone).into(),
Literal::i32_unsuffixed(2).into(),
Punct::new(';', Spacing::Alone).into(),
Ident::new("_n", Span::call_site()).into(),
Punct::new('=', Spacing::Alone).into(),
Punct::new('-', Spacing::Alone).into(),
Ident::new("_n", Span::call_site()).into(),
Punct::new(';', Spacing::Alone).into(),
]
.into_iter(),
),
)
.into(),
]
.into_iter(),
)
<TokenStream as FromIterator<TokenTree>>::from_iter([
Ident::new("fn", Span::call_site()).into(),
Ident::new("_foo", Span::call_site()).into(),
Group::new(Delimiter::Parenthesis, TokenStream::new()).into(),
Group::new(
Delimiter::Brace,
<TokenStream as FromIterator<TokenTree>>::from_iter([
Ident::new("let", Span::call_site()).into(),
Ident::new("mut", Span::call_site()).into(),
Ident::new("_n", Span::call_site()).into(),
Punct::new('=', Spacing::Alone).into(),
Literal::i32_unsuffixed(9).into(),
Punct::new(';', Spacing::Alone).into(),
Ident::new("_n", Span::call_site()).into(),
Punct::new('=', Spacing::Alone).into(),
Literal::i32_unsuffixed(9).into(),
Punct::new('/', Spacing::Alone).into(),
Literal::i32_unsuffixed(2).into(),
Punct::new(';', Spacing::Alone).into(),
Ident::new("_n", Span::call_site()).into(),
Punct::new('=', Spacing::Alone).into(),
Punct::new('-', Spacing::Alone).into(),
Ident::new("_n", Span::call_site()).into(),
Punct::new(';', Spacing::Alone).into(),
]),
)
.into(),
])
}

#[allow(unused)]
#[proc_macro_derive(ShadowDerive)]
pub fn shadow_derive(_: TokenStream) -> TokenStream {
<TokenStream as FromIterator<TokenTree>>::from_iter(
[
Ident::new("fn", Span::call_site()).into(),
Ident::new("_foo", Span::call_site()).into(),
Group::new(Delimiter::Parenthesis, TokenStream::new()).into(),
Group::new(
Delimiter::Brace,
<TokenStream as FromIterator<TokenTree>>::from_iter(
[
Ident::new("let", Span::call_site()).into(),
Ident::new("_x", Span::call_site()).into(),
Punct::new('=', Spacing::Alone).into(),
Literal::i32_unsuffixed(2).into(),
Punct::new(';', Spacing::Alone).into(),
Ident::new("let", Span::call_site()).into(),
Ident::new("_x", Span::call_site()).into(),
Punct::new('=', Spacing::Alone).into(),
Ident::new("_x", Span::call_site()).into(),
Punct::new(';', Spacing::Alone).into(),
]
.into_iter(),
),
)
.into(),
]
.into_iter(),
)
<TokenStream as FromIterator<TokenTree>>::from_iter([
Ident::new("fn", Span::call_site()).into(),
Ident::new("_foo", Span::call_site()).into(),
Group::new(Delimiter::Parenthesis, TokenStream::new()).into(),
Group::new(
Delimiter::Brace,
<TokenStream as FromIterator<TokenTree>>::from_iter([
Ident::new("let", Span::call_site()).into(),
Ident::new("_x", Span::call_site()).into(),
Punct::new('=', Spacing::Alone).into(),
Literal::i32_unsuffixed(2).into(),
Punct::new(';', Spacing::Alone).into(),
Ident::new("let", Span::call_site()).into(),
Ident::new("_x", Span::call_site()).into(),
Punct::new('=', Spacing::Alone).into(),
Ident::new("_x", Span::call_site()).into(),
Punct::new(';', Spacing::Alone).into(),
]),
)
.into(),
])
}

0 comments on commit d816eba

Please sign in to comment.