Add ui test for mixed_attributes_style
This commit is contained in:
parent
9f4a58f616
commit
28738234ac
39
tests/ui/mixed_attributes_style.rs
Normal file
39
tests/ui/mixed_attributes_style.rs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#![warn(clippy::mixed_attributes_style)]
|
||||||
|
|
||||||
|
#[allow(unused)] //~ ERROR: item has both inner and outer attributes
|
||||||
|
fn foo1() {
|
||||||
|
#![allow(unused)]
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unused)]
|
||||||
|
#[allow(unused)]
|
||||||
|
fn foo2() {}
|
||||||
|
|
||||||
|
fn foo3() {
|
||||||
|
#![allow(unused)]
|
||||||
|
#![allow(unused)]
|
||||||
|
}
|
||||||
|
|
||||||
|
/// linux
|
||||||
|
//~^ ERROR: item has both inner and outer attributes
|
||||||
|
fn foo4() {
|
||||||
|
//! windows
|
||||||
|
}
|
||||||
|
|
||||||
|
/// linux
|
||||||
|
/// windows
|
||||||
|
fn foo5() {}
|
||||||
|
|
||||||
|
fn foo6() {
|
||||||
|
//! linux
|
||||||
|
//! windows
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(unused)] //~ ERROR: item has both inner and outer attributes
|
||||||
|
mod bar {
|
||||||
|
#![allow(unused)]
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
// test code goes here
|
||||||
|
}
|
30
tests/ui/mixed_attributes_style.stderr
Normal file
30
tests/ui/mixed_attributes_style.stderr
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
error: item has both inner and outer attributes
|
||||||
|
--> tests/ui/mixed_attributes_style.rs:3:1
|
||||||
|
|
|
||||||
|
LL | / #[allow(unused)]
|
||||||
|
LL | | fn foo1() {
|
||||||
|
LL | | #![allow(unused)]
|
||||||
|
| |_____________________^
|
||||||
|
|
|
||||||
|
= note: `-D clippy::mixed-attributes-style` implied by `-D warnings`
|
||||||
|
= help: to override `-D warnings` add `#[allow(clippy::mixed_attributes_style)]`
|
||||||
|
|
||||||
|
error: item has both inner and outer attributes
|
||||||
|
--> tests/ui/mixed_attributes_style.rs:17:1
|
||||||
|
|
|
||||||
|
LL | / /// linux
|
||||||
|
LL | |
|
||||||
|
LL | | fn foo4() {
|
||||||
|
LL | | //! windows
|
||||||
|
| |_______________^
|
||||||
|
|
||||||
|
error: item has both inner and outer attributes
|
||||||
|
--> tests/ui/mixed_attributes_style.rs:32:1
|
||||||
|
|
|
||||||
|
LL | / #[allow(unused)]
|
||||||
|
LL | | mod bar {
|
||||||
|
LL | | #![allow(unused)]
|
||||||
|
| |_____________________^
|
||||||
|
|
||||||
|
error: aborting due to 3 previous errors
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user