Use #[expect(lint)], not #[allow(lint)]

This commit is contained in:
Ruihan Li
2025-01-24 18:06:53 +08:00
committed by Tate, Hongliang Tian
parent 1899646391
commit 0dca168717
169 changed files with 254 additions and 254 deletions

View File

@ -31,9 +31,9 @@ fn framebuffer_init() -> Result<(), ComponentInitError> {
pub(crate) static WRITER: Once<SpinLock<Writer>> = Once::new();
// ignore the warnings since we use the `todo!` macro.
#[allow(unused_variables)]
#[allow(unreachable_code)]
#[allow(clippy::diverging_sub_expression)]
#[expect(unused_variables)]
#[expect(unreachable_code)]
#[expect(clippy::diverging_sub_expression)]
pub(crate) fn init() {
let mut writer = {
let Some(framebuffer) = boot_info().framebuffer_arg else {

View File

@ -5,7 +5,7 @@
#![feature(let_chains)]
#![feature(negative_impls)]
#![feature(slice_as_chunks)]
#![allow(dead_code, unused_imports)]
#![expect(dead_code, unused_imports)]
mod error;
mod layers;

View File

@ -21,7 +21,7 @@ use crate::{
};
/// A transaction provider.
#[allow(clippy::type_complexity)]
#[expect(clippy::type_complexity)]
pub struct TxProvider {
id: u64,
initializer_map: RwLock<HashMap<TypeId, Box<dyn Any + Send + Sync>>>,

View File

@ -40,7 +40,7 @@ use crate::prelude::*;
/// // The deletion operation will be carried out when it is dropped
/// drop(lazy_delete_u32);
/// ```
#[allow(clippy::type_complexity)]
#[expect(clippy::type_complexity)]
pub struct LazyDelete<T> {
obj: T,
is_deleted: AtomicBool,

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused)]
#![expect(unused)]
use alloc::{
collections::VecDeque,

View File

@ -80,7 +80,7 @@ impl Taskless {
// Since the same taskless will not be executed concurrently,
// it is safe to use a `RefCell` here though the `Taskless` will
// be put into an `Arc`.
#[allow(clippy::arc_with_non_send_sync)]
#[expect(clippy::arc_with_non_send_sync)]
Arc::new(Self {
is_scheduled: AtomicBool::new(false),
is_running: AtomicBool::new(false),

View File

@ -75,7 +75,7 @@ pub struct InputDevice {
event_queue: SpinLock<VirtQueue>,
status_queue: VirtQueue,
event_table: EventTable,
#[allow(clippy::type_complexity)]
#[expect(clippy::type_complexity)]
callbacks: RwLock<Vec<Arc<dyn Fn(InputEvent) + Send + Sync + 'static>>, LocalIrqDisabled>,
transport: SpinLock<Box<dyn VirtioTransport>>,
}

View File

@ -34,7 +34,7 @@ bitflags! {
#[repr(u8)]
#[derive(Default, Debug, Clone, Copy, TryFromInt)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub enum GsoType {
#[default]
VIRTIO_NET_HDR_GSO_NONE = 0,

View File

@ -11,7 +11,7 @@ use ostd::bus::pci::{
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
#[repr(u8)]
#[allow(clippy::enum_variant_names)]
#[expect(clippy::enum_variant_names)]
pub enum VirtioPciCpabilityType {
CommonCfg = 1,
NotifyCfg = 2,

View File

@ -268,7 +268,7 @@ impl VirtioTransport for VirtioPciModernTransport {
}
impl VirtioPciModernTransport {
#[allow(clippy::result_large_err)]
#[expect(clippy::result_large_err)]
pub(super) fn new(
common_device: PciCommonDevice,
) -> Result<Self, (BusProbeError, PciCommonDevice)> {

View File

@ -73,7 +73,7 @@ pub struct VirtioPciLegacyTransport {
impl VirtioPciLegacyTransport {
pub const QUEUE_ALIGN_SIZE: usize = 4096;
#[allow(clippy::result_large_err)]
#[expect(clippy::result_large_err)]
pub(super) fn new(
common_device: PciCommonDevice,
) -> Result<Self, (BusProbeError, PciCommonDevice)> {