]> git.lizzy.rs Git - rust.git/blob - tests/ui/statics/issue-17233.rs
Rollup merge of #106397 - compiler-errors:new-solver-impl-wc, r=lcnr
[rust.git] / tests / ui / statics / issue-17233.rs
1 // run-pass
2
3 const X1: &'static [u8] = &[b'1'];
4 const X2: &'static [u8] = b"1";
5 const X3: &'static [u8; 1] = &[b'1'];
6 const X4: &'static [u8; 1] = b"1";
7
8 static Y1: u8 = X1[0];
9 static Y2: u8 = X2[0];
10 static Y3: u8 = X3[0];
11 static Y4: u8 = X4[0];
12
13 fn main() {
14     assert_eq!(Y1, Y2);
15     assert_eq!(Y1, Y3);
16     assert_eq!(Y1, Y4);
17 }