diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/consts/const-autoderef.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/consts/const-autoderef.rs b/src/test/ui/consts/const-autoderef.rs new file mode 100644 index 000000000..1c836318d --- /dev/null +++ b/src/test/ui/consts/const-autoderef.rs @@ -0,0 +1,11 @@ +// run-pass + +const A: [u8; 1] = ['h' as u8]; +const B: u8 = (&A)[0]; +const C: &'static &'static &'static &'static [u8; 1] = & & & &A; +const D: u8 = (&C)[0]; + +pub fn main() { + assert_eq!(B, A[0]); + assert_eq!(D, A[0]); +} |