]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-contents.rs
Rollup merge of #106963 - compiler-errors:scope-expr-dupe, r=michaelwoerister
[rust.git] / tests / ui / consts / const-contents.rs
1 // run-pass
2 // Issue #570
3 #![allow(non_upper_case_globals)]
4
5 static lsl : isize = 1 << 2;
6 static add : isize = 1 + 2;
7 static addf : f64 = 1.0 + 2.0;
8 static not : isize = !0;
9 static notb : bool = !true;
10 static neg : isize = -(1);
11
12 pub fn main() {
13     assert_eq!(lsl, 4);
14     assert_eq!(add, 3);
15     assert_eq!(addf, 3.0);
16     assert_eq!(not, -1);
17     assert_eq!(notb, false);
18     assert_eq!(neg, -1);
19 }