]> git.lizzy.rs Git - rust.git/blob - src/test/incremental/const-generics/hash-tyvid-regression-4.rs
Rollup merge of #98998 - workingjubilee:naked-means-no-clothes-enforcement-technology...
[rust.git] / src / test / incremental / const-generics / hash-tyvid-regression-4.rs
1 // revisions: cfail
2 #![feature(generic_const_exprs)]
3 #![allow(incomplete_features)]
4 // regression test for #79251
5 #[derive(Debug)]
6 struct Node<K, const D: usize>
7 where
8     SmallVec<K, { D * 2 }>: ,
9 {
10     keys: SmallVec<K, { D * 2 }>,
11 }
12
13 impl<K, const D: usize> Node<K, D>
14 where
15     SmallVec<K, { D * 2 }>: ,
16 {
17     fn new() -> Self {
18         panic!()
19     }
20
21     #[inline(never)]
22     fn split(&mut self, i: usize, k: K, right: bool) -> Node<K, D> {
23         let mut node = Node::new();
24         node.keys.push(k);
25         //~^ error: no method named
26         node
27     }
28 }
29
30 #[derive(Debug)]
31 struct SmallVec<T, const D: usize> {
32     data: [T; D],
33 }
34 impl<T, const D: usize> SmallVec<T, D> {
35     fn new() -> Self {
36         panic!()
37     }
38 }
39
40 fn main() {}