diff options
Diffstat (limited to 'src/test/incremental/const-generics/hash-tyvid-regression-4.rs')
-rw-r--r-- | src/test/incremental/const-generics/hash-tyvid-regression-4.rs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/test/incremental/const-generics/hash-tyvid-regression-4.rs b/src/test/incremental/const-generics/hash-tyvid-regression-4.rs new file mode 100644 index 000000000..12e8ac7ab --- /dev/null +++ b/src/test/incremental/const-generics/hash-tyvid-regression-4.rs @@ -0,0 +1,40 @@ +// revisions: cfail +#![feature(generic_const_exprs)] +#![allow(incomplete_features)] +// regression test for #79251 +#[derive(Debug)] +struct Node<K, const D: usize> +where + SmallVec<K, { D * 2 }>: , +{ + keys: SmallVec<K, { D * 2 }>, +} + +impl<K, const D: usize> Node<K, D> +where + SmallVec<K, { D * 2 }>: , +{ + fn new() -> Self { + panic!() + } + + #[inline(never)] + fn split(&mut self, i: usize, k: K, right: bool) -> Node<K, D> { + let mut node = Node::new(); + node.keys.push(k); + //~^ error: no method named + node + } +} + +#[derive(Debug)] +struct SmallVec<T, const D: usize> { + data: [T; D], +} +impl<T, const D: usize> SmallVec<T, D> { + fn new() -> Self { + panic!() + } +} + +fn main() {} |