mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
82c6f187ad
Skip `unused_parens` report for `Paren(Path(..))` in macro. fixes #120642 In following code, `unused_parens` suggest change `<($($rest),*)>::bar()` to `<$rest>::bar()` which will cause another err: `error: variable 'rest' is still repeating at this depth`: ```rust trait Foo { fn bar(); } macro_rules! problem { ($ty:ident) => { impl<$ty: Foo> Foo for ($ty,) { fn bar() { <$ty>::bar() } } }; ($ty:ident $(, $rest:ident)*) => { impl<$ty: Foo, $($rest: Foo),*> Foo for ($ty, $($rest),*) { fn bar() { <$ty>::bar(); <($($rest),*)>::bar() } } problem!($($rest),*); } } ``` I think maybe we can handle this by avoid warning for `Paren(Path(..))` in the macro. Is this reasonable approach? |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |