Rollup merge of #129555 - RalfJung:const_float_bits_conv, r=dtolnay · qinheping/verify-rust-std@2feca1e (original) (raw)
5 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -122,7 +122,6 @@ | ||
122 | 122 | #![feature(const_cell_into_inner)] |
123 | 123 | #![feature(const_eval_select)] |
124 | 124 | #![feature(const_exact_div)] |
125 | -#![feature(const_float_bits_conv)] | |
126 | 125 | #![feature(const_float_classify)] |
127 | 126 | #![feature(const_fmt_arguments_new)] |
128 | 127 | #![feature(const_hash)] |
@@ -166,6 +165,8 @@ | ||
166 | 165 | #![feature(coverage_attribute)] |
167 | 166 | #![feature(do_not_recommend)] |
168 | 167 | #![feature(duration_consts_float)] |
168 | +#![feature(f128_const)] | |
169 | +#![feature(f16_const)] | |
169 | 170 | #![feature(internal_impls_macro)] |
170 | 171 | #![feature(ip)] |
171 | 172 | #![feature(is_ascii_octdigit)] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -914,7 +914,7 @@ impl f128 { | ||
914 | 914 | /// ``` |
915 | 915 | #[inline] |
916 | 916 | #[unstable(feature = "f128", issue = "116909")] |
917 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
917 | +#[rustc_const_unstable(feature = "f128_const", issue = "116909")] | |
918 | 918 | #[must_use = "this returns the result of the operation, without modifying the original"] |
919 | 919 | pub const fn to_bits(self) -> u128 { |
920 | 920 | // SAFETY: `u128` is a plain old datatype so we can always transmute to it. |
@@ -963,7 +963,7 @@ impl f128 { | ||
963 | 963 | #[inline] |
964 | 964 | #[must_use] |
965 | 965 | #[unstable(feature = "f128", issue = "116909")] |
966 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
966 | +#[rustc_const_unstable(feature = "f128_const", issue = "116909")] | |
967 | 967 | pub const fn from_bits(v: u128) -> Self { |
968 | 968 | // It turns out the safety issues with sNaN were overblown! Hooray! |
969 | 969 | // SAFETY: `u128` is a plain old datatype so we can always transmute from it. |
@@ -990,7 +990,7 @@ impl f128 { | ||
990 | 990 | /// ``` |
991 | 991 | #[inline] |
992 | 992 | #[unstable(feature = "f128", issue = "116909")] |
993 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
993 | +#[rustc_const_unstable(feature = "f128_const", issue = "116909")] | |
994 | 994 | #[must_use = "this returns the result of the operation, without modifying the original"] |
995 | 995 | pub const fn to_be_bytes(self) -> [u8; 16] { |
996 | 996 | self.to_bits().to_be_bytes() |
@@ -1016,7 +1016,7 @@ impl f128 { | ||
1016 | 1016 | /// ``` |
1017 | 1017 | #[inline] |
1018 | 1018 | #[unstable(feature = "f128", issue = "116909")] |
1019 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1019 | +#[rustc_const_unstable(feature = "f128_const", issue = "116909")] | |
1020 | 1020 | #[must_use = "this returns the result of the operation, without modifying the original"] |
1021 | 1021 | pub const fn to_le_bytes(self) -> [u8; 16] { |
1022 | 1022 | self.to_bits().to_le_bytes() |
@@ -1053,7 +1053,7 @@ impl f128 { | ||
1053 | 1053 | /// ``` |
1054 | 1054 | #[inline] |
1055 | 1055 | #[unstable(feature = "f128", issue = "116909")] |
1056 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1056 | +#[rustc_const_unstable(feature = "f128_const", issue = "116909")] | |
1057 | 1057 | #[must_use = "this returns the result of the operation, without modifying the original"] |
1058 | 1058 | pub const fn to_ne_bytes(self) -> [u8; 16] { |
1059 | 1059 | self.to_bits().to_ne_bytes() |
@@ -1081,7 +1081,7 @@ impl f128 { | ||
1081 | 1081 | #[inline] |
1082 | 1082 | #[must_use] |
1083 | 1083 | #[unstable(feature = "f128", issue = "116909")] |
1084 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1084 | +#[rustc_const_unstable(feature = "f128_const", issue = "116909")] | |
1085 | 1085 | pub const fn from_be_bytes(bytes: [u8; 16]) -> Self { |
1086 | 1086 | Self::from_bits(u128::from_be_bytes(bytes)) |
1087 | 1087 | } |
@@ -1108,7 +1108,7 @@ impl f128 { | ||
1108 | 1108 | #[inline] |
1109 | 1109 | #[must_use] |
1110 | 1110 | #[unstable(feature = "f128", issue = "116909")] |
1111 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1111 | +#[rustc_const_unstable(feature = "f128_const", issue = "116909")] | |
1112 | 1112 | pub const fn from_le_bytes(bytes: [u8; 16]) -> Self { |
1113 | 1113 | Self::from_bits(u128::from_le_bytes(bytes)) |
1114 | 1114 | } |
@@ -1145,7 +1145,7 @@ impl f128 { | ||
1145 | 1145 | #[inline] |
1146 | 1146 | #[must_use] |
1147 | 1147 | #[unstable(feature = "f128", issue = "116909")] |
1148 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1148 | +#[rustc_const_unstable(feature = "f128_const", issue = "116909")] | |
1149 | 1149 | pub const fn from_ne_bytes(bytes: [u8; 16]) -> Self { |
1150 | 1150 | Self::from_bits(u128::from_ne_bytes(bytes)) |
1151 | 1151 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -925,7 +925,7 @@ impl f16 { | ||
925 | 925 | /// ``` |
926 | 926 | #[inline] |
927 | 927 | #[unstable(feature = "f16", issue = "116909")] |
928 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
928 | +#[rustc_const_unstable(feature = "f16_const", issue = "116909")] | |
929 | 929 | #[must_use = "this returns the result of the operation, without modifying the original"] |
930 | 930 | pub const fn to_bits(self) -> u16 { |
931 | 931 | // SAFETY: `u16` is a plain old datatype so we can always transmute to it. |
@@ -973,7 +973,7 @@ impl f16 { | ||
973 | 973 | #[inline] |
974 | 974 | #[must_use] |
975 | 975 | #[unstable(feature = "f16", issue = "116909")] |
976 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
976 | +#[rustc_const_unstable(feature = "f16_const", issue = "116909")] | |
977 | 977 | pub const fn from_bits(v: u16) -> Self { |
978 | 978 | // It turns out the safety issues with sNaN were overblown! Hooray! |
979 | 979 | // SAFETY: `u16` is a plain old datatype so we can always transmute from it. |
@@ -999,7 +999,7 @@ impl f16 { | ||
999 | 999 | /// ``` |
1000 | 1000 | #[inline] |
1001 | 1001 | #[unstable(feature = "f16", issue = "116909")] |
1002 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1002 | +#[rustc_const_unstable(feature = "f16_const", issue = "116909")] | |
1003 | 1003 | #[must_use = "this returns the result of the operation, without modifying the original"] |
1004 | 1004 | pub const fn to_be_bytes(self) -> [u8; 2] { |
1005 | 1005 | self.to_bits().to_be_bytes() |
@@ -1024,7 +1024,7 @@ impl f16 { | ||
1024 | 1024 | /// ``` |
1025 | 1025 | #[inline] |
1026 | 1026 | #[unstable(feature = "f16", issue = "116909")] |
1027 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1027 | +#[rustc_const_unstable(feature = "f16_const", issue = "116909")] | |
1028 | 1028 | #[must_use = "this returns the result of the operation, without modifying the original"] |
1029 | 1029 | pub const fn to_le_bytes(self) -> [u8; 2] { |
1030 | 1030 | self.to_bits().to_le_bytes() |
@@ -1062,7 +1062,7 @@ impl f16 { | ||
1062 | 1062 | /// ``` |
1063 | 1063 | #[inline] |
1064 | 1064 | #[unstable(feature = "f16", issue = "116909")] |
1065 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1065 | +#[rustc_const_unstable(feature = "f16_const", issue = "116909")] | |
1066 | 1066 | #[must_use = "this returns the result of the operation, without modifying the original"] |
1067 | 1067 | pub const fn to_ne_bytes(self) -> [u8; 2] { |
1068 | 1068 | self.to_bits().to_ne_bytes() |
@@ -1086,7 +1086,7 @@ impl f16 { | ||
1086 | 1086 | #[inline] |
1087 | 1087 | #[must_use] |
1088 | 1088 | #[unstable(feature = "f16", issue = "116909")] |
1089 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1089 | +#[rustc_const_unstable(feature = "f16_const", issue = "116909")] | |
1090 | 1090 | pub const fn from_be_bytes(bytes: [u8; 2]) -> Self { |
1091 | 1091 | Self::from_bits(u16::from_be_bytes(bytes)) |
1092 | 1092 | } |
@@ -1109,7 +1109,7 @@ impl f16 { | ||
1109 | 1109 | #[inline] |
1110 | 1110 | #[must_use] |
1111 | 1111 | #[unstable(feature = "f16", issue = "116909")] |
1112 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1112 | +#[rustc_const_unstable(feature = "f16_const", issue = "116909")] | |
1113 | 1113 | pub const fn from_le_bytes(bytes: [u8; 2]) -> Self { |
1114 | 1114 | Self::from_bits(u16::from_le_bytes(bytes)) |
1115 | 1115 | } |
@@ -1143,7 +1143,7 @@ impl f16 { | ||
1143 | 1143 | #[inline] |
1144 | 1144 | #[must_use] |
1145 | 1145 | #[unstable(feature = "f16", issue = "116909")] |
1146 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1146 | +#[rustc_const_unstable(feature = "f16_const", issue = "116909")] | |
1147 | 1147 | pub const fn from_ne_bytes(bytes: [u8; 2]) -> Self { |
1148 | 1148 | Self::from_bits(u16::from_ne_bytes(bytes)) |
1149 | 1149 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1115,7 +1115,7 @@ impl f32 { | ||
1115 | 1115 | #[must_use = "this returns the result of the operation, \ |
1116 | 1116 | without modifying the original"] |
1117 | 1117 | #[stable(feature = "float_bits_conv", since = "1.20.0")] |
1118 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1118 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1119 | 1119 | #[inline] |
1120 | 1120 | pub const fn to_bits(self) -> u32 { |
1121 | 1121 | // SAFETY: `u32` is a plain old datatype so we can always transmute to it. |
@@ -1159,7 +1159,7 @@ impl f32 { | ||
1159 | 1159 | /// assert_eq!(v, 12.5); |
1160 | 1160 | /// ``` |
1161 | 1161 | #[stable(feature = "float_bits_conv", since = "1.20.0")] |
1162 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1162 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1163 | 1163 | #[must_use] |
1164 | 1164 | #[inline] |
1165 | 1165 | pub const fn from_bits(v: u32) -> Self { |
@@ -1183,7 +1183,7 @@ impl f32 { | ||
1183 | 1183 | #[must_use = "this returns the result of the operation, \ |
1184 | 1184 | without modifying the original"] |
1185 | 1185 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1186 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1186 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1187 | 1187 | #[inline] |
1188 | 1188 | pub const fn to_be_bytes(self) -> [u8; 4] { |
1189 | 1189 | self.to_bits().to_be_bytes() |
@@ -1204,7 +1204,7 @@ impl f32 { | ||
1204 | 1204 | #[must_use = "this returns the result of the operation, \ |
1205 | 1205 | without modifying the original"] |
1206 | 1206 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1207 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1207 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1208 | 1208 | #[inline] |
1209 | 1209 | pub const fn to_le_bytes(self) -> [u8; 4] { |
1210 | 1210 | self.to_bits().to_le_bytes() |
@@ -1238,7 +1238,7 @@ impl f32 { | ||
1238 | 1238 | #[must_use = "this returns the result of the operation, \ |
1239 | 1239 | without modifying the original"] |
1240 | 1240 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1241 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1241 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1242 | 1242 | #[inline] |
1243 | 1243 | pub const fn to_ne_bytes(self) -> [u8; 4] { |
1244 | 1244 | self.to_bits().to_ne_bytes() |
@@ -1256,7 +1256,7 @@ impl f32 { | ||
1256 | 1256 | /// assert_eq!(value, 12.5); |
1257 | 1257 | /// ``` |
1258 | 1258 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1259 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1259 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1260 | 1260 | #[must_use] |
1261 | 1261 | #[inline] |
1262 | 1262 | pub const fn from_be_bytes(bytes: [u8; 4]) -> Self { |
@@ -1275,7 +1275,7 @@ impl f32 { | ||
1275 | 1275 | /// assert_eq!(value, 12.5); |
1276 | 1276 | /// ``` |
1277 | 1277 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1278 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1278 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1279 | 1279 | #[must_use] |
1280 | 1280 | #[inline] |
1281 | 1281 | pub const fn from_le_bytes(bytes: [u8; 4]) -> Self { |
@@ -1305,7 +1305,7 @@ impl f32 { | ||
1305 | 1305 | /// assert_eq!(value, 12.5); |
1306 | 1306 | /// ``` |
1307 | 1307 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1308 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1308 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1309 | 1309 | #[must_use] |
1310 | 1310 | #[inline] |
1311 | 1311 | pub const fn from_ne_bytes(bytes: [u8; 4]) -> Self { |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1111,7 +1111,7 @@ impl f64 { | ||
1111 | 1111 | #[must_use = "this returns the result of the operation, \ |
1112 | 1112 | without modifying the original"] |
1113 | 1113 | #[stable(feature = "float_bits_conv", since = "1.20.0")] |
1114 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1114 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1115 | 1115 | #[inline] |
1116 | 1116 | pub const fn to_bits(self) -> u64 { |
1117 | 1117 | // SAFETY: `u64` is a plain old datatype so we can always transmute to it. |
@@ -1155,7 +1155,7 @@ impl f64 { | ||
1155 | 1155 | /// assert_eq!(v, 12.5); |
1156 | 1156 | /// ``` |
1157 | 1157 | #[stable(feature = "float_bits_conv", since = "1.20.0")] |
1158 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1158 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1159 | 1159 | #[must_use] |
1160 | 1160 | #[inline] |
1161 | 1161 | pub const fn from_bits(v: u64) -> Self { |
@@ -1179,7 +1179,7 @@ impl f64 { | ||
1179 | 1179 | #[must_use = "this returns the result of the operation, \ |
1180 | 1180 | without modifying the original"] |
1181 | 1181 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1182 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1182 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1183 | 1183 | #[inline] |
1184 | 1184 | pub const fn to_be_bytes(self) -> [u8; 8] { |
1185 | 1185 | self.to_bits().to_be_bytes() |
@@ -1200,7 +1200,7 @@ impl f64 { | ||
1200 | 1200 | #[must_use = "this returns the result of the operation, \ |
1201 | 1201 | without modifying the original"] |
1202 | 1202 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1203 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1203 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1204 | 1204 | #[inline] |
1205 | 1205 | pub const fn to_le_bytes(self) -> [u8; 8] { |
1206 | 1206 | self.to_bits().to_le_bytes() |
@@ -1234,7 +1234,7 @@ impl f64 { | ||
1234 | 1234 | #[must_use = "this returns the result of the operation, \ |
1235 | 1235 | without modifying the original"] |
1236 | 1236 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1237 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1237 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1238 | 1238 | #[inline] |
1239 | 1239 | pub const fn to_ne_bytes(self) -> [u8; 8] { |
1240 | 1240 | self.to_bits().to_ne_bytes() |
@@ -1252,7 +1252,7 @@ impl f64 { | ||
1252 | 1252 | /// assert_eq!(value, 12.5); |
1253 | 1253 | /// ``` |
1254 | 1254 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1255 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1255 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1256 | 1256 | #[must_use] |
1257 | 1257 | #[inline] |
1258 | 1258 | pub const fn from_be_bytes(bytes: [u8; 8]) -> Self { |
@@ -1271,7 +1271,7 @@ impl f64 { | ||
1271 | 1271 | /// assert_eq!(value, 12.5); |
1272 | 1272 | /// ``` |
1273 | 1273 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1274 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1274 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1275 | 1275 | #[must_use] |
1276 | 1276 | #[inline] |
1277 | 1277 | pub const fn from_le_bytes(bytes: [u8; 8]) -> Self { |
@@ -1301,7 +1301,7 @@ impl f64 { | ||
1301 | 1301 | /// assert_eq!(value, 12.5); |
1302 | 1302 | /// ``` |
1303 | 1303 | #[stable(feature = "float_to_from_bytes", since = "1.40.0")] |
1304 | -#[rustc_const_unstable(feature = "const_float_bits_conv", issue = "72447")] | |
1304 | +#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")] | |
1305 | 1305 | #[must_use] |
1306 | 1306 | #[inline] |
1307 | 1307 | pub const fn from_ne_bytes(bytes: [u8; 8]) -> Self { |