From a80bb5b387a76b169c2a6fe80d0e87fb8c2f6e3f Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Thu, 7 Jul 2022 15:42:48 +0900 Subject: [PATCH] add a test for #70408 --- src/test/ui/const-generics/issue-70408.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/test/ui/const-generics/issue-70408.rs diff --git a/src/test/ui/const-generics/issue-70408.rs b/src/test/ui/const-generics/issue-70408.rs new file mode 100644 index 00000000000..f7557cb492c --- /dev/null +++ b/src/test/ui/const-generics/issue-70408.rs @@ -0,0 +1,13 @@ +// build-pass + +#![feature(adt_const_params)] +#![allow(incomplete_features)] + +pub fn function_with_bytes() -> &'static [u8] { + BYTES +} + +pub fn main() { + assert_eq!(function_with_bytes::(), &[0x41, 0x41, 0x41, 0x41]); + assert_eq!(function_with_bytes::<{ &[0x41, 0x41, 0x41, 0x41] }>(), b"AAAA"); +} -- GitLab