summaryrefslogtreecommitdiffstats
path: root/src/test/ui/statics/issue-17233.rs
blob: 54a12fdf8e82270b8fbf7c9f0cdc3ed817d24a23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass

const X1: &'static [u8] = &[b'1'];
const X2: &'static [u8] = b"1";
const X3: &'static [u8; 1] = &[b'1'];
const X4: &'static [u8; 1] = b"1";

static Y1: u8 = X1[0];
static Y2: u8 = X2[0];
static Y3: u8 = X3[0];
static Y4: u8 = X4[0];

fn main() {
    assert_eq!(Y1, Y2);
    assert_eq!(Y1, Y3);
    assert_eq!(Y1, Y4);
}