Skip to content

Commit

Permalink
add test cases for #12435
Browse files Browse the repository at this point in the history
  • Loading branch information
J-ZhengLi committed Mar 14, 2024
1 parent 99e8000 commit 14345ee
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
15 changes: 15 additions & 0 deletions tests/ui/mixed_attributes_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,18 @@ mod bar {
fn main() {
// test code goes here
}

// issue #12435
#[cfg(test)]
mod tests {
//! Module doc, don't lint
}
#[allow(unused)]
mod baz {
//! Module doc, don't lint
const FOO: u8 = 0;
}
/// Module doc, don't lint
mod quz {
#![allow(unused)]
}
26 changes: 25 additions & 1 deletion tests/ui/mixed_attributes_style.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,29 @@ LL | | mod bar {
LL | | #![allow(unused)]
| |_____________________^

error: aborting due to 3 previous errors
error: item has both inner and outer attributes
--> tests/ui/mixed_attributes_style.rs:43:1
|
LL | / #[cfg(test)]
LL | | mod tests {
LL | | //! Module doc, don't lint
| |______________________________^

error: item has both inner and outer attributes
--> tests/ui/mixed_attributes_style.rs:47:1
|
LL | / #[allow(unused)]
LL | | mod baz {
LL | | //! Module doc, don't lint
| |______________________________^

error: item has both inner and outer attributes
--> tests/ui/mixed_attributes_style.rs:52:1
|
LL | / /// Module doc, don't lint
LL | | mod quz {
LL | | #![allow(unused)]
| |_____________________^

error: aborting due to 6 previous errors

0 comments on commit 14345ee

Please sign in to comment.