diff options
| author | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-07-07 15:42:48 +0900 |
|---|---|---|
| committer | Takayuki Maeda <takoyaki0316@gmail.com> | 2022-07-07 15:42:48 +0900 |
| commit | a80bb5b387a76b169c2a6fe80d0e87fb8c2f6e3f (patch) | |
| tree | 0b126ac69c96d8dfb32b76a7f78693accf4c77c9 | |
| parent | fac8fa56726f7a5b2d4880a4719c5f99beec8328 (diff) | |
| download | rust-a80bb5b387a76b169c2a6fe80d0e87fb8c2f6e3f.tar.gz rust-a80bb5b387a76b169c2a6fe80d0e87fb8c2f6e3f.zip | |
add a test for #70408
| -rw-r--r-- | src/test/ui/const-generics/issue-70408.rs | 13 |
1 files changed, 13 insertions, 0 deletions
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<const BYTES: &'static [u8; 4]>() -> &'static [u8] { + BYTES +} + +pub fn main() { + assert_eq!(function_with_bytes::<b"AAAA">(), &[0x41, 0x41, 0x41, 0x41]); + assert_eq!(function_with_bytes::<{ &[0x41, 0x41, 0x41, 0x41] }>(), b"AAAA"); +} |
