Allow dead_code and unused_variables at file level

This commit is contained in:
Ruihan Li
2024-06-04 02:34:33 +08:00
committed by Tate, Hongliang Tian
parent 232e62b053
commit 9107a1771e
139 changed files with 305 additions and 0 deletions

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::*;
use crate::{events::IoEvents, fs::inode_handle::FileIo, prelude::*, process::signal::Poller};

View File

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

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
pub use aster_frame::arch::console;
use aster_frame::mm::VmReader;
use spin::Once;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use alloc::format;
use aster_frame::trap::{disable_local, in_interrupt_context};

View File

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

View File

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

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::*;
use crate::{events::IoEvents, fs::inode_handle::FileIo, prelude::*, process::signal::Poller};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
/// Error number.
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::Events;
/// An observer for events.

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::time::Duration;
use aster_util::slot_vec::SlotVec;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use super::*;
use crate::{events::IoEvents, fs::inode_handle::FileIo, process::signal::Poller};

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use super::*;
use crate::{
device::PtySlave, events::IoEvents, fs::inode_handle::FileIo, process::signal::Poller,

View File

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

View File

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

View File

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

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use core::ops::Range;
use aster_frame::mm::VmIo;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use core::{num::NonZeroUsize, ops::Range, sync::atomic::AtomicU64};
use aster_block::{bio::BioWaiter, id::BlockId, BlockDevice};

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use alloc::string::String;
use core::{cmp::Ordering, time::Duration};

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use bitvec::prelude::BitVec;
/// A blocks hole descriptor implemented by the `BitVec`.

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::{
inode::{FileType, MAX_FNAME_LEN},
prelude::*,

View File

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

View File

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

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use inherit_methods_macro::inherit_methods;
use super::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
//! Opend File Handle
use crate::{

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
//! Opend Inode-backed File Handle
mod dyn_cap;

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::{
file_handle::FileLike,
utils::{AccessMode, Consumer, InodeMode, InodeType, Metadata, Producer, StatusFlags},

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::{
dir::{DirOps, ProcDir},
file::{FileOps, ProcFile},

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::time::Duration;
use aster_util::slot_vec::SlotVec;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::sync::atomic::{AtomicBool, AtomicU32, Ordering};
use aster_rights::{Read, ReadOp, TRights, Write, WriteOp};

View File

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

View File

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

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::{Iface, IpAddress, IpEndpoint};
use crate::{events::Observer, prelude::*};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use smoltcp::{
iface::{Config, Routes},
phy::{Loopback, Medium},

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use aster_network::AnyNetworkDevice;
use aster_virtio::device::network::DEVICE_NAME;
use smoltcp::{

View File

@ -1,4 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use smoltcp::socket::udp::{RecvError, SendError};
use crate::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::sync::atomic::{AtomicBool, Ordering};
use takeable::Takeable;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use alloc::sync::Weak;
use smoltcp::socket::tcp::{RecvError, SendError};

View File

@ -1,4 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use smoltcp::socket::tcp::ListenError;
use super::connected::ConnectedStream;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::sync::atomic::{AtomicBool, Ordering};
use connected::ConnectedStream;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use self::options::SocketOption;
pub use self::util::{
options::LingerOption, send_recv_flags::SendRecvFlags, shutdown_cmd::SockShutdownCmd,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::endpoint::Endpoint;
use crate::{
events::IoEvents,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use crate::{
events::IoEvents,
fs::utils::{Channel, Consumer, Producer, StatusFlags},

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::sync::atomic::{AtomicBool, Ordering};
use super::{connected::Connected, endpoint::Endpoint, listener::push_incoming};

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use super::{
connected::Connected,
endpoint::Endpoint,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::time::Duration;
use crate::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use core::sync::atomic::Ordering;
use aster_frame::{

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use aster_frame::sync::{RwLockReadGuard, RwLockWriteGuard};
use aster_rights::{Dup, Read, TRights, Write};
use aster_rights_proc::require;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use aster_frame::user::UserSpace;
use super::PosixThread;

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use aster_rights::{ReadOp, WriteOp};
use futex::futex_wake;
use robust_list::wake_robust_futex;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::{Pid, Process};
use crate::{
fs::{file_table::FileTable, fs_resolver::FsResolver, utils::FileCreationMask},

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use crate::{
prelude::*,
process::{

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! A global table stores the pid to process mapping.
//! This table can be used to get process with pid.
//! TODO: progress group, thread all need similar mapping

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! The init stack for the process.
//! The init stack is used to store the `argv` and `envp` and auxiliary vectors.
//! We can read `argv` and `envp` of a process from the init stack.

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
//! 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,6 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(non_camel_case_types)]
use core::mem::{self, size_of};
use aster_frame::cpu::GeneralRegs;

View File

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

View File

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

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! The process status
use super::TermStatus;

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::{process_filter::ProcessFilter, ExitCode, Pid, Process};
use crate::{prelude::*, process::process_table, thread::thread_table};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use aster_frame::cpu::UserContext;
use super::SyscallReturn;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::marker::PhantomData;
use super::SyscallReturn;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
//! This mod defines mmap flags and the handler to syscall mmap
use align_ext::AlignExt;

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use super::SyscallReturn;
use crate::{prelude::*, process::posix_thread::PosixThreadExt, util::write_val_to_user};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
use aster_frame::mm::VmIo;
use super::SyscallReturn;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::time::Duration;
use super::{

View File

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

View File

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

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::SyscallReturn;
use crate::{fs::file_table::FileDesc, prelude::*, util::read_bytes_from_user};

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use super::SyscallReturn;
use crate::{
fs::file_table::FileDesc,

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use alloc::{boxed::Box, sync::Arc};
use core::{
cell::RefCell,

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use aster_frame::cpu::CpuSet;
use spin::Once;
use work_item::WorkItem;

View File

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

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use aster_frame::{cpu::CpuSet, task::Priority};
use super::worker_pool::WorkerPool;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
use core::sync::atomic::{AtomicBool, Ordering};
use aster_frame::{cpu::CpuSet, sync::WaitQueue, task::Priority};

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use crate::{
net::{
iface::Ipv4Address,

View File

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

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(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
//! obtaining the current time, which can be more efficiently handled within the user space.

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
//! Virtual Memory Address Regions (VMARs).
mod dyn_cap;

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
use core::ops::Range;
use aster_frame::mm::{Frame, FrameVec, PageFlags, VmIo, VmMapOptions, VmSpace};

View File

@ -1,5 +1,8 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(dead_code)]
#![allow(unused_variables)]
//! Virtual Memory Objects (VMOs).
use core::ops::Range;

View File

@ -1,5 +1,7 @@
// SPDX-License-Identifier: MPL-2.0
#![allow(unused_variables)]
//! Options for allocating root and child VMOs.
use core::{marker::PhantomData, ops::Range};