diff options
| author | bors <bors@rust-lang.org> | 2024-02-24 10:52:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-24 10:52:55 +0000 |
| commit | 64054693eb35cd0b80d3eee598f723a2b2df2e8f (patch) | |
| tree | f2b59c80692ebc6ba417d0c379370488f5388900 /tests | |
| parent | 05978388922a0734fe67dd75d884794b0c0d2f59 (diff) | |
| parent | cd45d5a81c239ccced418604c8f60a4e5338c1e0 (diff) | |
| download | rust-64054693eb35cd0b80d3eee598f723a2b2df2e8f.tar.gz rust-64054693eb35cd0b80d3eee598f723a2b2df2e8f.zip | |
Auto merge of #12322 - sanxiyn:expression-with-attribute, r=llogiq
Be careful with expressions with attributes Fix #9949. changelog: [`unused_unit`]: skip expressions with attributes
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/unused_unit.fixed | 7 | ||||
| -rw-r--r-- | tests/ui/unused_unit.rs | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/unused_unit.fixed b/tests/ui/unused_unit.fixed index 16da9a25b2a..04fe2d3b7af 100644 --- a/tests/ui/unused_unit.fixed +++ b/tests/ui/unused_unit.fixed @@ -94,3 +94,10 @@ mod issue9748 { let _ = for<'a> |_: &'a u32| -> () {}; } } + +mod issue9949 { + fn main() { + #[doc = "documentation"] + () + } +} diff --git a/tests/ui/unused_unit.rs b/tests/ui/unused_unit.rs index e374031436d..25c2ed59873 100644 --- a/tests/ui/unused_unit.rs +++ b/tests/ui/unused_unit.rs @@ -94,3 +94,10 @@ mod issue9748 { let _ = for<'a> |_: &'a u32| -> () {}; } } + +mod issue9949 { + fn main() { + #[doc = "documentation"] + () + } +} |
