Skip to content

Commit

Permalink
Merge pull request #374 from MitMaro/mitmaro/allow-all-linting
Browse files Browse the repository at this point in the history
Update smoke test to verify all Clippy and rustc lints
  • Loading branch information
KodrAus committed Jul 31, 2023
2 parents 27f0e43 + 8dae8bd commit 25f5adb
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/lib.rs
Expand Up @@ -590,7 +590,9 @@ macro_rules! bitflags {
unused_mut,
unused_imports,
non_upper_case_globals,
clippy::assign_op_pattern
clippy::assign_op_pattern,
clippy::indexing_slicing,
clippy::same_name_method
)]
const _: () = {
// Declared in a "hidden" scope that can't be reached directly
Expand Down
55 changes: 51 additions & 4 deletions tests/smoke-test/src/main.rs
@@ -1,19 +1,66 @@
#![deny(warnings)]
#![allow(unknown_lints)]
#![deny(clippy::all, clippy::pedantic, clippy::restriction)]
#![allow(clippy::blanket_clippy_restriction_lints)]
// deny all rustc's built-in lints
#![deny(
warnings,
future_incompatible,
let_underscore,
nonstandard_style,
rust_2018_compatibility,
rust_2018_idioms,
rust_2021_compatibility,
unused
)]
// deny additional allow by default from rustc
#![deny(
deprecated_in_future,
ffi_unwind_calls,
macro_use_extern_crate,
meta_variable_misuse,
missing_abi,
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
non_ascii_idents,
noop_method_call,
single_use_lifetimes,
trivial_casts,
trivial_numeric_casts,
unreachable_pub,
unsafe_code,
unsafe_op_in_unsafe_fn,
unused_crate_dependencies,
unused_import_braces,
unused_lifetimes,
unused_qualifications,
unused_results,
unused_tuple_struct_fields,
variant_size_differences
)]

//! An example file for smoke tests

use bitflags::bitflags;

bitflags! {
#[derive(Debug)]
/// Example Flags
pub struct Flags: u32 {
const A = 0b00000001;
const B = 0b00000010;
const C = 0b00000100;
/// A
const A = 0b0000_0001;
/// B
const B = 0b0000_0010;
/// C
const C = 0b0000_0100;
/// ABC
const ABC = Flags::A.bits() | Flags::B.bits() | Flags::C.bits();

const _ = !0;
}
}

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

0 comments on commit 25f5adb

Please sign in to comment.