From df8031437f84f6d010848d8707d15f3ac04eb37d Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 27 Apr 2022 14:00:45 -0700 Subject: [PATCH 1/2] Remove use of reverted std::ffi::c_char --- alloc/tests/c_str.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/alloc/tests/c_str.rs b/alloc/tests/c_str.rs index 8fbb10e1d..4a5817939 100644 --- a/alloc/tests/c_str.rs +++ b/alloc/tests/c_str.rs @@ -1,5 +1,6 @@ use std::borrow::Cow::{Borrowed, Owned}; -use std::ffi::{c_char, CStr}; +use std::ffi::CStr; +use std::os::raw::c_char; #[test] fn to_str() { From 8a900987938f916c79cce0138bbe9e007f4c6f25 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Wed, 27 Apr 2022 13:47:10 -0700 Subject: [PATCH 2/2] Revert "Re-export core::ffi types from std::ffi" This reverts commit f5841bb0d2a4f86a2df8fab1124efaa11851c512. Fixes https://github.com/rust-lang/rust/issues/96435 , a regression in crates doing `use std::ffi::*;` and `use std::os::raw::*;`. We can re-add this re-export once the `core::ffi` types are stable, and thus the `std::os::raw` types can become re-exports as well, which will avoid the conflict. (Type aliases to the same type still conflict, but re-exports of the same type don't.) --- std/src/ffi/mod.rs | 9 --------- std/src/lib.rs | 1 - 2 files changed, 10 deletions(-) diff --git a/std/src/ffi/mod.rs b/std/src/ffi/mod.rs index 0141a2bcc..10983a332 100644 --- a/std/src/ffi/mod.rs +++ b/std/src/ffi/mod.rs @@ -171,15 +171,6 @@ pub use self::os_str::{OsStr, OsString}; #[stable(feature = "core_c_void", since = "1.30.0")] pub use core::ffi::c_void; -#[unstable(feature = "core_ffi_c", issue = "94501")] -pub use core::ffi::{ - c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint, - c_ulong, c_ulonglong, c_ushort, -}; - -#[unstable(feature = "c_size_t", issue = "88345")] -pub use core::ffi::{c_ptrdiff_t, c_size_t, c_ssize_t}; - #[unstable( feature = "c_variadic", reason = "the `c_variadic` feature has not been properly tested on \ diff --git a/std/src/lib.rs b/std/src/lib.rs index f60b604f1..97c30c422 100644 --- a/std/src/lib.rs +++ b/std/src/lib.rs @@ -307,7 +307,6 @@ // Only for re-exporting: #![feature(assert_matches)] #![feature(async_iterator)] -#![feature(c_size_t)] #![feature(c_variadic)] #![feature(cfg_accessible)] #![feature(cfg_eval)]