Rollup merge of #78730 - kornelski:not-inverse, r=Dylan-DPC
Expand explanation of reverse_bits Original documentation only rephrased the function name
This commit is contained in:
commit
8f70cad032
2 changed files with 6 additions and 2 deletions
|
@ -274,7 +274,8 @@ assert_eq!(m, ", $swapped, ");
|
||||||
}
|
}
|
||||||
|
|
||||||
doc_comment! {
|
doc_comment! {
|
||||||
concat!("Reverses the bit pattern of the integer.
|
concat!("Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,
|
||||||
|
second least-significant bit becomes second most-significant bit, etc.
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
|
@ -285,6 +286,7 @@ let n = ", $swap_op, stringify!($SelfT), ";
|
||||||
let m = n.reverse_bits();
|
let m = n.reverse_bits();
|
||||||
|
|
||||||
assert_eq!(m, ", $reversed, ");
|
assert_eq!(m, ", $reversed, ");
|
||||||
|
assert_eq!(0, 0", stringify!($SelfT), ".reverse_bits());
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "reverse_bits", since = "1.37.0")]
|
#[stable(feature = "reverse_bits", since = "1.37.0")]
|
||||||
#[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")]
|
#[rustc_const_stable(feature = "const_int_methods", since = "1.32.0")]
|
||||||
|
|
|
@ -272,7 +272,8 @@ assert_eq!(m, ", $swapped, ");
|
||||||
}
|
}
|
||||||
|
|
||||||
doc_comment! {
|
doc_comment! {
|
||||||
concat!("Reverses the bit pattern of the integer.
|
concat!("Reverses the order of bits in the integer. The least significant bit becomes the most significant bit,
|
||||||
|
second least-significant bit becomes second most-significant bit, etc.
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
|
@ -283,6 +284,7 @@ let n = ", $swap_op, stringify!($SelfT), ";
|
||||||
let m = n.reverse_bits();
|
let m = n.reverse_bits();
|
||||||
|
|
||||||
assert_eq!(m, ", $reversed, ");
|
assert_eq!(m, ", $reversed, ");
|
||||||
|
assert_eq!(0, 0", stringify!($SelfT), ".reverse_bits());
|
||||||
```"),
|
```"),
|
||||||
#[stable(feature = "reverse_bits", since = "1.37.0")]
|
#[stable(feature = "reverse_bits", since = "1.37.0")]
|
||||||
#[rustc_const_stable(feature = "const_math", since = "1.32.0")]
|
#[rustc_const_stable(feature = "const_math", since = "1.32.0")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue