]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-int-wrapping.rs
Rollup merge of #106718 - lcnr:solver-cycles, r=compiler-errors
[rust.git] / tests / ui / consts / const-int-wrapping.rs
1 fn main() {
2     let x: &'static i32 = &(5_i32.wrapping_add(3));
3     //~^ ERROR temporary value dropped while borrowed
4     let y: &'static i32 = &(5_i32.wrapping_sub(3));
5     //~^ ERROR temporary value dropped while borrowed
6     let z: &'static i32 = &(5_i32.wrapping_mul(3));
7     //~^ ERROR temporary value dropped while borrowed
8     let a: &'static i32 = &(5_i32.wrapping_shl(3));
9     //~^ ERROR temporary value dropped while borrowed
10     let b: &'static i32 = &(5_i32.wrapping_shr(3));
11     //~^ ERROR temporary value dropped while borrowed
12 }