]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/promote_fn_calls_std.rs
Rollup merge of #106963 - compiler-errors:scope-expr-dupe, r=michaelwoerister
[rust.git] / tests / ui / consts / promote_fn_calls_std.rs
1 #![allow(deprecated, deprecated_in_future)] // can be removed if different fns are chosen
2 // build-pass (FIXME(62277): could be check-pass?)
3
4 fn main() {
5     let x: &'static u8 = &u8::max_value();
6     let x: &'static u16 = &u16::max_value();
7     let x: &'static u32 = &u32::max_value();
8     let x: &'static u64 = &u64::max_value();
9     let x: &'static u128 = &u128::max_value();
10     let x: &'static usize = &usize::max_value();
11     let x: &'static u8 = &u8::min_value();
12     let x: &'static u16 = &u16::min_value();
13     let x: &'static u32 = &u32::min_value();
14     let x: &'static u64 = &u64::min_value();
15     let x: &'static u128 = &u128::min_value();
16     let x: &'static usize = &usize::min_value();
17     let x: &'static i8 = &i8::max_value();
18     let x: &'static i16 = &i16::max_value();
19     let x: &'static i32 = &i32::max_value();
20     let x: &'static i64 = &i64::max_value();
21     let x: &'static i128 = &i128::max_value();
22     let x: &'static isize = &isize::max_value();
23     let x: &'static i8 = &i8::min_value();
24     let x: &'static i16 = &i16::min_value();
25     let x: &'static i32 = &i32::min_value();
26     let x: &'static i64 = &i64::min_value();
27     let x: &'static i128 = &i128::min_value();
28     let x: &'static isize = &isize::min_value();
29 }