2 const CONST_REF: &[u8; 3] = b"foo";
5 const CONST_REF_DEFAULT: &'static [u8; 3] = b"bar";
6 const CONST_REF: &'static [u8; 3];
10 const CONST_REF: &'static [u8; 3] = b"jjj";
14 const CONST_REF_DEFAULT: &'static [u8; 3] = b"ggg";
15 const CONST_REF: &'static [u8; 3] = b"fff";
18 // Check that (associated and free) const references are not mistaken for a
19 // non-reference pattern (in which case they would be auto-dereferenced, making
20 // the types mismatched).
22 fn const_ref() -> bool {
30 fn associated_const_ref() -> bool {
31 match (b"bar", b"jjj", b"ggg", b"fff") {
32 (i32::CONST_REF_DEFAULT, i32::CONST_REF, i64::CONST_REF_DEFAULT, i64::CONST_REF) => true,
39 assert!(associated_const_ref());