Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 25f5adb

Browse files
authored
Merge pull request #374 from MitMaro/mitmaro/allow-all-linting
Update smoke test to verify all Clippy and rustc lints
2 parents 27f0e43 + 8dae8bd commit 25f5adb

File tree

2 files changed

+54
-5
lines changed

2 files changed

+54
-5
lines changed

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,9 @@ macro_rules! bitflags {
590590
unused_mut,
591591
unused_imports,
592592
non_upper_case_globals,
593-
clippy::assign_op_pattern
593+
clippy::assign_op_pattern,
594+
clippy::indexing_slicing,
595+
clippy::same_name_method
594596
)]
595597
const _: () = {
596598
// Declared in a "hidden" scope that can't be reached directly

tests/smoke-test/src/main.rs

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,66 @@
1-
#![deny(warnings)]
1+
#![allow(unknown_lints)]
2+
#![deny(clippy::all, clippy::pedantic, clippy::restriction)]
3+
#![allow(clippy::blanket_clippy_restriction_lints)]
4+
// deny all rustc's built-in lints
5+
#![deny(
6+
warnings,
7+
future_incompatible,
8+
let_underscore,
9+
nonstandard_style,
10+
rust_2018_compatibility,
11+
rust_2018_idioms,
12+
rust_2021_compatibility,
13+
unused
14+
)]
15+
// deny additional allow by default from rustc
16+
#![deny(
17+
deprecated_in_future,
18+
ffi_unwind_calls,
19+
macro_use_extern_crate,
20+
meta_variable_misuse,
21+
missing_abi,
22+
missing_copy_implementations,
23+
missing_debug_implementations,
24+
missing_docs,
25+
non_ascii_idents,
26+
noop_method_call,
27+
single_use_lifetimes,
28+
trivial_casts,
29+
trivial_numeric_casts,
30+
unreachable_pub,
31+
unsafe_code,
32+
unsafe_op_in_unsafe_fn,
33+
unused_crate_dependencies,
34+
unused_import_braces,
35+
unused_lifetimes,
36+
unused_qualifications,
37+
unused_results,
38+
unused_tuple_struct_fields,
39+
variant_size_differences
40+
)]
41+
42+
//! An example file for smoke tests
243
344
use bitflags::bitflags;
445

546
bitflags! {
647
#[derive(Debug)]
48+
/// Example Flags
749
pub struct Flags: u32 {
8-
const A = 0b00000001;
9-
const B = 0b00000010;
10-
const C = 0b00000100;
50+
/// A
51+
const A = 0b0000_0001;
52+
/// B
53+
const B = 0b0000_0010;
54+
/// C
55+
const C = 0b0000_0100;
56+
/// ABC
1157
const ABC = Flags::A.bits() | Flags::B.bits() | Flags::C.bits();
1258

1359
const _ = !0;
1460
}
1561
}
1662

63+
#[allow(clippy::print_stdout, clippy::use_debug)]
1764
fn main() {
1865
println!("{:?}", Flags::ABC);
1966
}

0 commit comments

Comments
 (0)