rust/compiler/rustc_lint
León Orell Valerian Liehr 82c6f187ad
Rollup merge of #123314 - surechen:fix_120642, r=Nadrieril
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?
2024-04-11 01:56:24 +02:00
..
src Rollup merge of #123314 - surechen:fix_120642, r=Nadrieril 2024-04-11 01:56:24 +02:00
Cargo.toml Remove useless smallvec dependency in rustc_lint::non_local_def 2024-03-07 07:54:15 +01:00
messages.ftl Actually create ranged int types in the type system. 2024-04-08 12:02:19 +00:00