Merge branch 'clippy-green1' into 'master'

finish current clippy lints to make CI green

See merge request redox-os/relibc!1546
This commit is contained in:
Jeremy Soller
2026-07-13 06:12:25 -06:00
5 changed files with 15 additions and 1 deletions
-1
View File
@@ -1,6 +1,5 @@
#![no_std]
#![allow(internal_features)]
#![feature(core_intrinsics)]
#![deny(unsafe_op_in_unsafe_fn)]
use core::{
+1
View File
@@ -713,6 +713,7 @@ impl<'a> MmapGuard<'a> {
Ok(())
}
#[expect(clippy::mut_from_ref)]
pub unsafe fn map_mut_anywhere(
fd: &'a FdGuardUpper,
offset: usize,
+12
View File
@@ -953,6 +953,10 @@ impl FdTbl {
pub const CONTEXT_MAX_FILES: u32 = 65_536;
pub const DEFAULT_CAPACITY: usize = usize::BITS as usize;
#[expect(
clippy::new_without_default,
reason = "default not expected for this type"
)]
pub const fn new() -> Self {
Self {
fd: None,
@@ -1267,6 +1271,10 @@ bitflags::bitflags! {
}
impl PosixFdTbl {
#[expect(
clippy::new_without_default,
reason = "default not expected for this type"
)]
pub const fn new() -> Self {
Self {
table: Vec::new(),
@@ -1595,6 +1603,10 @@ pub struct UpperFdTbl {
}
impl UpperFdTbl {
#[expect(
clippy::new_without_default,
reason = "default not expected for this type"
)]
pub const fn new() -> Self {
Self {
table: Vec::new(),
+1
View File
@@ -258,6 +258,7 @@ impl<'a, T: Kind> NulStr<'a, T> {
/// Scan the string to get its length.
#[doc(alias = "strlen")]
#[doc(alias = "wcslen")]
#[expect(clippy::len_without_is_empty, reason = "len() signature intentional")]
pub fn len(self) -> usize {
self.to_chars().len()
}
+1
View File
@@ -117,6 +117,7 @@ macro_rules! trace_expr {
// log::trace! but functions inside them will
// not be evaluated or compiled unless enabled
#[cfg(target_os = "redox")] // currently only used in redox
macro_rules! trace_log {
($($arg:tt)+) => {
#[cfg(not(feature = "no_trace"))]