summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/promote_fn_calls_std.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/consts/promote_fn_calls_std.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/consts/promote_fn_calls_std.rs')
-rw-r--r--tests/ui/consts/promote_fn_calls_std.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/ui/consts/promote_fn_calls_std.rs b/tests/ui/consts/promote_fn_calls_std.rs
new file mode 100644
index 000000000..557f6a434
--- /dev/null
+++ b/tests/ui/consts/promote_fn_calls_std.rs
@@ -0,0 +1,29 @@
+#![allow(deprecated, deprecated_in_future)] // can be removed if different fns are chosen
+// build-pass (FIXME(62277): could be check-pass?)
+
+fn main() {
+ let x: &'static u8 = &u8::max_value();
+ let x: &'static u16 = &u16::max_value();
+ let x: &'static u32 = &u32::max_value();
+ let x: &'static u64 = &u64::max_value();
+ let x: &'static u128 = &u128::max_value();
+ let x: &'static usize = &usize::max_value();
+ let x: &'static u8 = &u8::min_value();
+ let x: &'static u16 = &u16::min_value();
+ let x: &'static u32 = &u32::min_value();
+ let x: &'static u64 = &u64::min_value();
+ let x: &'static u128 = &u128::min_value();
+ let x: &'static usize = &usize::min_value();
+ let x: &'static i8 = &i8::max_value();
+ let x: &'static i16 = &i16::max_value();
+ let x: &'static i32 = &i32::max_value();
+ let x: &'static i64 = &i64::max_value();
+ let x: &'static i128 = &i128::max_value();
+ let x: &'static isize = &isize::max_value();
+ let x: &'static i8 = &i8::min_value();
+ let x: &'static i16 = &i16::min_value();
+ let x: &'static i32 = &i32::min_value();
+ let x: &'static i64 = &i64::min_value();
+ let x: &'static i128 = &i128::min_value();
+ let x: &'static isize = &isize::min_value();
+}