about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-07-22 11:48:52 +0200
committerGitHub <noreply@github.com>2023-07-22 11:48:52 +0200
commit6003d6b60b1b080b9d30d4926165660760dade23 (patch)
treeb3d610a32f28cf00d4192df3fdfbbbb01a63422c
parente0922fba67519267a0055412ae05a9474effb9bc (diff)
parentb607a8a4af89c54d6cfcd633d9aabcc33e9c3502 (diff)
downloadrust-6003d6b60b1b080b9d30d4926165660760dade23.tar.gz
rust-6003d6b60b1b080b9d30d4926165660760dade23.zip
Rollup merge of #112490 - Alexendoo:c-char-cfg-all, r=cuviper
Remove `#[cfg(all())]` workarounds from `c_char`

Casts to type aliases are now ignored by Clippy https://github.com/rust-lang/rust-clippy/pull/8596

Closes https://github.com/rust-lang/rust-clippy/issues/8093
-rw-r--r--library/core/src/ffi/mod.rs5
-rw-r--r--library/std/src/os/raw/mod.rs5
2 files changed, 0 insertions, 10 deletions
diff --git a/library/core/src/ffi/mod.rs b/library/core/src/ffi/mod.rs
index 0488c807604..3fcd5e7c1cb 100644
--- a/library/core/src/ffi/mod.rs
+++ b/library/core/src/ffi/mod.rs
@@ -52,11 +52,6 @@ macro_rules! type_alias {
 }
 
 type_alias! { "c_char.md", c_char = c_char_definition::c_char, NonZero_c_char = c_char_definition::NonZero_c_char;
-// Make this type alias appear cfg-dependent so that Clippy does not suggest
-// replacing `0 as c_char` with `0_i8`/`0_u8`. This #[cfg(all())] can be removed
-// after the false positive in https://github.com/rust-lang/rust-clippy/issues/8093
-// is fixed.
-#[cfg(all())]
 #[doc(cfg(all()))] }
 
 type_alias! { "c_schar.md", c_schar = i8, NonZero_c_schar = NonZeroI8; }
diff --git a/library/std/src/os/raw/mod.rs b/library/std/src/os/raw/mod.rs
index 19d0ffb2e39..5b302e3c2c8 100644
--- a/library/std/src/os/raw/mod.rs
+++ b/library/std/src/os/raw/mod.rs
@@ -9,11 +9,6 @@ macro_rules! alias_core_ffi {
     ($($t:ident)*) => {$(
         #[stable(feature = "raw_os", since = "1.1.0")]
         #[doc = include_str!(concat!("../../../../core/src/ffi/", stringify!($t), ".md"))]
-        // Make this type alias appear cfg-dependent so that Clippy does not suggest
-        // replacing expressions like `0 as c_char` with `0_i8`/`0_u8`. This #[cfg(all())] can be
-        // removed after the false positive in https://github.com/rust-lang/rust-clippy/issues/8093
-        // is fixed.
-        #[cfg(all())]
         #[doc(cfg(all()))]
         pub type $t = core::ffi::$t;
     )*}