Skip to content

Commit

Permalink
add test files for issue rust-lang#12436
Browse files Browse the repository at this point in the history
  • Loading branch information
J-ZhengLi committed Mar 14, 2024
1 parent 88e1770 commit b4e8d96
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/ui-cargo/mixed_attributes_style/fail/Cargo.stderr
@@ -0,0 +1,12 @@
error: item has both inner and outer attributes
--> src/submodule.rs:1:1
|
1 | / #[allow(unused)]
2 | | mod foo {
3 | | #![allow(dead_code)]
| |________________________^
|
= note: `-D clippy::mixed-attributes-style` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::mixed_attributes_style)]`

error: could not compile `mixed_attributes_style` (bin "mixed_attributes_style") due to 1 previous error
7 changes: 7 additions & 0 deletions tests/ui-cargo/mixed_attributes_style/fail/Cargo.toml
@@ -0,0 +1,7 @@
[package]
name = "mixed_attributes_style"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
2 changes: 2 additions & 0 deletions tests/ui-cargo/mixed_attributes_style/fail/src/main.rs
@@ -0,0 +1,2 @@
mod submodule;
fn main() {}
4 changes: 4 additions & 0 deletions tests/ui-cargo/mixed_attributes_style/fail/src/submodule.rs
@@ -0,0 +1,4 @@
#[allow(unused)]
mod foo {
#![allow(dead_code)]
}
12 changes: 12 additions & 0 deletions tests/ui-cargo/mixed_attributes_style/pass/Cargo.stderr
@@ -0,0 +1,12 @@
error: item has both inner and outer attributes
--> src/submodule.rs:1:1
|
1 | / #[allow(unused)]
2 | | mod foo {
3 | | #![allow(dead_code)]
| |________________________^
|
= note: `-D clippy::mixed-attributes-style` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::mixed_attributes_style)]`

error: could not compile `mixed_attributes_style` (bin "mixed_attributes_style") due to 1 previous error
7 changes: 7 additions & 0 deletions tests/ui-cargo/mixed_attributes_style/pass/Cargo.toml
@@ -0,0 +1,7 @@
[package]
name = "mixed_attributes_style"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
4 changes: 4 additions & 0 deletions tests/ui-cargo/mixed_attributes_style/pass/src/main.rs
@@ -0,0 +1,4 @@
// Issue #12436
#![allow(clippy::mixed_attributes_style)]
mod submodule;
fn main() {}
4 changes: 4 additions & 0 deletions tests/ui-cargo/mixed_attributes_style/pass/src/submodule.rs
@@ -0,0 +1,4 @@
#[allow(unused)]
mod foo {
#![allow(dead_code)]
}

0 comments on commit b4e8d96

Please sign in to comment.