From 924189992f58562cd2f94e78563f070cb25e36b6 Mon Sep 17 00:00:00 2001 From: auronandace Date: Wed, 11 Feb 2026 14:13:57 +0000 Subject: [PATCH] add unexpected_cfgs lint --- Cargo.toml | 1 + src/io/impls.rs | 4 ---- src/platform/mod.rs | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index dcf6c01ec1..933c72a572 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ mismatched_lifetime_syntaxes = "deny" non_camel_case_types = "allow" non_snake_case = "allow" # TODO review occuurences non_upper_case_globals = "allow" # TODO review occuurences +unexpected_cfgs = "deny" unpredictable_function_pointer_comparisons = "deny" unsafe_op_in_unsafe_fn = "deny" unused_imports = "deny" diff --git a/src/io/impls.rs b/src/io/impls.rs index 29009efc42..a567266a7f 100644 --- a/src/io/impls.rs +++ b/src/io/impls.rs @@ -24,13 +24,11 @@ impl<'a, R: Read + ?Sized> Read for &'a mut R { unsafe { (**self).initializer() } } - #[cfg(feature = "alloc")] #[inline] fn read_to_end(&mut self, buf: &mut Vec) -> io::Result { (**self).read_to_end(buf) } - #[cfg(feature = "alloc")] #[inline] fn read_to_string(&mut self, buf: &mut String) -> io::Result { (**self).read_to_string(buf) @@ -103,13 +101,11 @@ impl Read for Box { unsafe { (**self).initializer() } } - #[cfg(feature = "alloc")] #[inline] fn read_to_end(&mut self, buf: &mut Vec) -> io::Result { (**self).read_to_end(buf) } - #[cfg(feature = "alloc")] #[inline] fn read_to_string(&mut self, buf: &mut String) -> io::Result { (**self).read_to_string(buf) diff --git a/src/platform/mod.rs b/src/platform/mod.rs index d8df40e86a..d489485b38 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -20,11 +20,11 @@ mod pal; pub use self::sys::Sys; -#[cfg(all(not(feature = "no_std"), target_os = "linux"))] +#[cfg(target_os = "linux")] #[path = "linux/mod.rs"] pub(crate) mod sys; -#[cfg(all(not(feature = "no_std"), target_os = "redox"))] +#[cfg(target_os = "redox")] #[path = "redox/mod.rs"] pub(crate) mod sys;