Skip to content

Commit 4e8b91a

Browse files
committed
Work around Clippy false positive on as c_char
1 parent db5a2ae commit 4e8b91a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/std/src/os/raw/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ macro_rules! type_alias {
4646
}
4747

4848
type_alias! { "char.md", c_char = c_char_definition::c_char, NonZero_c_char = c_char_definition::NonZero_c_char;
49+
// Make this type alias appear cfg-dependent so that Clippy does not suggest
50+
// replacing `0 as c_char` with `0_i8`/`0_u8`. This #[cfg(all())] can be removed
51+
// after the false positive in https://github.com/rust-lang/rust-clippy/issues/8093
52+
// is fixed.
53+
#[cfg(all())]
4954
#[doc(cfg(all()))] }
5055
type_alias! { "schar.md", c_schar = i8, NonZero_c_schar = NonZeroI8; }
5156
type_alias! { "uchar.md", c_uchar = u8, NonZero_c_uchar = NonZeroU8; }

0 commit comments

Comments
 (0)