Skip to content

Commit c9748b6

Browse files
Finish bumping stage0
It looks like the last time had left some remaining cfg's -- which made me think that the stage0 bump was actually successful. This brings us to a released 1.62 beta though.
1 parent eaf5b65 commit c9748b6

File tree

9 files changed

+2
-117
lines changed

9 files changed

+2
-117
lines changed

alloc/src/ffi/c_str.rs

-78
Original file line numberDiff line numberDiff line change
@@ -1053,84 +1053,6 @@ impl AsRef<CStr> for CString {
10531053
}
10541054
}
10551055

1056-
#[cfg(bootstrap)]
1057-
#[doc(hidden)]
1058-
#[unstable(feature = "cstr_internals", issue = "none")]
1059-
pub trait CStrExt {
1060-
/// Converts a `CStr` into a <code>[Cow]<[str]></code>.
1061-
///
1062-
/// If the contents of the `CStr` are valid UTF-8 data, this
1063-
/// function will return a <code>[Cow]::[Borrowed]\(&[str])</code>
1064-
/// with the corresponding <code>&[str]</code> slice. Otherwise, it will
1065-
/// replace any invalid UTF-8 sequences with
1066-
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD] and return a
1067-
/// <code>[Cow]::[Owned]\(&[str])</code> with the result.
1068-
///
1069-
/// [str]: prim@str "str"
1070-
/// [Borrowed]: Cow::Borrowed
1071-
/// [Owned]: Cow::Owned
1072-
/// [U+FFFD]: crate::char::REPLACEMENT_CHARACTER "std::char::REPLACEMENT_CHARACTER"
1073-
///
1074-
/// # Examples
1075-
///
1076-
/// Calling `to_string_lossy` on a `CStr` containing valid UTF-8:
1077-
///
1078-
/// ```
1079-
/// use std::borrow::Cow;
1080-
/// use std::ffi::CStr;
1081-
///
1082-
/// let cstr = CStr::from_bytes_with_nul(b"Hello World\0")
1083-
/// .expect("CStr::from_bytes_with_nul failed");
1084-
/// assert_eq!(cstr.to_string_lossy(), Cow::Borrowed("Hello World"));
1085-
/// ```
1086-
///
1087-
/// Calling `to_string_lossy` on a `CStr` containing invalid UTF-8:
1088-
///
1089-
/// ```
1090-
/// use std::borrow::Cow;
1091-
/// use std::ffi::CStr;
1092-
///
1093-
/// let cstr = CStr::from_bytes_with_nul(b"Hello \xF0\x90\x80World\0")
1094-
/// .expect("CStr::from_bytes_with_nul failed");
1095-
/// assert_eq!(
1096-
/// cstr.to_string_lossy(),
1097-
/// Cow::Owned(String::from("Hello �World")) as Cow<'_, str>
1098-
/// );
1099-
/// ```
1100-
#[must_use = "this returns the result of the operation, \
1101-
without modifying the original"]
1102-
#[stable(feature = "cstr_to_str", since = "1.4.0")]
1103-
fn to_string_lossy(&self) -> Cow<'_, str>;
1104-
1105-
/// Converts a <code>[Box]<[CStr]></code> into a [`CString`] without copying or allocating.
1106-
///
1107-
/// # Examples
1108-
///
1109-
/// ```
1110-
/// use std::ffi::CString;
1111-
///
1112-
/// let c_string = CString::new(b"foo".to_vec()).expect("CString::new failed");
1113-
/// let boxed = c_string.into_boxed_c_str();
1114-
/// assert_eq!(boxed.into_c_string(), CString::new("foo").expect("CString::new failed"));
1115-
/// ```
1116-
#[must_use = "`self` will be dropped if the result is not used"]
1117-
#[stable(feature = "into_boxed_c_str", since = "1.20.0")]
1118-
fn into_c_string(self: Box<Self>) -> CString;
1119-
}
1120-
1121-
#[cfg(bootstrap)]
1122-
#[unstable(feature = "cstr_internals", issue = "none")]
1123-
impl CStrExt for CStr {
1124-
fn to_string_lossy(&self) -> Cow<'_, str> {
1125-
String::from_utf8_lossy(self.to_bytes())
1126-
}
1127-
1128-
fn into_c_string(self: Box<Self>) -> CString {
1129-
CString::from(self)
1130-
}
1131-
}
1132-
1133-
#[cfg(not(bootstrap))]
11341056
#[cfg(not(test))]
11351057
impl CStr {
11361058
/// Converts a `CStr` into a <code>[Cow]<[str]></code>.

alloc/src/ffi/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@
8080
8181
#![unstable(feature = "alloc_ffi", issue = "94079")]
8282

83-
#[cfg(bootstrap)]
84-
#[unstable(feature = "cstr_internals", issue = "none")]
85-
pub use self::c_str::CStrExt;
8683
#[unstable(feature = "alloc_c_string", issue = "94079")]
8784
pub use self::c_str::FromVecWithNulError;
8885
#[unstable(feature = "alloc_c_string", issue = "94079")]

alloc/src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ macro_rules! vec {
5656
// `slice::into_vec` function which is only available with cfg(test)
5757
// NB see the slice::hack module in slice.rs for more information
5858
#[cfg(all(not(no_global_oom_handling), test))]
59-
#[cfg_attr(not(bootstrap), allow(unused_macro_rules))]
59+
#[allow(unused_macro_rules)]
6060
macro_rules! vec {
6161
() => (
6262
$crate::vec::Vec::new()

core/src/ffi/c_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ use crate::str;
7777
#[derive(Hash)]
7878
#[cfg_attr(not(test), rustc_diagnostic_item = "CStr")]
7979
#[unstable(feature = "core_c_str", issue = "94079")]
80-
#[cfg_attr(not(bootstrap), rustc_has_incoherent_inherent_impls)]
80+
#[rustc_has_incoherent_inherent_impls]
8181
// FIXME:
8282
// `fn from` in `impl From<&CStr> for Box<CStr>` current implementation relies
8383
// on `CStr` being layout-compatible with `[u8]`.

core/src/intrinsics.rs

-9
Original file line numberDiff line numberDiff line change
@@ -1908,7 +1908,6 @@ extern "rust-intrinsic" {
19081908

19091909
/// See documentation of `<*const T>::sub_ptr` for details.
19101910
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")]
1911-
#[cfg(not(bootstrap))]
19121911
pub fn ptr_offset_from_unsigned<T>(ptr: *const T, base: *const T) -> usize;
19131912

19141913
/// See documentation of `<*const T>::guaranteed_eq` for details.
@@ -2393,11 +2392,3 @@ where
23932392
{
23942393
called_in_const.call_once(arg)
23952394
}
2396-
2397-
/// Bootstrap polyfill
2398-
#[cfg(bootstrap)]
2399-
pub const unsafe fn ptr_offset_from_unsigned<T>(ptr: *const T, base: *const T) -> usize {
2400-
// SAFETY: we have stricter preconditions than `ptr_offset_from`, so can
2401-
// call it, and its output has to be positive, so we can just cast.
2402-
unsafe { ptr_offset_from(ptr, base) as _ }
2403-
}

core/src/ops/try_trait.rs

-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ pub trait FromResidual<R = <Self as Try>::Residual> {
330330
fn from_residual(residual: R) -> Self;
331331
}
332332

333-
#[cfg(not(bootstrap))]
334333
#[unstable(
335334
feature = "yeet_desugar_details",
336335
issue = "none",

portable-simd/crates/core_simd/src/intrinsics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ extern "platform-intrinsic" {
6262
pub(crate) fn simd_xor<T>(x: T, y: T) -> T;
6363

6464
/// getelementptr (without inbounds)
65-
#[cfg(not(bootstrap))]
6665
pub(crate) fn simd_arith_offset<T, U>(ptrs: T, offsets: U) -> T;
6766

6867
/// fptoui/fptosi/uitofp/sitofp

portable-simd/crates/core_simd/src/vector/ptr.rs

-19
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
//! Private implementation details of public gather/scatter APIs.
2-
#[cfg(not(bootstrap))]
32
use crate::simd::intrinsics;
43
use crate::simd::{LaneCount, Simd, SupportedLaneCount};
5-
#[cfg(bootstrap)]
6-
use core::mem;
74

85
/// A vector of *const T.
96
#[derive(Debug, Copy, Clone)]
@@ -24,14 +21,6 @@ where
2421
#[inline]
2522
#[must_use]
2623
pub fn wrapping_add(self, addend: Simd<usize, LANES>) -> Self {
27-
#[cfg(bootstrap)]
28-
// Safety: converting pointers to usize and vice-versa is safe
29-
// (even if using that pointer is not)
30-
unsafe {
31-
let x: Simd<usize, LANES> = mem::transmute_copy(&self);
32-
mem::transmute_copy(&{ x + (addend * Simd::splat(mem::size_of::<T>())) })
33-
}
34-
#[cfg(not(bootstrap))]
3524
// Safety: this intrinsic doesn't have a precondition
3625
unsafe { intrinsics::simd_arith_offset(self, addend) }
3726
}
@@ -56,14 +45,6 @@ where
5645
#[inline]
5746
#[must_use]
5847
pub fn wrapping_add(self, addend: Simd<usize, LANES>) -> Self {
59-
#[cfg(bootstrap)]
60-
// Safety: converting pointers to usize and vice-versa is safe
61-
// (even if using that pointer is not)
62-
unsafe {
63-
let x: Simd<usize, LANES> = mem::transmute_copy(&self);
64-
mem::transmute_copy(&{ x + (addend * Simd::splat(mem::size_of::<T>())) })
65-
}
66-
#[cfg(not(bootstrap))]
6748
// Safety: this intrinsic doesn't have a precondition
6849
unsafe { intrinsics::simd_arith_offset(self, addend) }
6950
}

std/src/prelude/v1.rs

-4
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,3 @@ pub use crate::string::{String, ToString};
9595
#[stable(feature = "rust1", since = "1.0.0")]
9696
#[doc(no_inline)]
9797
pub use crate::vec::Vec;
98-
99-
#[cfg(bootstrap)]
100-
#[unstable(feature = "cstr_internals", issue = "none")]
101-
pub use alloc::ffi::CStrExt;

0 commit comments

Comments
 (0)