diff --git a/oro-acpi/src/lib.rs b/oro-acpi/src/lib.rs index 62b4f5a4..7622452f 100644 --- a/oro-acpi/src/lib.rs +++ b/oro-acpi/src/lib.rs @@ -101,7 +101,7 @@ impl Rsdp

{ } // SAFETY(qix-): Uses unstable feature `trivial_bounds`. -#[allow(trivial_bounds)] +#[expect(trivial_bounds)] impl core::fmt::Debug for Rsdp

where sys::acpi_table_rsdp: core::fmt::Debug, @@ -317,7 +317,7 @@ macro_rules! impl_tables { } // SAFETY(qix-): Uses unstable feature `trivial_bounds`. - #[allow(trivial_bounds)] + #[expect(trivial_bounds)] impl core::fmt::Debug for $ident

where $systbl_ident: core::fmt::Debug { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.ptr.fmt(f) @@ -366,7 +366,7 @@ pub trait FromLe64 { // TODO(qix-): the numbers common lib will probably have better names for this. // TODO(qix-): When this is copied over, remove the `#[allow(clippy::wrong_self_convention)]` // TODO(qix-): and let's find a better name. - #[allow(clippy::wrong_self_convention)] + #[expect(clippy::wrong_self_convention)] fn from_le_64(self) -> u64; } diff --git a/oro-acpi/src/madt.rs b/oro-acpi/src/madt.rs index aadc5b86..a8d097d4 100644 --- a/oro-acpi/src/madt.rs +++ b/oro-acpi/src/madt.rs @@ -80,12 +80,12 @@ impl<'a> Iterator for MadtIterator<'a> { } } -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] macro_rules! madt_entries { ($($(#[$meta:meta])* $name:tt = $tyid:literal),* $(,)?) => { paste! { /// Represents an entry in the MADT table. - #[allow(missing_docs)] + #[expect(missing_docs)] #[non_exhaustive] pub enum MadtEntry<'a> { $( @@ -116,7 +116,6 @@ macro_rules! madt_entries { } /// A union of all APIC types. Used by the [`MadtIterator`]. - #[allow(missing_docs)] #[repr(C)] union MadtData { header: ManuallyDrop, diff --git a/oro-acpica-sys/build.rs b/oro-acpica-sys/build.rs index de41edbb..c721fa47 100644 --- a/oro-acpica-sys/build.rs +++ b/oro-acpica-sys/build.rs @@ -1,7 +1,6 @@ use ::convert_case::{Case, Casing}; use ::quote::ToTokens; -#[allow(clippy::missing_docs_in_private_items)] fn main() { let out_dir = std::env::var("OUT_DIR").unwrap(); let dest_path = std::path::Path::new(&out_dir).join("bindings.rs"); diff --git a/oro-arch-aarch64/src/boot/memory.rs b/oro-arch-aarch64/src/boot/memory.rs index 1e791ecd..0b9baeb5 100644 --- a/oro-arch-aarch64/src/boot/memory.rs +++ b/oro-arch-aarch64/src/boot/memory.rs @@ -38,7 +38,7 @@ pub struct PreparedMemory { /// once during boot. pub unsafe fn prepare_memory() -> PreparedMemory { // First, let's make sure the recurisive page table is set up correctly. - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const RIDX: usize = AddressSpaceLayout::RECURSIVE_ENTRY_IDX.0; // SAFETY(qix-): We load TTBR1 which is always safe, and then do a // SAFETY(qix-): safe instruction to ask the CPU to resolve the virtual address @@ -144,7 +144,7 @@ unsafe fn linear_map_regions<'a>( regions: MemoryMapIterator<'a>, ) -> Option { // Get the virtual address of the linear map base. - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const LINEAR_MAP_IDX: (usize, usize) = AddressSpaceLayout::LINEAR_MAP_IDX; let linear_map_base = 0xFFFF_0000_0000_0000 | (LINEAR_MAP_IDX.0 << 39) as u64; let linear_map_last_incl = !(511 << 39) | (LINEAR_MAP_IDX.1 << 39) as u64; @@ -207,7 +207,7 @@ unsafe fn linear_map_regions<'a>( continue; } - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const RIDX: usize = crate::mem::address_space::AddressSpaceLayout::RECURSIVE_ENTRY_IDX.0; let mut total_mappings = 0; @@ -415,7 +415,6 @@ impl<'a> MemoryMapPfa<'a> { /// Consumes this iterator and returns the remaining /// entry and usable memory regions iterator. - #[allow(dead_code)] // XXX(qix-): temporary #[must_use] fn into_inner(self) -> (MemoryMapEntry, MemoryMapIterator<'a>) { (self.current_entry, self.iterator) @@ -564,9 +563,9 @@ impl OnTheFlyMapper { // Assuming the recursive map exists (it does if we're here), // we can calculate the virtual address of the L1 page table // for the OTF region. - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const RIDX: usize = crate::mem::address_space::AddressSpaceLayout::RECURSIVE_ENTRY_IDX.0; - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const OTF_IDX: usize = crate::mem::address_space::AddressSpaceLayout::BOOT_RESERVED_IDX; debug_assert!(OTF_IDX < 512, "OTF_IDX is out of bounds"); diff --git a/oro-arch-aarch64/src/boot/secondary.rs b/oro-arch-aarch64/src/boot/secondary.rs index 6eee7a8d..02073be1 100644 --- a/oro-arch-aarch64/src/boot/secondary.rs +++ b/oro-arch-aarch64/src/boot/secondary.rs @@ -48,7 +48,7 @@ pub unsafe fn boot_secondaries( // Get the PSCI method. let mut psci_method: Option = None; for tkn in dtb.iter().filter_path(&[c"", c"psci"]) { - #[allow(clippy::redundant_guards)] // False positive + #[expect(clippy::redundant_guards)] // False positive match tkn { FdtToken::Property { name, value } if name == c"method" => { let Ok(value) = CStr::from_bytes_with_nul(value) else { @@ -81,7 +81,7 @@ pub unsafe fn boot_secondaries( let mut cpu_id: u64 = 0; let mut valid: bool = false; for tkn in dtb.iter().filter_path(&[c"", c"cpus", c"cpu@"]) { - #[allow(clippy::redundant_guards)] // False positive + #[expect(clippy::redundant_guards)] // False positive match tkn { FdtToken::Node { name } => { is_cpu = true; @@ -338,7 +338,6 @@ unsafe fn boot_secondary( // Allocate the boot stubs (maximum 4096 bytes). let boot_phys = pfa.allocate().ok_or(SecondaryBootError::OutOfMemory)?; let boot_virt = pat.translate_mut::<[u8; 4096]>(boot_phys); - #[allow(clippy::missing_docs_in_private_items)] (&mut *boot_virt)[..SECONDARY_BOOT_STUB.len()].copy_from_slice(SECONDARY_BOOT_STUB); // Direct map the boot stubs into the lower page table. diff --git a/oro-arch-aarch64/src/mair.rs b/oro-arch-aarch64/src/mair.rs index 396df330..45c14e0c 100644 --- a/oro-arch-aarch64/src/mair.rs +++ b/oro-arch-aarch64/src/mair.rs @@ -43,7 +43,6 @@ impl MairEntry { let mut mair = MairRegister::new(); for entry in MairEntry::iter_all() { - #[allow(clippy::match_same_arms)] match entry { MairEntry::DeviceMMIO => { *mair[usize::from(entry.index())].device_mut() = MairDeviceAttribute::DnGnRnE; diff --git a/oro-arch-aarch64/src/mem/address_space.rs b/oro-arch-aarch64/src/mem/address_space.rs index 16f85870..a362024a 100644 --- a/oro-arch-aarch64/src/mem/address_space.rs +++ b/oro-arch-aarch64/src/mem/address_space.rs @@ -104,7 +104,7 @@ impl AddressSpaceLayout { /// Returns the segment descriptor for the kernel transfer stubs. #[must_use] pub fn stubs() -> ::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] static DESCRIPTOR: Segment = unsafe { Segment { valid_range: AddressSpaceLayout::STUBS_IDX, @@ -131,7 +131,7 @@ impl AddressSpaceLayout { /// Returns the segment descriptor for the kernel stack. #[must_use] pub fn kernel_stack() -> ::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] static DESCRIPTOR: Segment = unsafe { Segment { valid_range: ( @@ -254,7 +254,6 @@ unsafe impl AddressSpace for AddressSpaceLayout { // NOTE(qix-): Technically this isn't required since the kernel currently // NOTE(qix-): requires `TCR_EL1.TnSZ=16`, but it's cheap and not often // NOTE(qix-): called, so we'll just do it anyway. - #[allow(clippy::cast_possible_truncation)] let (tt1_start, _) = TcrEl1::load().tt1_range(); let base_phys = crate::asm::load_ttbr1(); @@ -300,7 +299,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_code() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] static DESCRIPTOR: Segment = unsafe { Segment { valid_range: ( @@ -325,7 +324,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_data() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] static DESCRIPTOR: Segment = unsafe { Segment { valid_range: ( @@ -351,7 +350,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_rodata() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] static DESCRIPTOR: Segment = unsafe { Segment { valid_range: ( @@ -377,7 +376,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_stack() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] static DESCRIPTOR: Segment = unsafe { Segment { valid_range: ( @@ -403,7 +402,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_ring_registry() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] static DESCRIPTOR: Segment = unsafe { Segment { valid_range: ( @@ -441,7 +440,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_module_instance_registry() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] static DESCRIPTOR: Segment = unsafe { Segment { valid_range: ( @@ -479,7 +478,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_port_registry() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] static DESCRIPTOR: Segment = unsafe { Segment { valid_range: ( diff --git a/oro-arch-aarch64/src/mem/paging.rs b/oro-arch-aarch64/src/mem/paging.rs index d9e0855a..ba68c584 100644 --- a/oro-arch-aarch64/src/mem/paging.rs +++ b/oro-arch-aarch64/src/mem/paging.rs @@ -194,7 +194,7 @@ pub enum PageTableEntryTypeMut<'a> { #[repr(C, align(8))] pub struct PageTableEntry(u64); -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] const _: () = assert::size_of::(); macro_rules! impl_page_table_entry_type { @@ -272,7 +272,7 @@ macro_rules! impl_page_table_entry_type { impl PageTableEntry { /// Creates a new page table entry. - #[allow(clippy::new_without_default)] + #[expect(clippy::new_without_default)] #[inline(always)] #[must_use] pub const fn new() -> Self { @@ -439,7 +439,7 @@ macro_rules! descriptor_init_value { // FIXME(qix-): with the #[doc = ...] attribute on the subtype's // FIXME(qix-): ::new() function, the doc comment keeps getting // FIXME(qix-): indented whenever rustfmt runs. -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] macro_rules! descriptor_doc { ($doc:literal) => { concat!( @@ -509,9 +509,9 @@ macro_rules! define_descriptor { } // TODO(qix-) Add docs. Silencing for now as it's inflating compile times. - #[allow(missing_docs)] + #[expect(missing_docs)] impl $name { - #[allow(clippy::new_without_default)] + #[expect(clippy::new_without_default)] #[doc = descriptor_doc!($doc)] #[inline(always)] #[must_use] @@ -623,7 +623,7 @@ impl PageTableEntry { } } -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] macro_rules! impl_page_table_entry_valid_attr { ($($name:ty),*) => { $(impl $name { @@ -675,7 +675,7 @@ impl_page_table_entry_valid_attr!( L3PageTableBlockDescriptor ); -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] macro_rules! impl_page_table_entry_table_descriptor_attr { ($($name:ty),*) => { $(impl $name { @@ -720,7 +720,7 @@ impl_page_table_entry_table_descriptor_attr!( L2PageTableDescriptor ); -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] macro_rules! impl_page_table_entry_block_descriptor_attr { ($($name:ty),*) => { $(impl $name { @@ -966,7 +966,7 @@ impl_page_table_entry_block_descriptor_attr!( L3PageTableBlockDescriptor ); -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] macro_rules! impl_page_table_entry_address { ($($name:ty),*) => { $(impl $name { @@ -1021,7 +1021,7 @@ impl_page_table_entry_address!( L3PageTableBlockDescriptor ); -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] macro_rules! impl_page_table_entry_no_exec_attr { (user_offset = $user_off:literal, kernel_offset = $kernel_off:literal, $($name:ty),*) => { $(impl $name { @@ -1179,7 +1179,6 @@ impl Default for PageTableEntryTableAccessPerm { /// #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[repr(u64)] -#[allow(unused)] pub enum PageTableEntryShareability { /// Non-shareable None = 0b00 << 8, diff --git a/oro-arch-aarch64/src/mem/segment.rs b/oro-arch-aarch64/src/mem/segment.rs index fb8e5508..50e53e61 100644 --- a/oro-arch-aarch64/src/mem/segment.rs +++ b/oro-arch-aarch64/src/mem/segment.rs @@ -299,7 +299,7 @@ unsafe impl AddressSegment for &'static Segment { // SAFETY(qix-): We know that the value is a 48-bit virtual address and we're // SAFETY(qix-): munging the sign on purpose here. // TODO(qix-): Once attributes on expressions is stabilized, move this to the macro instead of here. - #[allow(clippy::cast_sign_loss, clippy::cast_possible_wrap)] + #[expect(clippy::cast_sign_loss, clippy::cast_possible_wrap)] fn range(&self) -> (usize, usize) { let start = sign_extend!(self.valid_range.0 << 39); // TODO(qix-): Assumes a 48-bit virtual address space for each TT; will need @@ -350,7 +350,7 @@ unsafe impl AddressSegment for &'static Segment { // SAFETY(qix-): We can guarantee this is an aligned virtual address // SAFETY(qix-): given that `self.entry()` would have errored with a non-aligned error. - #[allow(clippy::verbose_bit_mask)] + #[expect(clippy::verbose_bit_mask)] unsafe { // Sanity check the pre-condition that it's aligned. debug_assert!(virt & 0xFFF == 0); diff --git a/oro-arch-aarch64/src/psci.rs b/oro-arch-aarch64/src/psci.rs index d40f3d7f..e830d0f1 100644 --- a/oro-arch-aarch64/src/psci.rs +++ b/oro-arch-aarch64/src/psci.rs @@ -31,7 +31,7 @@ impl Error { /// Checks the given code and returns an `Err` if it matches /// one of the error codes. fn check32>(e: u32) -> Result { - #[allow(clippy::cast_possible_wrap)] + #[expect(clippy::cast_possible_wrap)] let i = e as i32; if i < 0 && i > -10 { Err(unsafe { core::mem::transmute::(i.into()) }) @@ -43,7 +43,7 @@ impl Error { /// Checks the given code and returns an `Err` if it matches /// one of the error codes. fn check64>(e: u64) -> Result { - #[allow(clippy::cast_possible_wrap)] + #[expect(clippy::cast_possible_wrap)] let i = e as i64; if i < 0 && i > -10 { Err(unsafe { core::mem::transmute::(i) }) diff --git a/oro-arch-aarch64/src/reg/mair.rs b/oro-arch-aarch64/src/reg/mair.rs index 3720d2ae..953533fa 100644 --- a/oro-arch-aarch64/src/reg/mair.rs +++ b/oro-arch-aarch64/src/reg/mair.rs @@ -39,7 +39,7 @@ impl MairRegister { pub unsafe fn get(self, index: usize) -> MairAttributes { debug_assert!(index < 8, "index must be 0..=7"); let shift = index * 8; - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] MairAttributes((self.0 >> shift) as u8) } @@ -123,7 +123,7 @@ impl fmt::Debug for MairRegister { // NOTE(qix-): I don't really want to encourage anyone convert back from a raw u64 // NOTE(qix-): to a `MairRegister` value as that's probably not very safe. -#[allow(clippy::from_over_into)] +#[expect(clippy::from_over_into)] impl Into for MairRegister { #[inline(always)] fn into(self) -> u64 { @@ -231,7 +231,6 @@ impl fmt::Debug for AttributesType { #[derive(Clone, Copy, PartialEq, Eq)] #[repr(u8)] #[non_exhaustive] -#[allow(clippy::upper_case_acronyms)] pub enum MairDeviceAttribute { /// Device non-Gathering, non-Reordering, No Early write acknowledgement. DnGnRnE = 0b0000, diff --git a/oro-arch-aarch64/src/reg/sctlr_el1.rs b/oro-arch-aarch64/src/reg/sctlr_el1.rs index 99695340..f7e6748e 100644 --- a/oro-arch-aarch64/src/reg/sctlr_el1.rs +++ b/oro-arch-aarch64/src/reg/sctlr_el1.rs @@ -152,7 +152,7 @@ impl SctlrEl1 { out(reg) sctlr_el1 ); // SAFETY(qix-): SCTLR_EL1 is a 32-bit register. Truncating the bits makes no difference. - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] Self(sctlr_el1 as u32) } } @@ -168,7 +168,7 @@ impl SctlrEl1 { } /// Creates a new `SCTLR_EL1` register with all fields set to `0`. - #[allow(clippy::new_without_default)] + #[expect(clippy::new_without_default)] #[must_use] pub const fn new() -> Self { Self(0) diff --git a/oro-arch-aarch64/src/reg/tcr_el1.rs b/oro-arch-aarch64/src/reg/tcr_el1.rs index e724bb89..40e84846 100644 --- a/oro-arch-aarch64/src/reg/tcr_el1.rs +++ b/oro-arch-aarch64/src/reg/tcr_el1.rs @@ -166,7 +166,7 @@ impl TcrEl1 { } /// Creates a new `TCR_EL1` register with all fields set to `0`. - #[allow(clippy::new_without_default)] + #[expect(clippy::new_without_default)] #[must_use] pub const fn new() -> Self { Self(0) @@ -301,7 +301,6 @@ pub enum Tg0GranuleSize { } /// Shareability attributes for the SH1 and SH0 fields of the `TCR_EL1` register. -#[allow(clippy::enum_variant_names)] #[derive(Debug, Clone, Copy, AsU64, PartialEq, Eq)] #[repr(u64)] pub enum Shareability { diff --git a/oro-arch-x86_64/src/boot/memory.rs b/oro-arch-x86_64/src/boot/memory.rs index f675330f..ca53683a 100644 --- a/oro-arch-x86_64/src/boot/memory.rs +++ b/oro-arch-x86_64/src/boot/memory.rs @@ -57,7 +57,7 @@ pub struct PreparedMemory { /// for the system to use. pub unsafe fn prepare_memory() -> PreparedMemory { // First, let's make sure the recursive entry is mapped. - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const RIDX: usize = crate::mem::address_space::AddressSpaceLayout::RECURSIVE_IDX; let cr3 = crate::asm::cr3(); let paging_level = PagingLevel::current_from_cpu(); @@ -222,7 +222,7 @@ unsafe fn linear_map_regions<'a>( ) -> Option { let paging_level = PagingLevel::current_from_cpu(); - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] macro_rules! extend { ($virt:expr) => { match paging_level { @@ -311,7 +311,7 @@ unsafe fn linear_map_regions<'a>( continue; } - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const RIDX: usize = crate::mem::address_space::AddressSpaceLayout::RECURSIVE_IDX; let start_of_region = base_virt; @@ -549,7 +549,7 @@ impl OnTheFlyMapper { // Assuming the recursive map exists (it does if we're here), // we can calculate the virtual address of the L1 page table // for the OTF region. - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const RIDX: usize = crate::mem::address_space::AddressSpaceLayout::RECURSIVE_IDX; let paging_level = PagingLevel::current_from_cpu(); let levels = paging_level as usize; diff --git a/oro-arch-x86_64/src/boot/secondary.rs b/oro-arch-x86_64/src/boot/secondary.rs index 55d38adb..c7a8b1db 100644 --- a/oro-arch-x86_64/src/boot/secondary.rs +++ b/oro-arch-x86_64/src/boot/secondary.rs @@ -23,7 +23,7 @@ use oro_mem::{ const CR4_LA57: u32 = 1 << 12; /// The error type for booting a secondary core. -#[allow(dead_code)] +#[expect(dead_code)] #[derive(Debug)] pub enum BootError { /// The system is out of memory. @@ -45,7 +45,7 @@ pub enum BootError { /// and the page at physical address 0x9000 as the secondary core's L4 page table. /// /// Caller must ensure these pages are mapped (via the PAT) and accessible. -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] pub unsafe fn boot_secondary( primary_handle: &AddressSpaceHandle, pfa: &mut A, diff --git a/oro-arch-x86_64/src/gdt.rs b/oro-arch-x86_64/src/gdt.rs index be68c7b5..d3c8d4f3 100644 --- a/oro-arch-x86_64/src/gdt.rs +++ b/oro-arch-x86_64/src/gdt.rs @@ -108,7 +108,7 @@ impl GdtEntry { } /// A Data Privilege Level (DPL) for a descriptor. -#[allow(dead_code)] +#[expect(dead_code)] #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u8)] enum Dpl { @@ -157,7 +157,7 @@ pub fn install_gdt() { let base = GDT.as_ptr() as u64; let gdt_size = core::mem::size_of_val(&GDT); - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let limit = (gdt_size - 1) as u16; let gdt_descriptor = GdtDescriptor { limit, base }; diff --git a/oro-arch-x86_64/src/lapic.rs b/oro-arch-x86_64/src/lapic.rs index cf87f25c..5082ee4e 100644 --- a/oro-arch-x86_64/src/lapic.rs +++ b/oro-arch-x86_64/src/lapic.rs @@ -32,7 +32,7 @@ impl Lapic { #[must_use] pub fn version(&self) -> LapicVersion { // SAFETY(qix-): The LAPIC base address is trusted to be vali and aligned. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] let version32 = unsafe { self.base.add(0x30).cast::().read_volatile() }; LapicVersion { supports_eoi_broadcast_suppression: (version32 & (1 << 24)) != 0, @@ -45,7 +45,7 @@ impl Lapic { #[must_use] pub fn id(&self) -> u8 { // SAFETY(qix-): The LAPIC base address is trusted to be valid and aligned. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] let id32 = unsafe { self.base.add(0x20).cast::().read_volatile() }; (id32 >> 24) as u8 } @@ -53,7 +53,7 @@ impl Lapic { /// Sets the local APIC ID. pub fn set_id(&self, id: u8) { // SAFETY(qix-): The LAPIC base address is trusted to be valid and aligned. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] unsafe { let v = self.base.add(0x20).cast::().read_volatile(); let v = (v & 0x00FF_FFFF) | (u32::from(id) << 24); @@ -64,7 +64,7 @@ impl Lapic { /// Clears the errors in the local APIC. pub fn clear_errors(&self) { // SAFETY(qix-): The LAPIC base address is trusted to be valid and aligned. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] unsafe { self.base.add(0x280).cast::().write_volatile(0); } @@ -73,7 +73,7 @@ impl Lapic { /// Selects the secondary processor we want to interact with. pub fn set_target_apic(&self, apic_id: u8) { // SAFETY(qix-): The LAPIC base address is trusted to be valid and aligned. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] unsafe { let v = self.base.add(0x310).cast::().read_volatile(); let v = (v & 0x00FF_FFFF) | (u32::from(apic_id) << 24); @@ -85,7 +85,7 @@ impl Lapic { /// (selected via [`Self::set_target_apic()`]). pub fn send_init_ipi(&self) { // SAFETY(qix-): The LAPIC base address is trusted to be valid and aligned. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] unsafe { let v = self.base.add(0x300).cast::().read_volatile(); let v = (v & 0xFFF0_0000) | 0x00_C500; @@ -97,7 +97,7 @@ impl Lapic { /// Waits for the IPI to be acknowledged by the target processor. pub fn wait_for_ipi_ack(&self) { // SAFETY(qix-): The LAPIC base address is trusted to be valid and aligned. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] unsafe { while self.base.add(0x300).cast::().read_volatile() & 0x1000 != 0 { core::hint::spin_loop(); @@ -108,7 +108,7 @@ impl Lapic { /// Deasserts the INIT IPI. pub fn deassert_init_ipi(&self) { // SAFETY(qix-): The LAPIC base address is trusted to be valid and aligned. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] unsafe { let v = self.base.add(0x300).cast::().read_volatile(); let v = (v & 0xFFF0_0000) | 0x00_8500; @@ -120,7 +120,7 @@ impl Lapic { /// (selected via [`Self::set_target_apic()`]). pub fn send_startup_ipi(&self, cs_page: u8) { // SAFETY(qix-): The LAPIC base address is trusted to be valid and aligned. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] unsafe { let v = self.base.add(0x300).cast::().read_volatile(); let v = (v & 0xFFF0_F800) | 0x00_0600 | u32::from(cs_page); diff --git a/oro-arch-x86_64/src/mem/address_space.rs b/oro-arch-x86_64/src/mem/address_space.rs index 8b0efd3b..13b95dea 100644 --- a/oro-arch-x86_64/src/mem/address_space.rs +++ b/oro-arch-x86_64/src/mem/address_space.rs @@ -82,7 +82,7 @@ impl AddressSpaceLayout { /// Returns the linear map segment for the supervisor space. #[must_use] pub fn linear_map() -> &'static AddressSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const DESCRIPTOR: AddressSegment = AddressSegment { valid_range: AddressSpaceLayout::LINEAR_MAP_IDX, entry_template: PageTableEntry::new() @@ -112,7 +112,7 @@ impl AddressSpaceLayout { /// Returns a segment for the secondary core boot stub. #[must_use] pub fn secondary_boot_stub_code() -> &'static AddressSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const DESCRIPTOR: AddressSegment = AddressSegment { valid_range: ( AddressSpaceLayout::KERNEL_SECONDARY_BOOT_IDX, @@ -129,7 +129,7 @@ impl AddressSpaceLayout { /// mapping. #[must_use] pub fn secondary_boot_stub_stack() -> &'static AddressSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const DESCRIPTOR: AddressSegment = AddressSegment { valid_range: ( AddressSpaceLayout::KERNEL_SECONDARY_BOOT_IDX, @@ -212,7 +212,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_code() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const DESCRIPTOR: AddressSegment = AddressSegment { valid_range: ( AddressSpaceLayout::KERNEL_EXE_IDX, @@ -229,7 +229,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_data() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const DESCRIPTOR: AddressSegment = AddressSegment { valid_range: ( AddressSpaceLayout::KERNEL_EXE_IDX, @@ -247,7 +247,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_rodata() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const DESCRIPTOR: AddressSegment = AddressSegment { valid_range: ( AddressSpaceLayout::KERNEL_EXE_IDX, @@ -264,7 +264,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_stack() -> ::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const DESCRIPTOR: AddressSegment = AddressSegment { valid_range: ( AddressSpaceLayout::KERNEL_STACK_IDX, @@ -284,7 +284,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_ring_registry() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const DESCRIPTOR: AddressSegment = AddressSegment { valid_range: ( AddressSpaceLayout::KERNEL_RING_REGISTRY_IDX, @@ -305,7 +305,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_port_registry() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const DESCRIPTOR: AddressSegment = AddressSegment { valid_range: ( AddressSpaceLayout::KERNEL_PORT_REGISTRY_IDX, @@ -326,7 +326,7 @@ unsafe impl AddressSpace for AddressSpaceLayout { } fn kernel_module_instance_registry() -> Self::SupervisorSegment { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const DESCRIPTOR: AddressSegment = AddressSegment { valid_range: ( AddressSpaceLayout::KERNEL_MODULE_INSTANCE_REGISTRY_IDX, diff --git a/oro-arch-x86_64/src/mem/paging.rs b/oro-arch-x86_64/src/mem/paging.rs index 650d2f32..b89bafba 100644 --- a/oro-arch-x86_64/src/mem/paging.rs +++ b/oro-arch-x86_64/src/mem/paging.rs @@ -79,7 +79,7 @@ impl PageTable { #[repr(C, align(8))] pub struct PageTableEntry(u64); -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] const _: () = assert::size_of::(); impl fmt::Debug for PageTableEntry { @@ -121,7 +121,7 @@ impl PageTableEntry { } /// Creates a new `PageTableEntry` with all flags and attributes set to 0. - #[allow(clippy::new_without_default)] + #[expect(clippy::new_without_default)] #[inline] #[must_use] pub const fn new() -> Self { diff --git a/oro-arch-x86_64/src/mem/segment.rs b/oro-arch-x86_64/src/mem/segment.rs index 7ebbaa3d..0afe1080 100644 --- a/oro-arch-x86_64/src/mem/segment.rs +++ b/oro-arch-x86_64/src/mem/segment.rs @@ -15,14 +15,14 @@ use oro_mem::{ macro_rules! sign_extend { (L4, $value:expr) => { // SAFETY(qix-): We expect and want the sign loss here. - #[allow(clippy::cast_sign_loss, clippy::cast_possible_wrap)] + #[expect(clippy::cast_sign_loss, clippy::cast_possible_wrap)] { ((($value << 16) as isize) >> 16) as usize } }; (L5, $value:expr) => { // SAFETY(qix-): We expect and want the sign loss here. - #[allow(clippy::cast_sign_loss, clippy::cast_possible_wrap)] + #[expect(clippy::cast_sign_loss, clippy::cast_possible_wrap)] { ((($value << 7) as isize) >> 7) as usize } @@ -116,7 +116,7 @@ impl AddressSegment { .with_address(frame_phys_addr); crate::asm::invlpg(frame_virt_addr); - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] let pt = frame_virt_addr.cast::(); debug_assert!(pt.is_aligned()); pt @@ -392,11 +392,7 @@ impl AddressSegment { } unsafe impl Segment for &'static AddressSegment { - // SAFETY(qix-): We know and understand that the sign is being munged here; - // SAFETY(qix-): that's expected. We can safely ignore any clippy lints related to that. // TODO(qix-): Once const trait methods are stabilitized, make this const. - // TODO(qix-): Once attributes on expressions are stabilized, move this directly into the macro. - #[allow(clippy::cast_sign_loss, clippy::cast_possible_wrap)] fn range(&self) -> (usize, usize) { // Get the current paging level. match PagingLevel::current_from_cpu() { diff --git a/oro-arch-x86_64/src/reg.rs b/oro-arch-x86_64/src/reg.rs index f1c5a435..8df0a39e 100644 --- a/oro-arch-x86_64/src/reg.rs +++ b/oro-arch-x86_64/src/reg.rs @@ -6,7 +6,7 @@ use core::arch::asm; #[repr(transparent)] pub struct Cr0(u64); -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] macro_rules! field { ($name:ident, $shift:expr, $doc:literal) => { #[doc = $doc] @@ -70,7 +70,7 @@ impl Cr0 { ); /// Creates a new CR0 register with all bits cleared. - #[allow(clippy::new_without_default)] + #[expect(clippy::new_without_default)] #[must_use] pub const fn new() -> Self { Self(0) diff --git a/oro-boot-protocol/build.rs b/oro-boot-protocol/build.rs index ff492323..448eebad 100644 --- a/oro-boot-protocol/build.rs +++ b/oro-boot-protocol/build.rs @@ -14,7 +14,7 @@ macro_rules! warn { }; } -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] fn main() { println!("cargo::rustc-check-cfg=cfg(oro_build_protocol_header)"); println!("cargo::rerun-if-env-changed=ORO_BUILD_PROTOCOL_HEADER"); @@ -268,7 +268,7 @@ fn process_tags(items: &[syn::Item], w: &mut W) -> Result<()> { Ok(()) } -#[allow(clippy::too_many_lines)] +#[expect(clippy::too_many_lines)] fn process_mod(items: &[syn::Item], w: &mut W) -> Result<()> { // Collect them so we can sort them let mut items: Vec<_> = items.iter().collect(); diff --git a/oro-boot-protocol/src/macros.rs b/oro-boot-protocol/src/macros.rs index 01ade98b..e6128b86 100644 --- a/oro-boot-protocol/src/macros.rs +++ b/oro-boot-protocol/src/macros.rs @@ -10,7 +10,6 @@ pub(crate) trait Sealed {} /// Main Oro boot protocol definition macro. -#[allow(clippy::too_many_lines)] macro_rules! oro_boot_protocol { ( $( @@ -38,7 +37,7 @@ macro_rules! oro_boot_protocol { /// The tag revision. Provided by the Kernel. pub revision: u64, /// Reserved for future use. Must be ignored by the bootloader. - #[allow(clippy::pub_underscore_fields)] + #[expect(clippy::pub_underscore_fields)] pub _reserved: [u8; 16], } @@ -50,7 +49,7 @@ macro_rules! oro_boot_protocol { }; /// Holds the `TAG` constant for each request type. - #[allow(private_bounds)] + #[expect(private_bounds)] pub trait RequestTag: crate::macros::Sealed { /// The tag for the request. const TAG: crate::Tag; @@ -58,7 +57,7 @@ macro_rules! oro_boot_protocol { /// Specifies which Request a given data structure /// is for. - #[allow(private_bounds)] + #[expect(private_bounds)] pub trait Data: crate::macros::Sealed { /// The request this data is for. type Request: RequestTag; @@ -66,7 +65,7 @@ macro_rules! oro_boot_protocol { /// Specifies which revision of a Request the data /// structure is for. - #[allow(private_bounds)] + #[expect(private_bounds)] pub trait DataRevision: Data+ crate::macros::Sealed { /// The revision of the request. const REVISION: u64; @@ -75,7 +74,7 @@ macro_rules! oro_boot_protocol { $( #[doc = concat!("The response data structures for the [`", stringify!($ReqName), "Request`], across all revisions.")] pub mod %% { - #[allow(unused_imports)] + #[expect(unused_imports)] use super::*; $( @@ -159,7 +158,7 @@ macro_rules! oro_boot_protocol { /// by the bootloader. pub populated: u8, /// Reserved for future use. Ignored by the kernel. - #[allow(clippy::pub_underscore_fields)] + #[expect(clippy::pub_underscore_fields)] pub _reserved: [u8; 15], /// The response data. Filled in by the bootloader. /// @@ -223,7 +222,7 @@ macro_rules! oro_boot_protocol { /// or if the revision number is not recognized. #[must_use] #[cfg(feature = "utils")] - #[allow(clippy::needless_lifetimes)] + #[expect(clippy::needless_lifetimes)] pub fn response<'a>(&'a self) -> Option<%%::$ReqName %% Kind<'a>> { if self.populated == 0 { return None; @@ -254,7 +253,7 @@ macro_rules! oro_boot_protocol { /// is being accessed. #[cfg(feature = "utils")] #[must_use] - #[allow(clippy::needless_lifetimes)] + #[expect(clippy::needless_lifetimes)] pub unsafe fn response_mut_unchecked<'a>(&'a mut self) -> Option<%%::$ReqName %% KindMut<'a>> { match self.header.revision { $( @@ -306,7 +305,7 @@ macro_rules! oro_boot_protocol { $( $ReqName %% Request::TAG => { // SAFETY(qix-): We've already checked that it aligns properly. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] let req = unsafe { &mut *::core::ptr::from_mut(tag).cast::<$ReqName %% Request>() }; match req.header.revision { $( diff --git a/oro-boot-protocol/src/util.rs b/oro-boot-protocol/src/util.rs index afb61a8c..8d591dba 100644 --- a/oro-boot-protocol/src/util.rs +++ b/oro-boot-protocol/src/util.rs @@ -36,7 +36,7 @@ impl RequestScanner { let align_offset = base.align_offset(::core::mem::align_of::()); let len = len.saturating_sub(align_offset); // SAFETY(qix-): We've already aligned the pointer. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] let base = base.add(align_offset).cast::(); Self { base, len } @@ -79,7 +79,7 @@ impl RequestScanner { // SAFETY(qix-): We are guaranteed to have valid alignment // SAFETY(qix-): given that we start aligned, and iterate // SAFETY(qix-): on 16-byte boundaries. - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] while ptr < end { let header = &*(ptr.cast::()); diff --git a/oro-boot/src/lib.rs b/oro-boot/src/lib.rs index 99a5eef9..85fc9ab6 100644 --- a/oro-boot/src/lib.rs +++ b/oro-boot/src/lib.rs @@ -235,7 +235,7 @@ impl + Clone, I: Iterator + } } -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] fn try_send(scanner: &mut RequestScanner, response: R) where R::Request: RequestData, diff --git a/oro-boot/src/pfa.rs b/oro-boot/src/pfa.rs index 12fd1bbb..001b4cea 100644 --- a/oro-boot/src/pfa.rs +++ b/oro-boot/src/pfa.rs @@ -206,5 +206,5 @@ unsafe impl + Clone, I: Iterator + Clone> #[doc(hidden)] #[repr(align(4096))] -#[allow(dead_code)] +#[expect(dead_code)] struct AlignedPage([u8; 4096]); diff --git a/oro-boot/src/target/aarch64.rs b/oro-boot/src/target/aarch64.rs index 3629cabd..c1eca227 100644 --- a/oro-boot/src/target/aarch64.rs +++ b/oro-boot/src/target/aarch64.rs @@ -20,9 +20,9 @@ use oro_mem::{ translate::Translator, }; -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] pub type AddressSpace = AddressSpaceLayout; -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] pub type SupervisorHandle = AddressSpaceHandle; /// Passed from the [`prepare_transfer`] function to the [`transfer`] function, @@ -104,7 +104,7 @@ pub unsafe fn prepare_transfer usize { /// Prepares the system for a transfer. Called before the memory map /// is written, after which `transfer` is called. -#[allow(clippy::unnecessary_wraps)] +#[expect(clippy::unnecessary_wraps)] pub unsafe fn prepare_transfer( mapper: &mut AddressSpaceHandle, alloc: &mut A, diff --git a/oro-bootloader-limine/src/lib.rs b/oro-bootloader-limine/src/lib.rs index 3ee65761..fcd127d5 100644 --- a/oro-bootloader-limine/src/lib.rs +++ b/oro-bootloader-limine/src/lib.rs @@ -228,7 +228,6 @@ pub unsafe fn init() -> ! { /// # Safety /// Do **NOT** call this function directly. /// It is only called by the architecture-specific binaries. -#[allow(unused_variables)] pub unsafe fn panic(info: &::core::panic::PanicInfo) -> ! { use core::arch::asm; diff --git a/oro-debug-pl011/src/driver.rs b/oro-debug-pl011/src/driver.rs index 31b889ee..2bc0b99f 100644 --- a/oro-debug-pl011/src/driver.rs +++ b/oro-debug-pl011/src/driver.rs @@ -88,7 +88,7 @@ struct RegisterBlock { dmacr: RW, } -#[allow(clippy::inline_always)] +#[expect(clippy::inline_always)] impl PL011 { /// Create a new PL011 UART driver at the given base address. /// @@ -164,12 +164,12 @@ impl PL011 { /// Calculate the baud rate divisor pair /// Returns the `(integer, fractional)` parts as a tuple. - #[allow(clippy::cast_sign_loss)] + #[expect(clippy::cast_sign_loss)] fn calculate_divisors(base_clock: u32, baud_rate: u32) -> (u16, u8) { let baud_div = f64::from(base_clock) / (16.0 * f64::from(baud_rate)); - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let integer = baud_div as u16; - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] let fractional = (((baud_div - f64::from(integer)) * 64.0) + 0.5) as u8; (integer, fractional) } diff --git a/oro-debug-pl011/src/lib.rs b/oro-debug-pl011/src/lib.rs index fe578330..25d4e729 100644 --- a/oro-debug-pl011/src/lib.rs +++ b/oro-debug-pl011/src/lib.rs @@ -36,7 +36,7 @@ pub fn init(offset: usize) { } /// Logs a message to the PL011. -#[allow(clippy::missing_panics_doc)] +#[expect(clippy::missing_panics_doc)] pub fn log(message: fmt::Arguments) { // NOTE(qix-): This unsafe block MUST NOT PANIC. unsafe { diff --git a/oro-debug-uart16550/src/lib.rs b/oro-debug-uart16550/src/lib.rs index 730cbf9e..1186e58e 100644 --- a/oro-debug-uart16550/src/lib.rs +++ b/oro-debug-uart16550/src/lib.rs @@ -18,7 +18,7 @@ pub fn init() { } /// Logs a message to the UART. -#[allow(clippy::missing_panics_doc)] +#[expect(clippy::missing_panics_doc)] pub fn log(message: fmt::Arguments) { // NOTE(qix-): This unsafe block MUST NOT PANIC. unsafe { writeln!(SERIAL.lock(), "{message}") }.unwrap(); diff --git a/oro-dtb/src/lib.rs b/oro-dtb/src/lib.rs index aae25048..1a472f27 100644 --- a/oro-dtb/src/lib.rs +++ b/oro-dtb/src/lib.rs @@ -61,7 +61,7 @@ impl FdtHeader { /// /// If `len` is provided, the header is validated against the given length. pub fn from(ptr: *const u8, len: Option) -> Result<&'static Self, ValidationError> { - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] let ptr = ptr.cast::(); if !ptr.is_aligned() { @@ -107,7 +107,7 @@ impl FdtHeader { } /// Returns the byte slice of the structure block. - #[allow(clippy::needless_lifetimes)] + #[expect(clippy::needless_lifetimes)] fn struct_slice<'a>(&'a self) -> &'a [u8] { unsafe { core::slice::from_raw_parts( @@ -120,7 +120,7 @@ impl FdtHeader { } /// Returns the byte slice of the string block. - #[allow(clippy::needless_lifetimes)] + #[expect(clippy::needless_lifetimes)] fn string_slice<'a>(&'a self) -> &'a [u8] { unsafe { core::slice::from_raw_parts( @@ -133,7 +133,7 @@ impl FdtHeader { } /// Returns an iterator over the raw DTB tokens. - #[allow(clippy::needless_lifetimes)] + #[expect(clippy::needless_lifetimes)] pub fn iter<'a>(&'a self) -> impl Iterator> + 'a { FdtIter::new(self).fuse() } diff --git a/oro-elf/src/lib.rs b/oro-elf/src/lib.rs index e307f2c7..01200304 100644 --- a/oro-elf/src/lib.rs +++ b/oro-elf/src/lib.rs @@ -73,14 +73,14 @@ impl Elf { class: ElfClass, machine: ElfMachine, ) -> Result<&'static Self, ElfError> { - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] if !base_addr.cast::().is_aligned() { return Err(ElfError::UnalignedBaseAddr); } let end_excl = base_addr.add(length) as u64; - #[allow(clippy::cast_ptr_alignment)] + #[expect(clippy::cast_ptr_alignment)] let elf = &*base_addr.cast::(); if elf.ident.magic != [0x7F, b'E', b'L', b'F'] { @@ -203,7 +203,7 @@ impl Elf { /// Returns the entry point of the ELF file. #[inline] #[must_use] - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] pub fn entry_point(&self) -> usize { match self.ident.class { ElfClass::Class32 => unsafe { self.endian.elf32.entry as usize }, @@ -435,7 +435,7 @@ impl<'a> ElfSegment for ElfSegmentHeader<'a> { } } - #[allow(clippy::similar_names, clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] #[inline] fn load_address(&self) -> usize { match self { @@ -456,7 +456,7 @@ impl<'a> ElfSegment for ElfSegmentHeader<'a> { } } - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] #[inline] fn target_address(&self) -> usize { match self { @@ -465,7 +465,7 @@ impl<'a> ElfSegment for ElfSegmentHeader<'a> { } } - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] #[inline] fn load_size(&self) -> usize { match self { @@ -474,7 +474,7 @@ impl<'a> ElfSegment for ElfSegmentHeader<'a> { } } - #[allow(clippy::cast_possible_truncation)] + #[expect(clippy::cast_possible_truncation)] #[inline] fn target_size(&self) -> usize { match self { diff --git a/oro-kernel/src/id.rs b/oro-kernel/src/id.rs index 5c2f6282..7551b0b7 100644 --- a/oro-kernel/src/id.rs +++ b/oro-kernel/src/id.rs @@ -99,7 +99,6 @@ pub enum IdType { PortType = 2, } -#[allow(clippy::missing_docs_in_private_items)] macro_rules! try_from_impl { ($docs:literal, $ty:ty, $name:ident, $src:ident) => { #[doc = $docs] @@ -152,7 +151,7 @@ impl IdType { match self { Self::Module => 'M', Self::PortType => 'P', - #[allow(unreachable_patterns)] + #[expect(unreachable_patterns)] _ => '?', } } @@ -273,7 +272,7 @@ impl AnyId { /// Calling this method with invalid type bytes may result /// in undefined behavior. pub unsafe fn to_str_unchecked<'a>(src: &[u8; 16], buf: &'a mut [u8; 27]) -> &'a str { - #[allow(clippy::missing_docs_in_private_items)] + #[expect(clippy::missing_docs_in_private_items)] const BASE32: [u8; 32] = *b"0123456789ACDEFGHJKMNPQRTUVWXYZ-"; let ty: IdType = core::mem::transmute(src[0] >> 5); diff --git a/oro-macro-proc/src/asm_buffer.rs b/oro-macro-proc/src/asm_buffer.rs index 4327efd1..1d655772 100644 --- a/oro-macro-proc/src/asm_buffer.rs +++ b/oro-macro-proc/src/asm_buffer.rs @@ -4,7 +4,7 @@ use quote::quote; use std::io::Read; -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] pub fn asm_buffer(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream { let args = std::env::args().collect::>(); @@ -39,8 +39,7 @@ pub fn asm_buffer(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream { #[link_section = ".inline_asm"] #[no_mangle] #[naked] - #[allow(non_snake_case)] - pub extern "C" fn _INLINE_ASM() { + pub extern "C" fn _inline_asm() { unsafe { ::core::arch::asm!( ".byte 0xDE", ".byte 0xAD", ".byte 0xBE" , ".byte 0xEF", @@ -184,7 +183,7 @@ where } /// An iterator that filters by a sliding window of two elements. -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] struct FilterPairs where I: Iterator, diff --git a/oro-macro-proc/src/enum_as.rs b/oro-macro-proc/src/enum_as.rs index 314278e2..cc7be474 100644 --- a/oro-macro-proc/src/enum_as.rs +++ b/oro-macro-proc/src/enum_as.rs @@ -4,7 +4,7 @@ use proc_macro2::TokenTree; use quote::quote; use syn::Meta; -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] pub fn enum_as_u64(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let ast = syn::parse_macro_input!(input as syn::DeriveInput); @@ -87,7 +87,7 @@ pub fn enum_as_u64(input: proc_macro::TokenStream) -> proc_macro::TokenStream { expanded.into() } -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] pub fn enum_as_u32(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let ast = syn::parse_macro_input!(input as syn::DeriveInput); diff --git a/oro-macro-proc/src/enum_iterator.rs b/oro-macro-proc/src/enum_iterator.rs index ce0e964f..196309d1 100644 --- a/oro-macro-proc/src/enum_iterator.rs +++ b/oro-macro-proc/src/enum_iterator.rs @@ -2,7 +2,7 @@ use quote::quote; -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] pub fn derive_enum_iterator(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let ast = syn::parse_macro_input!(input as syn::DeriveInput); diff --git a/oro-macro-proc/src/gdb_autoload.rs b/oro-macro-proc/src/gdb_autoload.rs index 88493110..11cf219e 100644 --- a/oro-macro-proc/src/gdb_autoload.rs +++ b/oro-macro-proc/src/gdb_autoload.rs @@ -4,7 +4,7 @@ use proc_macro2::Span; use quote::quote; use syn::{punctuated::Punctuated, Error, Ident, Lit, Token}; -#[allow(clippy::missing_docs_in_private_items)] +#[expect(clippy::missing_docs_in_private_items)] pub fn gdb_autoload_inline(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let Some(tok) = input.clone().into_iter().next() else { return Error::new(Span::call_site(), "expected a string literal") diff --git a/oro-macro-proc/src/lib.rs b/oro-macro-proc/src/lib.rs index 2e738023..49bb317e 100644 --- a/oro-macro-proc/src/lib.rs +++ b/oro-macro-proc/src/lib.rs @@ -115,7 +115,6 @@ pub fn derive_enum_iterator(input: proc_macro::TokenStream) -> proc_macro::Token /// assert_eq!(SOME_VALUE, 42); /// } /// ``` -#[allow(clippy::missing_panics_doc)] #[proc_macro] pub fn paste(input: proc_macro::TokenStream) -> proc_macro::TokenStream { match self::paste::paste(input) { diff --git a/oro-macro-proc/src/paste.rs b/oro-macro-proc/src/paste.rs index 0e978fb8..f3fb6766 100644 --- a/oro-macro-proc/src/paste.rs +++ b/oro-macro-proc/src/paste.rs @@ -6,11 +6,7 @@ use proc_macro2::{Span, TokenTree}; use std::collections::VecDeque; use syn::{Error, Ident}; -#[allow( - clippy::missing_panics_doc, - clippy::missing_docs_in_private_items, - clippy::too_many_lines -)] +#[expect(clippy::missing_docs_in_private_items, clippy::too_many_lines)] pub fn paste(input: proc_macro::TokenStream) -> syn::Result { let input = proc_macro2::TokenStream::from(input); let mut iter = CaseTransformationIterator::new(input.into_iter()).peekable(); diff --git a/oro-macro/src/tests.rs b/oro-macro/src/tests.rs index 16df88b8..338914c9 100644 --- a/oro-macro/src/tests.rs +++ b/oro-macro/src/tests.rs @@ -68,7 +68,7 @@ fn paste_snake_case() { } #[test] -#[allow(non_snake_case)] +#[expect(non_snake_case)] fn paste_title_case() { paste! { let %% = 42; @@ -77,7 +77,7 @@ fn paste_title_case() { } #[test] -#[allow(non_snake_case)] +#[expect(non_snake_case)] fn paste_camel_case() { paste! { let %% = 42; @@ -86,7 +86,7 @@ fn paste_camel_case() { } #[test] -#[allow(non_snake_case)] +#[expect(non_snake_case)] fn paste_const_case() { paste! { let %% = 42; diff --git a/oro-macro/src/unsafe_macros.rs b/oro-macro/src/unsafe_macros.rs index 8227d9fa..281aa44e 100644 --- a/oro-macro/src/unsafe_macros.rs +++ b/oro-macro/src/unsafe_macros.rs @@ -6,7 +6,7 @@ #[macro_export] macro_rules! assert_unsafe { () => {{ - #[allow(clippy::zero_ptr)] + #[expect(clippy::zero_ptr)] let _ptr = 0 as *const (); let _this_macro_must_be_used_in_an_unsafe_context = *_ptr; }}; diff --git a/oro-mem/src/pfa/filo.rs b/oro-mem/src/pfa/filo.rs index c5c50964..860eae57 100644 --- a/oro-mem/src/pfa/filo.rs +++ b/oro-mem/src/pfa/filo.rs @@ -76,7 +76,6 @@ unsafe impl PageFrameAllocate for FiloPageFrameAllocator where M: FiloPageFrameManager, { - #[allow(clippy::cast_possible_truncation)] fn allocate(&mut self) -> Option { if self.last_free == u64::MAX { // We're out of memory diff --git a/oro-sync/src/barrier.rs b/oro-sync/src/barrier.rs index f9015eda..1f654a99 100644 --- a/oro-sync/src/barrier.rs +++ b/oro-sync/src/barrier.rs @@ -23,7 +23,7 @@ pub struct SpinBarrier { impl SpinBarrier { /// Creates a new `SpinBarrier` that will synchronize `total` cores. - #[allow(clippy::new_without_default)] + #[expect(clippy::new_without_default)] #[must_use] pub const fn new() -> Self { Self { diff --git a/oro-type/src/lib.rs b/oro-type/src/lib.rs index 3efce3a5..dff4557e 100644 --- a/oro-type/src/lib.rs +++ b/oro-type/src/lib.rs @@ -119,7 +119,6 @@ pub type Be = Endian; pub type Le = Endian; #[doc(hidden)] -#[allow(clippy::missing_docs_in_private_items)] mod private { pub trait Sealed {} } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 0948c6ee..c45a5a7a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-09-04" +channel = "nightly-2024-09-08" components = [ "rustfmt", "rustc-dev", "clippy", "rust-src", "llvm-tools-preview" ] targets = [ "x86_64-unknown-none", "aarch64-unknown-none" ] profile = "minimal"