Skip to content

Commit d14171d

Browse files
committed
Auto merge of rust-lang#125574 - matthiaskrgr:rollup-1oljoup, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#125307 (tidy: stop special-casing tests/ui entry limit) - rust-lang#125375 (Create a triagebot ping group for Rust for Linux) - rust-lang#125473 (fix(opt-dist): respect existing config.toml) - rust-lang#125508 (Stop SRoA'ing `DynMetadata` in MIR) - rust-lang#125561 (Stabilize `slice_flatten`) - rust-lang#125571 (f32: use constants instead of reassigning a dummy value as PI) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8981ee4 + 3e545bc commit d14171d

File tree

6 files changed

+8
-15
lines changed

6 files changed

+8
-15
lines changed

alloc/src/vec/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -2643,15 +2643,13 @@ impl<T, A: Allocator, const N: usize> Vec<[T; N], A> {
26432643
/// # Examples
26442644
///
26452645
/// ```
2646-
/// #![feature(slice_flatten)]
2647-
///
26482646
/// let mut vec = vec![[1, 2, 3], [4, 5, 6], [7, 8, 9]];
26492647
/// assert_eq!(vec.pop(), Some([7, 8, 9]));
26502648
///
26512649
/// let mut flattened = vec.into_flattened();
26522650
/// assert_eq!(flattened.pop(), Some(6));
26532651
/// ```
2654-
#[unstable(feature = "slice_flatten", issue = "95629")]
2652+
#[stable(feature = "slice_flatten", since = "CURRENT_RUSTC_VERSION")]
26552653
pub fn into_flattened(self) -> Vec<T, A> {
26562654
let (ptr, len, cap, alloc) = self.into_raw_parts_with_alloc();
26572655
let (new_len, new_cap) = if T::IS_ZST {

alloc/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#![feature(const_str_from_utf8)]
3737
#![feature(panic_update_hook)]
3838
#![feature(pointer_is_aligned_to)]
39-
#![feature(slice_flatten)]
4039
#![feature(thin_box)]
4140
#![feature(strict_provenance)]
4241
#![feature(drain_keep_rest)]

core/src/num/f32.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,8 @@ impl f32 {
901901
#[stable(feature = "f32_deg_rad_conversions", since = "1.7.0")]
902902
#[inline]
903903
pub fn to_radians(self) -> f32 {
904-
let value: f32 = consts::PI;
905-
self * (value / 180.0f32)
904+
const RADS_PER_DEG: f32 = consts::PI / 180.0;
905+
self * RADS_PER_DEG
906906
}
907907

908908
/// Returns the maximum of the two numbers, ignoring NaN.

core/src/num/f64.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,8 @@ impl f64 {
912912
#[stable(feature = "rust1", since = "1.0.0")]
913913
#[inline]
914914
pub fn to_radians(self) -> f64 {
915-
let value: f64 = consts::PI;
916-
self * (value / 180.0)
915+
const RADS_PER_DEG: f64 = consts::PI / 180.0;
916+
self * RADS_PER_DEG
917917
}
918918

919919
/// Returns the maximum of the two numbers, ignoring NaN.

core/src/slice/mod.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -4531,8 +4531,6 @@ impl<T, const N: usize> [[T; N]] {
45314531
/// # Examples
45324532
///
45334533
/// ```
4534-
/// #![feature(slice_flatten)]
4535-
///
45364534
/// assert_eq!([[1, 2, 3], [4, 5, 6]].as_flattened(), &[1, 2, 3, 4, 5, 6]);
45374535
///
45384536
/// assert_eq!(
@@ -4546,7 +4544,8 @@ impl<T, const N: usize> [[T; N]] {
45464544
/// let empty_slice_of_arrays: &[[u32; 10]] = &[];
45474545
/// assert!(empty_slice_of_arrays.as_flattened().is_empty());
45484546
/// ```
4549-
#[unstable(feature = "slice_flatten", issue = "95629")]
4547+
#[stable(feature = "slice_flatten", since = "CURRENT_RUSTC_VERSION")]
4548+
#[rustc_const_unstable(feature = "const_slice_flatten", issue = "95629")]
45504549
pub const fn as_flattened(&self) -> &[T] {
45514550
let len = if T::IS_ZST {
45524551
self.len().checked_mul(N).expect("slice len overflow")
@@ -4572,8 +4571,6 @@ impl<T, const N: usize> [[T; N]] {
45724571
/// # Examples
45734572
///
45744573
/// ```
4575-
/// #![feature(slice_flatten)]
4576-
///
45774574
/// fn add_5_to_all(slice: &mut [i32]) {
45784575
/// for i in slice {
45794576
/// *i += 5;
@@ -4584,7 +4581,7 @@ impl<T, const N: usize> [[T; N]] {
45844581
/// add_5_to_all(array.as_flattened_mut());
45854582
/// assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
45864583
/// ```
4587-
#[unstable(feature = "slice_flatten", issue = "95629")]
4584+
#[stable(feature = "slice_flatten", since = "CURRENT_RUSTC_VERSION")]
45884585
pub fn as_flattened_mut(&mut self) -> &mut [T] {
45894586
let len = if T::IS_ZST {
45904587
self.len().checked_mul(N).expect("slice len overflow")

core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
#![feature(const_array_from_ref)]
111111
#![feature(const_slice_from_ref)]
112112
#![feature(waker_getters)]
113-
#![feature(slice_flatten)]
114113
#![feature(error_generic_member_access)]
115114
#![feature(error_in_core)]
116115
#![feature(trait_upcasting)]

0 commit comments

Comments
 (0)