mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
Reorder widening_impl
s to make the doc clearer
This commit is contained in:
parent
d22dd65835
commit
0b3a002805
@ -201,33 +201,33 @@ macro_rules! widening_impl {
|
|||||||
|
|
||||||
#[lang = "i8"]
|
#[lang = "i8"]
|
||||||
impl i8 {
|
impl i8 {
|
||||||
widening_impl! { i8, i16, 8, signed }
|
|
||||||
int_impl! { i8, i8, u8, 8, 7, -128, 127, 2, "-0x7e", "0xa", "0x12", "0x12", "0x48",
|
int_impl! { i8, i8, u8, 8, 7, -128, 127, 2, "-0x7e", "0xa", "0x12", "0x12", "0x48",
|
||||||
"[0x12]", "[0x12]", "", "" }
|
"[0x12]", "[0x12]", "", "" }
|
||||||
|
widening_impl! { i8, i16, 8, signed }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[lang = "i16"]
|
#[lang = "i16"]
|
||||||
impl i16 {
|
impl i16 {
|
||||||
widening_impl! { i16, i32, 16, signed }
|
|
||||||
int_impl! { i16, i16, u16, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234", "0x3412",
|
int_impl! { i16, i16, u16, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234", "0x3412",
|
||||||
"0x2c48", "[0x34, 0x12]", "[0x12, 0x34]", "", "" }
|
"0x2c48", "[0x34, 0x12]", "[0x12, 0x34]", "", "" }
|
||||||
|
widening_impl! { i16, i32, 16, signed }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[lang = "i32"]
|
#[lang = "i32"]
|
||||||
impl i32 {
|
impl i32 {
|
||||||
widening_impl! { i32, i64, 32, signed }
|
|
||||||
int_impl! { i32, i32, u32, 32, 31, -2147483648, 2147483647, 8, "0x10000b3", "0xb301",
|
int_impl! { i32, i32, u32, 32, 31, -2147483648, 2147483647, 8, "0x10000b3", "0xb301",
|
||||||
"0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]",
|
"0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]",
|
||||||
"[0x12, 0x34, 0x56, 0x78]", "", "" }
|
"[0x12, 0x34, 0x56, 0x78]", "", "" }
|
||||||
|
widening_impl! { i32, i64, 32, signed }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[lang = "i64"]
|
#[lang = "i64"]
|
||||||
impl i64 {
|
impl i64 {
|
||||||
widening_impl! { i64, i128, 64, signed }
|
|
||||||
int_impl! { i64, i64, u64, 64, 63, -9223372036854775808, 9223372036854775807, 12,
|
int_impl! { i64, i64, u64, 64, 63, -9223372036854775808, 9223372036854775807, 12,
|
||||||
"0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412",
|
"0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412",
|
||||||
"0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
|
"0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
|
||||||
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]", "", "" }
|
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]", "", "" }
|
||||||
|
widening_impl! { i64, i128, 64, signed }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[lang = "i128"]
|
#[lang = "i128"]
|
||||||
@ -245,31 +245,31 @@ impl i128 {
|
|||||||
#[cfg(target_pointer_width = "16")]
|
#[cfg(target_pointer_width = "16")]
|
||||||
#[lang = "isize"]
|
#[lang = "isize"]
|
||||||
impl isize {
|
impl isize {
|
||||||
widening_impl! { isize, i32, 16, signed }
|
|
||||||
int_impl! { isize, i16, usize, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234",
|
int_impl! { isize, i16, usize, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234",
|
||||||
"0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]",
|
"0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]",
|
||||||
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
||||||
|
widening_impl! { isize, i32, 16, signed }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_pointer_width = "32")]
|
#[cfg(target_pointer_width = "32")]
|
||||||
#[lang = "isize"]
|
#[lang = "isize"]
|
||||||
impl isize {
|
impl isize {
|
||||||
widening_impl! { isize, i64, 32, signed }
|
|
||||||
int_impl! { isize, i32, usize, 32, 31, -2147483648, 2147483647, 8, "0x10000b3", "0xb301",
|
int_impl! { isize, i32, usize, 32, 31, -2147483648, 2147483647, 8, "0x10000b3", "0xb301",
|
||||||
"0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]",
|
"0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]",
|
||||||
"[0x12, 0x34, 0x56, 0x78]",
|
"[0x12, 0x34, 0x56, 0x78]",
|
||||||
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
||||||
|
widening_impl! { isize, i64, 32, signed }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_pointer_width = "64")]
|
#[cfg(target_pointer_width = "64")]
|
||||||
#[lang = "isize"]
|
#[lang = "isize"]
|
||||||
impl isize {
|
impl isize {
|
||||||
widening_impl! { isize, i128, 64, signed }
|
|
||||||
int_impl! { isize, i64, usize, 64, 63, -9223372036854775808, 9223372036854775807,
|
int_impl! { isize, i64, usize, 64, 63, -9223372036854775808, 9223372036854775807,
|
||||||
12, "0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412",
|
12, "0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412",
|
||||||
"0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
|
"0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
|
||||||
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
|
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
|
||||||
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
||||||
|
widening_impl! { isize, i128, 64, signed }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// If 6th bit set ascii is upper case.
|
/// If 6th bit set ascii is upper case.
|
||||||
@ -277,9 +277,9 @@ const ASCII_CASE_MASK: u8 = 0b0010_0000;
|
|||||||
|
|
||||||
#[lang = "u8"]
|
#[lang = "u8"]
|
||||||
impl u8 {
|
impl u8 {
|
||||||
widening_impl! { u8, u16, 8, unsigned }
|
|
||||||
uint_impl! { u8, u8, i8, 8, 255, 2, "0x82", "0xa", "0x12", "0x12", "0x48", "[0x12]",
|
uint_impl! { u8, u8, i8, 8, 255, 2, "0x82", "0xa", "0x12", "0x12", "0x48", "[0x12]",
|
||||||
"[0x12]", "", "" }
|
"[0x12]", "", "" }
|
||||||
|
widening_impl! { u8, u16, 8, unsigned }
|
||||||
|
|
||||||
/// Checks if the value is within the ASCII range.
|
/// Checks if the value is within the ASCII range.
|
||||||
///
|
///
|
||||||
@ -826,26 +826,26 @@ impl u8 {
|
|||||||
|
|
||||||
#[lang = "u16"]
|
#[lang = "u16"]
|
||||||
impl u16 {
|
impl u16 {
|
||||||
widening_impl! { u16, u32, 16, unsigned }
|
|
||||||
uint_impl! { u16, u16, i16, 16, 65535, 4, "0xa003", "0x3a", "0x1234", "0x3412", "0x2c48",
|
uint_impl! { u16, u16, i16, 16, 65535, 4, "0xa003", "0x3a", "0x1234", "0x3412", "0x2c48",
|
||||||
"[0x34, 0x12]", "[0x12, 0x34]", "", "" }
|
"[0x34, 0x12]", "[0x12, 0x34]", "", "" }
|
||||||
|
widening_impl! { u16, u32, 16, unsigned }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[lang = "u32"]
|
#[lang = "u32"]
|
||||||
impl u32 {
|
impl u32 {
|
||||||
widening_impl! { u32, u64, 32, unsigned }
|
|
||||||
uint_impl! { u32, u32, i32, 32, 4294967295, 8, "0x10000b3", "0xb301", "0x12345678",
|
uint_impl! { u32, u32, i32, 32, 4294967295, 8, "0x10000b3", "0xb301", "0x12345678",
|
||||||
"0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]", "", "" }
|
"0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]", "", "" }
|
||||||
|
widening_impl! { u32, u64, 32, unsigned }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[lang = "u64"]
|
#[lang = "u64"]
|
||||||
impl u64 {
|
impl u64 {
|
||||||
widening_impl! { u64, u128, 64, unsigned }
|
|
||||||
uint_impl! { u64, u64, i64, 64, 18446744073709551615, 12, "0xaa00000000006e1", "0x6e10aa",
|
uint_impl! { u64, u64, i64, 64, 18446744073709551615, 12, "0xaa00000000006e1", "0x6e10aa",
|
||||||
"0x1234567890123456", "0x5634129078563412", "0x6a2c48091e6a2c48",
|
"0x1234567890123456", "0x5634129078563412", "0x6a2c48091e6a2c48",
|
||||||
"[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
|
"[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
|
||||||
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
|
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
|
||||||
"", ""}
|
"", ""}
|
||||||
|
widening_impl! { u64, u128, 64, unsigned }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[lang = "u128"]
|
#[lang = "u128"]
|
||||||
@ -863,29 +863,29 @@ impl u128 {
|
|||||||
#[cfg(target_pointer_width = "16")]
|
#[cfg(target_pointer_width = "16")]
|
||||||
#[lang = "usize"]
|
#[lang = "usize"]
|
||||||
impl usize {
|
impl usize {
|
||||||
widening_impl! { usize, u32, 16, unsigned }
|
|
||||||
uint_impl! { usize, u16, isize, 16, 65535, 4, "0xa003", "0x3a", "0x1234", "0x3412", "0x2c48",
|
uint_impl! { usize, u16, isize, 16, 65535, 4, "0xa003", "0x3a", "0x1234", "0x3412", "0x2c48",
|
||||||
"[0x34, 0x12]", "[0x12, 0x34]",
|
"[0x34, 0x12]", "[0x12, 0x34]",
|
||||||
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
||||||
|
widening_impl! { usize, u32, 16, unsigned }
|
||||||
}
|
}
|
||||||
#[cfg(target_pointer_width = "32")]
|
#[cfg(target_pointer_width = "32")]
|
||||||
#[lang = "usize"]
|
#[lang = "usize"]
|
||||||
impl usize {
|
impl usize {
|
||||||
widening_impl! { usize, u64, 32, unsigned }
|
|
||||||
uint_impl! { usize, u32, isize, 32, 4294967295, 8, "0x10000b3", "0xb301", "0x12345678",
|
uint_impl! { usize, u32, isize, 32, 4294967295, 8, "0x10000b3", "0xb301", "0x12345678",
|
||||||
"0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]",
|
"0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]",
|
||||||
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
||||||
|
widening_impl! { usize, u64, 32, unsigned }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_pointer_width = "64")]
|
#[cfg(target_pointer_width = "64")]
|
||||||
#[lang = "usize"]
|
#[lang = "usize"]
|
||||||
impl usize {
|
impl usize {
|
||||||
widening_impl! { usize, u128, 64, unsigned }
|
|
||||||
uint_impl! { usize, u64, isize, 64, 18446744073709551615, 12, "0xaa00000000006e1", "0x6e10aa",
|
uint_impl! { usize, u64, isize, 64, 18446744073709551615, 12, "0xaa00000000006e1", "0x6e10aa",
|
||||||
"0x1234567890123456", "0x5634129078563412", "0x6a2c48091e6a2c48",
|
"0x1234567890123456", "0x5634129078563412", "0x6a2c48091e6a2c48",
|
||||||
"[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
|
"[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
|
||||||
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
|
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]",
|
||||||
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
|
||||||
|
widening_impl! { usize, u128, 64, unsigned }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A classification of floating point numbers.
|
/// A classification of floating point numbers.
|
||||||
|
Loading…
Reference in New Issue
Block a user