Skip to content

Commit

Permalink
Work around clippy semicolon_if_nothing_returned regression
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 5, 2021
1 parent 9e1b974 commit 264221e
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -745,9 +745,15 @@ macro_rules! quote_token_with_context {
// warnings on anything below the loop. We use has_iter to detect and
// fail to compile when there are no iterators, so here we just work
// around the unneeded extra warning.
while true {
//
// FIXME: temporariliy working around Clippy regression.
// https://github.com/rust-lang/rust-clippy/issues/7768
loop {
$crate::pounded_var_names!(quote_bind_next_or_break!() () $($inner)*);
$crate::quote_each_token!($tokens $($inner)*);
if false {
break;
}
}
}};
($tokens:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {};
Expand All @@ -759,13 +765,16 @@ macro_rules! quote_token_with_context {
let has_iter = $crate::__private::ThereIsNoIteratorInRepetition;
$crate::pounded_var_names!(quote_bind_into_iter!(has_iter) () $($inner)*);
let _: $crate::__private::HasIterator = has_iter;
while true {
loop {
$crate::pounded_var_names!(quote_bind_next_or_break!() () $($inner)*);
if _i > 0 {
$crate::quote_token!($tokens $sep);
}
_i += 1;
$crate::quote_each_token!($tokens $($inner)*);
if false {
break;
}
}
}};
($tokens:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {};
Expand Down Expand Up @@ -801,9 +810,15 @@ macro_rules! quote_token_with_context_spanned {
// warnings on anything below the loop. We use has_iter to detect and
// fail to compile when there are no iterators, so here we just work
// around the unneeded extra warning.
while true {
//
// FIXME: temporariliy working around Clippy regression.
// https://github.com/rust-lang/rust-clippy/issues/7768
loop {
$crate::pounded_var_names!(quote_bind_next_or_break!() () $($inner)*);
$crate::quote_each_token_spanned!($tokens $span $($inner)*);
if false {
break;
}
}
}};
($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {};
Expand All @@ -815,13 +830,16 @@ macro_rules! quote_token_with_context_spanned {
let has_iter = $crate::__private::ThereIsNoIteratorInRepetition;
$crate::pounded_var_names!(quote_bind_into_iter!(has_iter) () $($inner)*);
let _: $crate::__private::HasIterator = has_iter;
while true {
loop {
$crate::pounded_var_names!(quote_bind_next_or_break!() () $($inner)*);
if _i > 0 {
$crate::quote_token_spanned!($tokens $span $sep);
}
_i += 1;
$crate::quote_each_token_spanned!($tokens $span $($inner)*);
if false {
break;
}
}
}};
($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {};
Expand Down

0 comments on commit 264221e

Please sign in to comment.