Skip to content

Commit 1c26bbf

Browse files
committed
Stabilize reverse_bits feature
1 parent 3ade426 commit 1c26bbf

File tree

8 files changed

+11
-22
lines changed

8 files changed

+11
-22
lines changed

src/libcore/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@
120120
#![feature(const_str_len)]
121121
#![feature(const_int_conversion)]
122122
#![feature(const_transmute)]
123-
#![feature(reverse_bits)]
124123
#![feature(non_exhaustive)]
125124
#![feature(structural_match)]
126125
#![feature(abi_unadjusted)]

src/libcore/num/mod.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -463,15 +463,12 @@ assert_eq!(m, ", $swapped, ");
463463
Basic usage:
464464
465465
```
466-
#![feature(reverse_bits)]
467-
468466
let n = ", $swap_op, stringify!($SelfT), ";
469467
let m = n.reverse_bits();
470468
471469
assert_eq!(m, ", $reversed, ");
472470
```"),
473-
#[unstable(feature = "reverse_bits", issue = "48763")]
474-
#[rustc_const_unstable(feature = "const_int_conversion")]
471+
#[stable(feature = "reverse_bits", since = "1.37.0")]
475472
#[inline]
476473
#[must_use]
477474
pub const fn reverse_bits(self) -> Self {
@@ -2514,14 +2511,12 @@ assert_eq!(m, ", $swapped, ");
25142511
Basic usage:
25152512
25162513
```
2517-
#![feature(reverse_bits)]
2518-
25192514
let n = ", $swap_op, stringify!($SelfT), ";
25202515
let m = n.reverse_bits();
25212516
25222517
assert_eq!(m, ", $reversed, ");
25232518
```"),
2524-
#[unstable(feature = "reverse_bits", issue = "48763")]
2519+
#[stable(feature = "reverse_bits", since = "1.37.0")]
25252520
#[inline]
25262521
#[must_use]
25272522
pub const fn reverse_bits(self) -> Self {

src/libcore/num/wrapping.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,6 @@ assert_eq!(n.trailing_zeros(), 3);
511511
/// Basic usage:
512512
///
513513
/// ```
514-
/// #![feature(reverse_bits)]
515514
/// use std::num::Wrapping;
516515
///
517516
/// let n = Wrapping(0b0000000_01010101i16);
@@ -522,7 +521,7 @@ assert_eq!(n.trailing_zeros(), 3);
522521
/// assert_eq!(m.0 as u16, 0b10101010_00000000);
523522
/// assert_eq!(m, Wrapping(-22016));
524523
/// ```
525-
#[unstable(feature = "reverse_bits", issue = "48763")]
524+
#[stable(feature = "reverse_bits", since = "1.37.0")]
526525
#[inline]
527526
#[must_use]
528527
pub const fn reverse_bits(self) -> Self {

src/libcore/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#![feature(test)]
2626
#![feature(trusted_len)]
2727
#![feature(try_trait)]
28-
#![feature(reverse_bits)]
2928
#![feature(inner_deref)]
3029
#![feature(slice_internals)]
3130
#![feature(slice_partition_dedup)]

src/librustc_mir/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2222
#![feature(unicode_internals)]
2323
#![feature(step_trait)]
2424
#![feature(slice_concat_ext)]
25-
#![feature(reverse_bits)]
2625
#![feature(try_blocks)]
2726

2827
#![recursion_limit="256"]

src/test/run-pass/const-int-conversion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_int_conversion, reverse_bits)]
1+
#![feature(const_int_conversion)]
22

33
const REVERSE: u32 = 0x12345678_u32.reverse_bits();
44
const FROM_BE_BYTES: i32 = i32::from_be_bytes([0x12, 0x34, 0x56, 0x78]);

src/test/ui/consts/const-int-conversion.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(reverse_bits)]
2-
31
fn main() {
42
let x: &'static i32 = &(5_i32.reverse_bits());
53
//~^ ERROR temporary value dropped while borrowed

src/test/ui/consts/const-int-conversion.stderr

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0716]: temporary value dropped while borrowed
2-
--> $DIR/const-int-conversion.rs:4:28
2+
--> $DIR/const-int-conversion.rs:2:28
33
|
44
LL | let x: &'static i32 = &(5_i32.reverse_bits());
55
| ------------ ^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -10,7 +10,7 @@ LL | }
1010
| - temporary value is freed at the end of this statement
1111

1212
error[E0716]: temporary value dropped while borrowed
13-
--> $DIR/const-int-conversion.rs:6:28
13+
--> $DIR/const-int-conversion.rs:4:28
1414
|
1515
LL | let y: &'static i32 = &(i32::from_be_bytes([0x12, 0x34, 0x56, 0x78]));
1616
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -21,7 +21,7 @@ LL | }
2121
| - temporary value is freed at the end of this statement
2222

2323
error[E0716]: temporary value dropped while borrowed
24-
--> $DIR/const-int-conversion.rs:8:28
24+
--> $DIR/const-int-conversion.rs:6:28
2525
|
2626
LL | let z: &'static i32 = &(i32::from_le_bytes([0x12, 0x34, 0x56, 0x78]));
2727
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -32,7 +32,7 @@ LL | }
3232
| - temporary value is freed at the end of this statement
3333

3434
error[E0716]: temporary value dropped while borrowed
35-
--> $DIR/const-int-conversion.rs:10:28
35+
--> $DIR/const-int-conversion.rs:8:28
3636
|
3737
LL | let a: &'static i32 = &(i32::from_be(i32::from_ne_bytes([0x80, 0, 0, 0])));
3838
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -43,7 +43,7 @@ LL | }
4343
| - temporary value is freed at the end of this statement
4444

4545
error[E0716]: temporary value dropped while borrowed
46-
--> $DIR/const-int-conversion.rs:12:29
46+
--> $DIR/const-int-conversion.rs:10:29
4747
|
4848
LL | let b: &'static [u8] = &(0x12_34_56_78_i32.to_be_bytes());
4949
| ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -54,7 +54,7 @@ LL | }
5454
| - temporary value is freed at the end of this statement
5555

5656
error[E0716]: temporary value dropped while borrowed
57-
--> $DIR/const-int-conversion.rs:14:29
57+
--> $DIR/const-int-conversion.rs:12:29
5858
|
5959
LL | let c: &'static [u8] = &(0x12_34_56_78_i32.to_le_bytes());
6060
| ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -65,7 +65,7 @@ LL | }
6565
| - temporary value is freed at the end of this statement
6666

6767
error[E0716]: temporary value dropped while borrowed
68-
--> $DIR/const-int-conversion.rs:16:29
68+
--> $DIR/const-int-conversion.rs:14:29
6969
|
7070
LL | let d: &'static [u8] = &(i32::min_value().to_be().to_ne_bytes());
7171
| ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use

0 commit comments

Comments
 (0)