diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs new file mode 100644 index 000000000..5f5435ba9 --- /dev/null +++ b/src/test/incremental/const-generics/try_unify_abstract_const_regression_tests/issue-88022.rs @@ -0,0 +1,28 @@ +// revisions: cfail +#![feature(generic_const_exprs)] +#![allow(incomplete_features, unused_braces)] + +struct Buffer<T, const S: usize> +where + [(); { S * 2 }]: Default, +{ + data: [T; { S * 2 }], +} + +struct BufferIter<'a, T, const S: usize>(&'a Buffer<T, S>) +where + [(); { S * 2 }]: Default; + +impl<'a, T, const S: usize> Iterator for BufferIter<'a, T, S> { + //~^ error: the trait bound + //~^^ error: unconstrained generic constant + type Item = &'a T; + + fn next(&mut self) -> Option<Self::Item> { + //~^ error: the trait bound + //~^^ error: unconstrained generic constant + None + } +} + +fn main() {} |