Skip to content

Commit 8954c21

Browse files
author
chansuke
authored
Add tests for duplicated attributes on expressions(#4452) (#4481)
* Add tests for duplicated attributes on expressions(#4452) * Add necessary comments and fix the target * Add comments for testings * Fix testing for extra brace insertion
1 parent cbe01e4 commit 8954c21

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

tests/source/issue-4475.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
#[cfg(debug_assertions)]
3+
{ println!("DEBUG"); }
4+
}

tests/target/issue-4452.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
fn a(&self) -> i64 {
2+
// foo
3+
#[allow(clippy::cast_possible_wrap)]
4+
1u64 as i64
5+
}
6+
7+
fn b(&self) -> i64 {
8+
// bar
9+
#[allow(clippy::cast_possible_wrap)]
10+
#[attr]
11+
1..2
12+
}
13+
14+
fn foo() {
15+
#[allow(clippy::cast_possible_wrap)]
16+
{
17+
// some comment
18+
}
19+
}

tests/target/issue-4475.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
#[cfg(debug_assertions)]
3+
{
4+
println!("DEBUG");
5+
}
6+
}

0 commit comments

Comments
 (0)