Skip to content

Commit 14345ee

Browse files
committed
add test cases for #12435
1 parent 99e8000 commit 14345ee

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

tests/ui/mixed_attributes_style.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,18 @@ mod bar {
3838
fn main() {
3939
// test code goes here
4040
}
41+
42+
// issue #12435
43+
#[cfg(test)]
44+
mod tests {
45+
//! Module doc, don't lint
46+
}
47+
#[allow(unused)]
48+
mod baz {
49+
//! Module doc, don't lint
50+
const FOO: u8 = 0;
51+
}
52+
/// Module doc, don't lint
53+
mod quz {
54+
#![allow(unused)]
55+
}

tests/ui/mixed_attributes_style.stderr

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,29 @@ LL | | mod bar {
2626
LL | | #![allow(unused)]
2727
| |_____________________^
2828

29-
error: aborting due to 3 previous errors
29+
error: item has both inner and outer attributes
30+
--> tests/ui/mixed_attributes_style.rs:43:1
31+
|
32+
LL | / #[cfg(test)]
33+
LL | | mod tests {
34+
LL | | //! Module doc, don't lint
35+
| |______________________________^
36+
37+
error: item has both inner and outer attributes
38+
--> tests/ui/mixed_attributes_style.rs:47:1
39+
|
40+
LL | / #[allow(unused)]
41+
LL | | mod baz {
42+
LL | | //! Module doc, don't lint
43+
| |______________________________^
44+
45+
error: item has both inner and outer attributes
46+
--> tests/ui/mixed_attributes_style.rs:52:1
47+
|
48+
LL | / /// Module doc, don't lint
49+
LL | | mod quz {
50+
LL | | #![allow(unused)]
51+
| |_____________________^
52+
53+
error: aborting due to 6 previous errors
3054

0 commit comments

Comments
 (0)