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)> {

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
mod common;
#[allow(clippy::module_inception)]
#[expect(clippy::module_inception)]
mod iface;
mod phy;
mod poll;

View File

@ -70,14 +70,14 @@ pub fn expand_require(item: RequireItem, mut require_attr: RequireAttr) -> Token
RequireItem::Impl(item_impl) => {
let new_item_impl = require_attr.fold_item_impl(item_impl);
quote!(
#[allow(clippy::multiple_bound_locations)]
#[expect(clippy::multiple_bound_locations)]
#new_item_impl
)
}
RequireItem::Fn(item_fn) => {
let new_item_fn = require_attr.fold_item_fn(item_fn);
quote!(
#[allow(clippy::multiple_bound_locations)]
#[expect(clippy::multiple_bound_locations)]
#new_item_fn
)
}

View File

@ -80,7 +80,7 @@ impl rustc_driver::Callbacks for DefaultCallbacks {}
struct ComponentCallbacks;
impl rustc_driver::Callbacks for ComponentCallbacks {
// JUSTIFICATION: necessary to set `mir_opt_level`
#[allow(rustc::bad_opt_access)]
#[expect(rustc::bad_opt_access)]
fn config(&mut self, config: &mut interface::Config) {
let conf_path = analysis::lookup_conf_file();
let conf_path_string = if let Ok(Some(path)) = &conf_path {
@ -179,7 +179,7 @@ fn report_ice(info: &panic::PanicInfo<'_>) {
interface::try_print_query_stack(&handler, num_frames);
}
#[allow(clippy::too_many_lines)]
#[expect(clippy::too_many_lines)]
pub fn main() {
rustc_driver::init_rustc_env_logger();
LazyLock::force(&ICE_HOOK);

View File

@ -1,7 +1,7 @@
// Licensed under the Apache License, Version 2.0 or the MIT License.
// Copyright (C) 2023-2024 Ant Group.
#![allow(unused)]
#![expect(unused)]
use std::path::PathBuf;
use std::process::Command;

View File

@ -248,7 +248,7 @@ impl<T> KeyableWeak<T> {
/// Constructs a new `KeyableWeak<T>`, without allocating any memory.
/// Calling `upgrade` on the return value always gives `None`.
#[inline]
#[allow(clippy::new_without_default)]
#[expect(clippy::new_without_default)]
pub fn new() -> Self {
Self(Weak::new())
}

View File

@ -17,7 +17,7 @@ pub trait Set {}
pub struct Cons<T, S: Set>(PhantomData<(T, S)>);
impl<T, S: Set> Cons<T, S> {
#[allow(clippy::new_without_default)]
#[expect(clippy::new_without_default)]
pub fn new() -> Self {
Cons(PhantomData)
}

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use super::*;
use crate::{

View File

@ -10,7 +10,7 @@ use crate::{
prelude::*,
};
#[allow(clippy::module_inception)]
#[expect(clippy::module_inception)]
mod pty;
pub use pty::{PtyMaster, PtySlave};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use crate::{
events::IoEvents,

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use crate::{
events::IoEvents,

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use ostd::mm::{Infallible, VmReader};
use spin::Once;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use alloc::format;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use ostd::early_print;
use spin::Once;

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(non_camel_case_types)]
#![expect(dead_code)]
#![expect(non_camel_case_types)]
use crate::prelude::*;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use crate::{
events::IoEvents,

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use super::*;
use crate::{

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
/// Error number.
#[repr(i32)]

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#[allow(clippy::module_inception)]
#[expect(clippy::module_inception)]
mod events;
mod io_events;
mod observer;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use super::Events;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use core::time::Duration;

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
#![expect(dead_code)]
#![expect(unused_variables)]
use super::*;
use crate::{

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
#![expect(dead_code)]
#![expect(unused_variables)]
use super::*;
use crate::{

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
#![expect(dead_code)]
#![expect(unused_variables)]
use core::ops::Range;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
pub(super) const ROOT_INODE_HASH: usize = 0;
// Other pub(super) constants

View File

@ -55,24 +55,24 @@ impl ExfatDentry {
const EXFAT_UNUSED: u8 = 0x00;
#[allow(dead_code)]
#[expect(dead_code)]
const EXFAT_INVAL: u8 = 0x80;
const EXFAT_BITMAP: u8 = 0x81;
const EXFAT_UPCASE: u8 = 0x82;
#[allow(dead_code)]
#[expect(dead_code)]
const EXFAT_VOLUME: u8 = 0x83;
const EXFAT_FILE: u8 = 0x85;
#[allow(dead_code)]
#[expect(dead_code)]
const EXFAT_GUID: u8 = 0xA0;
#[allow(dead_code)]
#[expect(dead_code)]
const EXFAT_PADDING: u8 = 0xA1;
#[allow(dead_code)]
#[expect(dead_code)]
const EXFAT_ACLTAB: u8 = 0xA2;
const EXFAT_STREAM: u8 = 0xC0;
const EXFAT_NAME: u8 = 0xC1;
#[allow(dead_code)]
#[expect(dead_code)]
const EXFAT_ACL: u8 = 0xC2;
const EXFAT_VENDOR_EXT: u8 = 0xE0;
@ -204,7 +204,7 @@ impl ExfatDentrySet {
/// Stream dentry index.
const ES_IDX_STREAM: usize = 1;
/// Name dentry index.
#[allow(dead_code)]
#[expect(dead_code)]
const ES_IDX_FIRST_FILENAME: usize = 2;
pub(super) fn new(dentries: Vec<ExfatDentry>, should_checksum_match: bool) -> Result<Self> {

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
#![expect(dead_code)]
#![expect(unused_variables)]
use core::{num::NonZeroUsize, ops::Range, sync::atomic::AtomicU64};

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
#![expect(dead_code)]
#![expect(unused_variables)]
use alloc::string::String;
use core::{cmp::Ordering, time::Duration};
@ -491,7 +491,7 @@ impl ExfatInodeInner {
};
// FIXME: This isn't expected by the compiler.
#[allow(non_local_definitions)]
#[expect(non_local_definitions)]
impl DirentVisitor for Vec<(String, usize)> {
fn visit(
&mut self,
@ -1011,7 +1011,7 @@ impl ExfatInode {
let sub_dir = inner.num_sub_inodes;
let mut child_offsets: Vec<usize> = vec![];
// FIXME: This isn't expected by the compiler.
#[allow(non_local_definitions)]
#[expect(non_local_definitions)]
impl DirentVisitor for Vec<usize> {
fn visit(
&mut self,

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
#![expect(dead_code)]
#![expect(unused_variables)]
use align_ext::AlignExt;
use aster_rights::Full;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use super::{
block_group::{BlockGroup, RawGroupDescriptor},

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use core::time::Duration;

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
#![expect(dead_code)]
#![expect(unused_variables)]
use alloc::{borrow::ToOwned, rc::Rc};
use core::sync::atomic::{AtomicUsize, Ordering};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
//! Opened File Handle

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use core::sync::atomic::{AtomicU8, Ordering};

View File

@ -195,7 +195,7 @@ impl FsResolver {
/// If `follow_tail_link` is true and the trailing component is a symlink,
/// it will be followed.
/// Symlinks in earlier components of the path will always be followed.
#[allow(clippy::redundant_closure)]
#[expect(clippy::redundant_closure)]
fn lookup_from_parent(
&self,
parent: &Dentry,

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
//! Opened Inode-backed File Handle

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
#![expect(dead_code)]
#![expect(unused_variables)]
use core::{
sync::atomic::{AtomicU32, Ordering},

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use super::{
dir::{DirOps, ProcDir},
@ -166,7 +166,7 @@ impl OptionalBuilder {
self
}
#[allow(clippy::type_complexity)]
#[expect(clippy::type_complexity)]
pub fn build(
self,
) -> Result<(

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use core::time::Duration;

View File

@ -4,7 +4,7 @@ use aster_rights::Rights;
use crate::prelude::*;
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
#[derive(Clone, Copy, Debug)]
#[repr(u8)]
pub enum AccessMode {

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use super::InodeType;
use crate::prelude::*;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use core::{any::TypeId, time::Duration};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use core::{
iter,

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use alloc::sync::Arc;

View File

@ -7,7 +7,7 @@ use crate::{
pub mod semaphore;
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub type key_t = i32;
bitflags! {
@ -25,7 +25,7 @@ bitflags! {
#[repr(i32)]
#[derive(Debug, Clone, Copy, TryFromInt)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub enum IpcControlCmd {
IPC_RMID = 0,
IPC_SET = 1,

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
//! The module to parse kernel command-line arguments.
//!

View File

@ -6,7 +6,7 @@
#![no_std]
#![no_main]
#![deny(unsafe_code)]
#![allow(incomplete_features)]
#![expect(incomplete_features)]
#![feature(btree_cursors)]
#![feature(btree_extract_if)]
#![feature(debug_closure_helpers)]

View File

@ -6,7 +6,7 @@ use crate::prelude::*;
/// From <https://elixir.bootlin.com/linux/v6.0.9/source/include/linux/net.h>
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, TryFromInt)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub enum SockShutdownCmd {
/// Shutdown receptions
SHUT_RD = 0,

View File

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

View File

@ -5,7 +5,7 @@ pub mod credentials;
mod exit;
mod kill;
pub mod posix_thread;
#[allow(clippy::module_inception)]
#[expect(clippy::module_inception)]
mod process;
mod process_filter;
pub mod process_table;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use ostd::{cpu::CpuSet, sync::RwArc, task::Task, user::UserSpace};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use intrusive_collections::{intrusive_adapter, LinkedList, LinkedListAtomicLink};
use ostd::{
@ -382,7 +382,7 @@ impl FutexKey {
// The implementation is from occlum
#[derive(PartialEq, Debug, Clone, Copy)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub enum FutexOp {
FUTEX_WAIT = 0,
FUTEX_WAKE = 1,

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use super::{Pid, Process};
use crate::{

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use ostd::sync::WaitQueue;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use super::{Pgid, Pid};
use crate::prelude::*;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
//! A global table stores the pid to process mapping.
//! This table can be used to get process with pid.

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use crate::prelude::*;
@ -14,7 +14,7 @@ use crate::prelude::*;
/// > about the environment in which it is operating. The form of this information
/// > is a table of key-value pairs, where the keys are from the set of AT_
/// > values in elf.h.
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
#[repr(u8)]
pub enum AuxKey {

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
//! The init stack for the process.
//! The init stack is used to store the `argv` and `envp` and auxiliary vectors.

View File

@ -165,23 +165,23 @@ impl ElfHeader {
pub struct HeaderPt2_64 {
pub type_: Type_,
pub machine: Machine_,
#[allow(dead_code)]
#[expect(dead_code)]
pub version: u32,
pub entry_point: u64,
pub ph_offset: u64,
#[allow(dead_code)]
#[expect(dead_code)]
pub sh_offset: u64,
#[allow(dead_code)]
#[expect(dead_code)]
pub flags: u32,
#[allow(dead_code)]
#[expect(dead_code)]
pub header_size: u16,
pub ph_entry_size: u16,
pub ph_count: u16,
#[allow(dead_code)]
#[expect(dead_code)]
pub sh_entry_size: u16,
#[allow(dead_code)]
#[expect(dead_code)]
pub sh_count: u16,
#[allow(dead_code)]
#[expect(dead_code)]
pub sh_str_index: u16,
}

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
//! This module is used to parse elf file content to get elf_load_info.
//! When create a process from elf file, we will use the elf_load_info to construct the VmSpace

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
// FIXME: The resource limits should be respected by the corresponding subsystems of the kernel.
#![allow(non_camel_case_types)]
#![expect(non_camel_case_types)]
use super::process_vm::{INIT_STACK_SIZE, USER_HEAP_SIZE_LIMIT};
use crate::prelude::*;

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(non_camel_case_types)]
#![expect(dead_code)]
#![expect(non_camel_case_types)]
use core::mem::{self, size_of};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
/// Standard signals
pub(super) const MIN_STD_SIG_NUM: u8 = 1;

View File

@ -135,7 +135,7 @@ pub fn handle_pending_signal(
}
}
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn handle_user_signal(
ctx: &Context,
sig_num: SigNum,

View File

@ -84,7 +84,7 @@ impl<T: Into<SigSet>> ops::BitOrAssign<T> for SigSet {
}
}
#[allow(clippy::suspicious_arithmetic_impl)]
#[expect(clippy::suspicious_arithmetic_impl)]
impl<T: Into<SigSet>> ops::Add<T> for SigSet {
type Output = Self;
@ -95,7 +95,7 @@ impl<T: Into<SigSet>> ops::Add<T> for SigSet {
}
}
#[allow(clippy::suspicious_op_assign_impl)]
#[expect(clippy::suspicious_op_assign_impl)]
impl<T: Into<SigSet>> ops::AddAssign<T> for SigSet {
fn add_assign(&mut self, rhs: T) {
self.bits |= rhs.into().bits;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use core::sync::atomic::{AtomicU8, Ordering};

View File

@ -25,7 +25,7 @@ bitflags! {
}
#[repr(u8)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
pub enum SigStackStatus {
#[default]

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use super::Signal;
use crate::process::{

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
#![expect(dead_code)]
#![expect(unused_variables)]
use alloc::sync::Arc;
use core::time::Duration;

View File

@ -2,5 +2,5 @@
mod condvar;
#[allow(unused_imports)]
#[expect(unused_imports)]
pub use self::condvar::{Condvar, LockErr};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use super::{process_filter::ProcessFilter, signal::constants::SIGCHLD, ExitCode, Pid, Process};
use crate::{

View File

@ -165,7 +165,7 @@ impl Ord for FairQueueItem {
/// ensure the efficiency for finding next-to-run threads.
#[derive(Debug)]
pub(super) struct FairClassRq {
#[allow(unused)]
#[expect(unused)]
cpu: CpuId,
/// The ready-to-run threads.
entities: BinaryHeap<Reverse<FairQueueItem>>,

View File

@ -38,7 +38,7 @@ use crate::thread::{AsThread, Thread};
type SchedEntity = (Arc<Task>, Arc<Thread>);
#[allow(unused)]
#[expect(unused)]
pub fn init() {
inject_scheduler(Box::leak(Box::new(ClassScheduler::new())));
}

View File

@ -135,7 +135,7 @@ impl PrioArray {
/// is empty, the 2 arrays are swapped by `index`.
#[derive(Debug)]
pub(super) struct RealTimeClassRq {
#[allow(unused)]
#[expect(unused)]
cpu: CpuId,
index: bool,
array: [PrioArray; 2],

View File

@ -5,7 +5,7 @@ use ostd::cpu::UserContext;
use super::SyscallReturn;
use crate::prelude::*;
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
#[repr(u64)]
#[derive(Debug, TryFromInt)]
pub enum ArchPrctlCode {

View File

@ -39,7 +39,7 @@ pub fn sys_clock_gettime(
// The hard-coded clock IDs.
#[derive(Debug, Copy, Clone, TryFromInt, PartialEq)]
#[repr(i32)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub enum ClockId {
CLOCK_REALTIME = 0,
CLOCK_MONOTONIC = 1,
@ -68,7 +68,7 @@ pub enum ClockId {
pub enum DynamicClockIdInfo {
Pid(u32, DynamicClockType),
Tid(u32, DynamicClockType),
#[allow(dead_code)]
#[expect(dead_code)]
Fd(u32),
}

View File

@ -161,7 +161,7 @@ fn handle_setown(fd: FileDesc, arg: u64, ctx: &Context) -> Result<SyscallReturn>
#[repr(i32)]
#[derive(Debug, Clone, Copy, TryFromInt)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
enum FcntlCmd {
F_DUPFD = 0,
F_GETFD = 1,
@ -176,10 +176,10 @@ enum FcntlCmd {
F_DUPFD_CLOEXEC = 1030,
}
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub type off_t = i64;
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
#[derive(Debug, Copy, Clone, TryFromInt)]
#[repr(u16)]
pub enum RangeLockWhence {

View File

@ -229,11 +229,11 @@ impl DirentSerializer for Dirent64 {
}
}
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
#[repr(u8)]
#[derive(Debug, Clone, Copy)]
enum DirentType {
#[allow(dead_code)]
#[expect(dead_code)]
DT_UNKNOWN = 0,
DT_FIFO = 1,
DT_CHR = 2,
@ -242,7 +242,7 @@ enum DirentType {
DT_REG = 8,
DT_LNK = 10,
DT_SOCK = 12,
#[allow(dead_code)]
#[expect(dead_code)]
DT_WHT = 14,
}

View File

@ -60,7 +60,7 @@ fn madv_free(start: Vaddr, end: Vaddr, ctx: &Context) -> Result<()> {
#[repr(i32)]
#[derive(Debug, Clone, Copy, TryFromInt)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
/// This definition is the same from linux
pub enum MadviseBehavior {
MADV_NORMAL = 0, /* no further special treatment */

View File

@ -96,7 +96,7 @@ const PR_GET_NAME: i32 = 16;
const PR_SET_TIMERSLACK: i32 = 29;
const PR_GET_TIMERSLACK: i32 = 30;
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
#[derive(Debug, Clone, Copy)]
pub enum PrctlCmd {
PR_SET_PDEATHSIG(SigNum),
@ -105,9 +105,9 @@ pub enum PrctlCmd {
PR_GET_NAME(Vaddr),
PR_GET_KEEPCAPS,
PR_SET_KEEPCAPS(u32),
#[allow(dead_code)]
#[expect(dead_code)]
PR_SET_TIMERSLACK(u64),
#[allow(dead_code)]
#[expect(dead_code)]
PR_GET_TIMERSLACK,
PR_SET_DUMPABLE(Dumpable),
PR_GET_DUMPABLE,

View File

@ -219,7 +219,7 @@ impl FdSet {
}
/// Equivalent to FD_CLR.
#[allow(unused)]
#[expect(unused)]
pub fn unset(&mut self, fd: FileDesc) -> Result<()> {
let fd = fd as usize;
if fd >= FD_SETSIZE {

View File

@ -126,7 +126,7 @@ impl PriorityTarget {
}
}
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
#[derive(Clone, Debug, TryFromInt)]
#[repr(i32)]
enum Which {

View File

@ -11,7 +11,7 @@ use crate::{
/// `ItimerType` is used to differ the target timer for some timer-related syscalls.
#[derive(Debug, Copy, Clone, TryFromInt, PartialEq)]
#[repr(i32)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub(super) enum ItimerType {
ITIMER_REAL = 0,
ITIMER_VIRTUAL = 1,

View File

@ -126,6 +126,6 @@ impl From<SigStack> for stack_t {
}
}
#[allow(unused)]
#[expect(unused)]
const SIGSTKSZ: usize = 8192;
const MINSTKSZ: usize = 2048;

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use aster_rights::Full;
use ostd::{cpu::*, mm::VmSpace};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
//! Work queue mechanism.
//!

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use core::sync::atomic::{AtomicBool, Ordering};

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use ostd::{
cpu::{CpuId, CpuSet},

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![expect(dead_code)]
use core::{
sync::atomic::{AtomicBool, Ordering},

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(non_camel_case_types)]
#![expect(non_camel_case_types)]
pub use core::{timer, Clock};

Some files were not shown because too many files have changed in this diff Show More