Skip to content

Commit eb38d94

Browse files
committed
Merge from rustc
2 parents 8abff9b + fc4b513 commit eb38d94

File tree

18 files changed

+54
-123
lines changed

18 files changed

+54
-123
lines changed

alloc/src/collections/vec_deque/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ impl<T> VecDeque<T> {
537537
/// ```
538538
#[inline]
539539
#[stable(feature = "rust1", since = "1.0.0")]
540-
#[rustc_const_stable(feature = "const_vec_deque_new", since = "CURRENT_RUSTC_VERSION")]
540+
#[rustc_const_stable(feature = "const_vec_deque_new", since = "1.68.0")]
541541
#[must_use]
542542
pub const fn new() -> VecDeque<T> {
543543
// FIXME: This should just be `VecDeque::new_in(Global)` once that hits stable.

alloc/src/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2549,7 +2549,7 @@ impl ToString for char {
25492549
}
25502550

25512551
#[cfg(not(no_global_oom_handling))]
2552-
#[stable(feature = "bool_to_string_specialization", since = "CURRENT_RUSTC_VERSION")]
2552+
#[stable(feature = "bool_to_string_specialization", since = "1.68.0")]
25532553
impl ToString for bool {
25542554
#[inline]
25552555
fn to_string(&self) -> String {

core/src/cmp.rs

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -798,16 +798,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
798798
Self: Sized,
799799
Self: ~const Destruct,
800800
{
801-
#[cfg(not(bootstrap))]
802-
{
803-
max_by(self, other, Ord::cmp)
804-
}
805-
806-
#[cfg(bootstrap)]
807-
match self.cmp(&other) {
808-
Ordering::Less | Ordering::Equal => other,
809-
Ordering::Greater => self,
810-
}
801+
max_by(self, other, Ord::cmp)
811802
}
812803

813804
/// Compares and returns the minimum of two values.
@@ -828,16 +819,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
828819
Self: Sized,
829820
Self: ~const Destruct,
830821
{
831-
#[cfg(not(bootstrap))]
832-
{
833-
min_by(self, other, Ord::cmp)
834-
}
835-
836-
#[cfg(bootstrap)]
837-
match self.cmp(&other) {
838-
Ordering::Less | Ordering::Equal => self,
839-
Ordering::Greater => other,
840-
}
822+
min_by(self, other, Ord::cmp)
841823
}
842824

843825
/// Restrict a value to a certain interval.
@@ -1234,23 +1216,7 @@ where
12341216
F: ~const Destruct,
12351217
K: ~const Destruct,
12361218
{
1237-
cfg_if! {
1238-
if #[cfg(bootstrap)] {
1239-
const fn imp<T, F: ~const FnMut(&T) -> K, K: ~const Ord>(
1240-
f: &mut F,
1241-
(v1, v2): (&T, &T),
1242-
) -> Ordering
1243-
where
1244-
T: ~const Destruct,
1245-
K: ~const Destruct,
1246-
{
1247-
f(v1).cmp(&f(v2))
1248-
}
1249-
min_by(v1, v2, ConstFnMutClosure::new(&mut f, imp))
1250-
} else {
1251-
min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
1252-
}
1253-
}
1219+
min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
12541220
}
12551221

12561222
/// Compares and returns the maximum of two values.

core/src/convert/num.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl_from! { u32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0"
169169
impl_from! { f32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
170170

171171
// bool -> Float
172-
#[stable(feature = "float_from_bool", since = "CURRENT_RUSTC_VERSION")]
172+
#[stable(feature = "float_from_bool", since = "1.68.0")]
173173
#[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
174174
impl const From<bool> for f32 {
175175
/// Converts `bool` to `f32` losslessly.
@@ -178,7 +178,7 @@ impl const From<bool> for f32 {
178178
small as u8 as Self
179179
}
180180
}
181-
#[stable(feature = "float_from_bool", since = "CURRENT_RUSTC_VERSION")]
181+
#[stable(feature = "float_from_bool", since = "1.68.0")]
182182
#[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
183183
impl const From<bool> for f64 {
184184
/// Converts `bool` to `f64` losslessly.

core/src/future/mod.rs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -56,51 +56,6 @@ unsafe impl Send for ResumeTy {}
5656
#[unstable(feature = "gen_future", issue = "50547")]
5757
unsafe impl Sync for ResumeTy {}
5858

59-
/// Wrap a generator in a future.
60-
///
61-
/// This function returns a `GenFuture` underneath, but hides it in `impl Trait` to give
62-
/// better error messages (`impl Future` rather than `GenFuture<[closure.....]>`).
63-
// This is `const` to avoid extra errors after we recover from `const async fn`
64-
#[doc(hidden)]
65-
#[unstable(feature = "gen_future", issue = "50547")]
66-
#[rustc_const_unstable(feature = "gen_future", issue = "50547")]
67-
#[inline]
68-
pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
69-
where
70-
T: crate::ops::Generator<ResumeTy, Yield = ()>,
71-
{
72-
use crate::{
73-
ops::{Generator, GeneratorState},
74-
pin::Pin,
75-
task::Poll,
76-
};
77-
78-
#[rustc_diagnostic_item = "gen_future"]
79-
struct GenFuture<T: Generator<ResumeTy, Yield = ()>>(T);
80-
81-
// We rely on the fact that async/await futures are immovable in order to create
82-
// self-referential borrows in the underlying generator.
83-
impl<T: Generator<ResumeTy, Yield = ()>> !Unpin for GenFuture<T> {}
84-
85-
impl<T: Generator<ResumeTy, Yield = ()>> Future for GenFuture<T> {
86-
type Output = T::Return;
87-
#[track_caller]
88-
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
89-
// SAFETY: Safe because we're !Unpin + !Drop, and this is just a field projection.
90-
let gen = unsafe { Pin::map_unchecked_mut(self, |s| &mut s.0) };
91-
92-
// Resume the generator, turning the `&mut Context` into a `NonNull` raw pointer. The
93-
// `.await` lowering will safely cast that back to a `&mut Context`.
94-
match gen.resume(ResumeTy(NonNull::from(cx).cast::<Context<'static>>())) {
95-
GeneratorState::Yielded(()) => Poll::Pending,
96-
GeneratorState::Complete(x) => Poll::Ready(x),
97-
}
98-
}
99-
}
100-
101-
GenFuture(gen)
102-
}
103-
10459
#[lang = "get_context"]
10560
#[doc(hidden)]
10661
#[unstable(feature = "gen_future", issue = "50547")]

core/src/intrinsics.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ use crate::marker::DiscriminantKind;
5858
use crate::marker::Tuple;
5959
use crate::mem;
6060

61-
#[cfg(not(bootstrap))]
6261
pub mod mir;
6362

6463
// These imports are used for simplifying intra-doc links
@@ -963,7 +962,6 @@ extern "rust-intrinsic" {
963962
/// This intrinsic does not have a stable counterpart.
964963
#[rustc_const_unstable(feature = "const_assert_type2", issue = "none")]
965964
#[rustc_safe_intrinsic]
966-
#[cfg(not(bootstrap))]
967965
pub fn assert_mem_uninitialized_valid<T>();
968966

969967
/// Gets a reference to a static `Location` indicating where it was called.

core/src/intrinsics/mir.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
//!
6161
//! # Examples
6262
//!
63-
#![cfg_attr(bootstrap, doc = "```rust,compile_fail")]
64-
#![cfg_attr(not(bootstrap), doc = "```rust")]
63+
//! ```rust
6564
//! #![feature(core_intrinsics, custom_mir)]
6665
//!
6766
//! extern crate core;
@@ -300,8 +299,7 @@ define!(
300299
///
301300
/// # Examples
302301
///
303-
#[cfg_attr(bootstrap, doc = "```rust,compile_fail")]
304-
#[cfg_attr(not(bootstrap), doc = "```rust")]
302+
/// ```rust
305303
/// #![feature(custom_mir, core_intrinsics)]
306304
///
307305
/// extern crate core;

core/src/iter/sources/once_with.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub struct OnceWith<F> {
7373
gen: Option<F>,
7474
}
7575

76-
#[stable(feature = "iter_once_with_debug", since = "CURRENT_RUSTC_VERSION")]
76+
#[stable(feature = "iter_once_with_debug", since = "1.68.0")]
7777
impl<F> fmt::Debug for OnceWith<F> {
7878
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7979
if self.gen.is_some() {

core/src/iter/sources/repeat_with.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub struct RepeatWith<F> {
7878
repeater: F,
7979
}
8080

81-
#[stable(feature = "iterator_repeat_with_debug", since = "CURRENT_RUSTC_VERSION")]
81+
#[stable(feature = "iterator_repeat_with_debug", since = "1.68.0")]
8282
impl<F> fmt::Debug for RepeatWith<F> {
8383
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8484
f.debug_struct("RepeatWith").finish_non_exhaustive()

core/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
#![feature(cfg_sanitize)]
193193
#![feature(cfg_target_has_atomic)]
194194
#![feature(cfg_target_has_atomic_equal_alignment)]
195-
#![cfg_attr(not(bootstrap), feature(const_closures))]
195+
#![feature(const_closures)]
196196
#![feature(const_fn_floating_point_arithmetic)]
197197
#![feature(const_mut_refs)]
198198
#![feature(const_precise_live_drops)]
@@ -250,7 +250,6 @@
250250
#![feature(sse4a_target_feature)]
251251
#![feature(tbm_target_feature)]
252252
#![feature(wasm_target_feature)]
253-
#![cfg_attr(bootstrap, feature(f16c_target_feature))]
254253

255254
// allow using `core::` in intra-doc links
256255
#[allow(unused_extern_crates)]

0 commit comments

Comments
 (0)