Skip to content

Commit a3f6faf

Browse files
authored
Repo: Move more allows to expects (#1654)
Let's see how many of these fail CI. Progress on #300.
1 parent ec065de commit a3f6faf

File tree

35 files changed

+54
-78
lines changed

35 files changed

+54
-78
lines changed

Guide/src/dev_guide/contrib/code.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ project, and will fast-fail if it catches any warnings / errors.
142142
### Suppressing Lints
143143

144144
In general, lints should be fixed by modifying the code to satisfy the lint.
145-
However, there are cases where a lint may need to be `allow`'d inline.
145+
However, there are cases where a lint may need to be `expect`'d inline.
146146

147147
In these cases, you _must_ provide a inline comment providing reasonable
148148
justification for the suppressed lint.
@@ -152,7 +152,7 @@ e.g:
152152
```rust
153153
// x86_64-unknown-linux-musl targets have a different type defn for
154154
// `libc::cmsghdr`, hence why these lints are being suppressed.
155-
#[allow(clippy::needless_update, clippy::useless_conversion)]
155+
#[expect(clippy::needless_update, clippy::useless_conversion)]
156156
libc::cmsghdr {
157157
cmsg_level: libc::SOL_SOCKET,
158158
cmsg_type: libc::SCM_RIGHTS,

openvmm/openvmm_entry/src/cli_args.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,8 +1590,11 @@ mod tests {
15901590
assert!(DiskCliKind::from_str("sqldiff:path").is_err());
15911591

15921592
// Missing OPENVMM_AUTO_CACHE_PATH for AutoCacheSqlite
1593-
#[allow(deprecated_safe_2024)]
1594-
std::env::remove_var("OPENVMM_AUTO_CACHE_PATH");
1593+
// SAFETY:
1594+
// Safe in a testing context because it won't be changed concurrently
1595+
unsafe {
1596+
std::env::remove_var("OPENVMM_AUTO_CACHE_PATH");
1597+
}
15951598
assert!(DiskCliKind::from_str("autocache:key:file:disk.vhd").is_err());
15961599

15971600
// Invalid blob kind

support/mesh/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#![expect(missing_docs)]
99
#![forbid(unsafe_code)]
1010

11-
#[allow(unused_extern_crates)]
11+
#[expect(unused_extern_crates)]
1212
extern crate self as mesh;
1313

1414
pub mod payload {

support/pal/src/windows/alpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use std::time::Duration;
2121
use winapi::shared::ntstatus::STATUS_TIMEOUT;
2222

2323
mod ntlpcapi {
24-
#![allow(non_snake_case, dead_code, clippy::upper_case_acronyms)]
24+
#![expect(non_snake_case, dead_code)]
2525

2626
pub use ntapi::ntlpcapi::*;
2727
use winapi::shared::ntdef::HANDLE;

tmk/simple_tmk/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
#![cfg_attr(minimal_rt, no_std, no_main)]
77
// UNSAFETY: TMK tests are going to need to perform unsafe operations.
8-
#![allow(unsafe_code)]
8+
#![cfg_attr(target_arch = "x86_64", expect(unsafe_code))]
99

1010
mod prelude;
1111

tmk/simple_tmk/src/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//! use crate::prelude::*;
99
//! ```
1010
11-
#![allow(unused_imports)]
11+
#![cfg_attr(target_arch = "aarch64", expect(unused_imports))]
1212

1313
pub use tmk_core::Scope;
1414
pub use tmk_core::TestContext;

vm/acpi_spec/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub mod madt;
1616
pub mod pptt;
1717
pub mod srat;
1818

19-
#[allow(non_camel_case_types)]
19+
#[expect(non_camel_case_types)]
2020
mod packed_nums {
2121
pub type u16_ne = zerocopy::U16<zerocopy::NativeEndian>;
2222
pub type u32_ne = zerocopy::U32<zerocopy::NativeEndian>;

vm/devices/firmware/uefi_specs/src/hyperv/crypto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use zerocopy::Immutable;
1111
use zerocopy::IntoBytes;
1212
use zerocopy::KnownLayout;
1313

14-
#[allow(non_camel_case_types)]
14+
#[expect(non_camel_case_types)]
1515
mod packed_nums {
1616
pub type u64_ne = zerocopy::U64<zerocopy::NativeEndian>;
1717
}

vm/devices/firmware/uefi_specs/src/hyperv/nvram.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use zerocopy::Immutable;
1313
use zerocopy::IntoBytes;
1414
use zerocopy::KnownLayout;
1515

16-
#[allow(non_camel_case_types)]
16+
#[expect(non_camel_case_types)]
1717
mod packed_nums {
1818
pub type u64_ne = zerocopy::U64<zerocopy::NativeEndian>;
1919
}

vm/devices/hyperv_ic_protocol/src/kvp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ open_enum! {
5656
/// The pool to use for a value.
5757
#[derive(IntoBytes, Immutable, KnownLayout, FromBytes)]
5858
pub enum KvpPool: u8 {
59-
#![allow(missing_docs)] // TODO: figure out what the semantics of these actually are.
59+
#![expect(missing_docs)] // TODO: figure out what the semantics of these actually are.
6060
EXTERNAL = 0,
6161
GUEST = 1,
6262
AUTO = 2,

0 commit comments

Comments
 (0)