diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-07-07 20:33:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-07 20:33:31 +0200 |
| commit | 16ad2f50b577a338c63a5cee2e34a4a4392e07e2 (patch) | |
| tree | ad498f6ba7a326b124a541371c8eccad0a25cc14 | |
| parent | 7fed4fffb6de19d9ba7d7840c91166f91f5e8e4a (diff) | |
| parent | a80bb5b387a76b169c2a6fe80d0e87fb8c2f6e3f (diff) | |
| download | rust-16ad2f50b577a338c63a5cee2e34a4a4392e07e2.tar.gz rust-16ad2f50b577a338c63a5cee2e34a4a4392e07e2.zip | |
Rollup merge of #99004 - TaKO8Ki:add-test-for-70408, r=Mark-Simulacrum
Add a test for #70408 closes #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"); +} |
