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

@ -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};

View File

@ -12,7 +12,7 @@ use crate::{current_userspace, net::socket::SocketAddr, prelude::*};
/// See <https://elixir.bootlin.com/linux/v6.0.9/source/include/linux/socket.h>.
#[repr(i32)]
#[derive(Debug, Clone, Copy, TryFromInt, PartialEq, Eq)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub enum CSocketAddrFamily {
AF_UNSPEC = 0,
/// Unix domain sockets

View File

@ -141,7 +141,7 @@ pub fn new_raw_socket_option(
/// Sock Opt level. The definition is from https://elixir.bootlin.com/linux/v6.0.9/source/include/linux/socket.h#L343
#[repr(i32)]
#[derive(Debug, Clone, Copy, TryFromInt, PartialEq, Eq)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub enum CSocketOptionLevel {
SOL_IP = 0,
SOL_SOCKET = 1,

View File

@ -14,8 +14,8 @@ use crate::{
/// The definition is from https://elixir.bootlin.com/linux/v6.0.9/source/include/uapi/asm-generic/socket.h.
#[repr(i32)]
#[derive(Debug, Clone, Copy, TryFromInt, PartialEq, Eq, PartialOrd, Ord)]
#[allow(non_camel_case_types)]
#[allow(clippy::upper_case_acronyms)]
#[expect(non_camel_case_types)]
#[expect(clippy::upper_case_acronyms)]
enum CSocketOptionName {
DEBUG = 1,
REUSEADDR = 2,

View File

@ -13,8 +13,8 @@ use crate::{
/// The raw definition is from https://elixir.bootlin.com/linux/v6.0.9/source/include/uapi/linux/tcp.h#L92
#[repr(i32)]
#[derive(Debug, Clone, Copy, TryFromInt)]
#[allow(non_camel_case_types)]
#[allow(clippy::upper_case_acronyms)]
#[expect(non_camel_case_types)]
#[expect(clippy::upper_case_acronyms)]
pub enum CTcpOptionName {
NODELAY = 1, /* Turn off Nagle's algorithm. */
MAXSEG = 2, /* Limit MSS */

View File

@ -11,7 +11,7 @@ use crate::{
/// From https://elixir.bootlin.com/linux/v6.0.9/source/include/uapi/linux/in.h.
#[repr(i32)]
#[derive(Debug, Clone, Copy, TryFromInt)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
pub enum Protocol {
IPPROTO_IP = 0, /* Dummy protocol for TCP */
IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
@ -44,7 +44,7 @@ pub enum Protocol {
/// Socket types.
/// From https://elixir.bootlin.com/linux/v6.0.9/source/include/linux/net.h
#[repr(i32)]
#[allow(non_camel_case_types)]
#[expect(non_camel_case_types)]
#[derive(Debug, Clone, Copy, TryFromInt)]
pub enum SockType {
/// Stream socket

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
use rand::{rngs::StdRng, Error as RandError, RngCore};
use spin::Once;

View File

@ -224,7 +224,7 @@ impl RingBuffer<u8> {
/// Writes data from the `reader` to the `RingBuffer`.
///
/// Returns the number of bytes written.
#[allow(unused)]
#[expect(unused)]
pub fn write_fallible(&mut self, reader: &mut dyn MultiRead) -> Result<usize> {
let mut producer = Producer {
rb: 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)]
//! The Virtual Dynamic Shared Object (VDSO) module enables user space applications to access kernel space routines
//! without the need for context switching. This is particularly useful for frequently invoked operations such as

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
#![expect(dead_code)]
#![expect(unused_variables)]
//! Virtual Memory Objects (VMOs).

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
#![expect(unused_variables)]
//! Options for allocating root and child VMOs.