diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2023-03-01 23:40:22 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-01 23:40:22 +0530 |
| commit | 02e4eefd88a55776cbb163c1ba025f0736e52026 (patch) | |
| tree | 56e492afcf81d0bf62a986bf1cf865985b014bf4 | |
| parent | 0ed76b473f9e52a98654c9311009efb7be1a604b (diff) | |
| parent | 50d35c174071301b95e9358d8e69c90561caa217 (diff) | |
| download | rust-02e4eefd88a55776cbb163c1ba025f0736e52026.tar.gz rust-02e4eefd88a55776cbb163c1ba025f0736e52026.zip | |
Rollup merge of #108605 - JohnTitor:issue-105821, r=compiler-errors
Add regression test for #105821 Closes #105821 r? compiler-errors
| -rw-r--r-- | tests/ui/const-generics/issues/issue-105821.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/const-generics/issues/issue-105821.rs b/tests/ui/const-generics/issues/issue-105821.rs new file mode 100644 index 00000000000..cba2e22c460 --- /dev/null +++ b/tests/ui/const-generics/issues/issue-105821.rs @@ -0,0 +1,23 @@ +// check-pass + +#![allow(incomplete_features)] +#![feature(adt_const_params, const_ptr_read, generic_const_exprs)] +#![allow(dead_code)] + +const fn catone<const M: usize>(_a: &[u8; M]) -> [u8; M + 1] +where + [(); M + 1]:, +{ + unimplemented!() +} + +struct Catter<const A: &'static [u8]>; +impl<const A: &'static [u8]> Catter<A> +where + [(); A.len() + 1]:, +{ + const ZEROS: &'static [u8; A.len()] = &[0_u8; A.len()]; + const R: &'static [u8] = &catone(Self::ZEROS); +} + +fn main() {} |
