File: const-bitshift-rhs-inference.rs

package info (click to toggle)
rustc-web 1.78.0%2Bdfsg1-2~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,245,420 kB
  • sloc: xml: 147,985; javascript: 18,022; sh: 11,083; python: 10,265; ansic: 6,172; cpp: 5,023; asm: 4,390; makefile: 4,269
file content (24 lines) | stat: -rw-r--r-- 762 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@ run-pass
const RHS: u8 = 8;
const IRHS: i8 = 8;
const RHS16: u16 = 8;
const IRHS16: i16 = 8;
const RHS32: u32 = 8;
const IRHS32: i32 = 8;
const RHS64: u64 = 8;
const IRHS64: i64 = 8;
const RHSUS: usize = 8;
const IRHSIS: isize = 8;

fn main() {
    let _: [&'static str; 1 << RHS] = [""; 256];
    let _: [&'static str; 1 << IRHS] = [""; 256];
    let _: [&'static str; 1 << RHS16] = [""; 256];
    let _: [&'static str; 1 << IRHS16] = [""; 256];
    let _: [&'static str; 1 << RHS32] = [""; 256];
    let _: [&'static str; 1 << IRHS32] = [""; 256];
    let _: [&'static str; 1 << RHS64] = [""; 256];
    let _: [&'static str; 1 << IRHS64] = [""; 256];
    let _: [&'static str; 1 << RHSUS] = [""; 256];
    let _: [&'static str; 1 << IRHSIS] = [""; 256];
}