rust/tests/incremental/const-generics/hash-tyvid-regression-4.rs

41 lines
746 B
Rust
Raw Normal View History

//@ revisions: cfail
#![feature(generic_const_exprs)]
2021-08-18 15:15:33 -05:00
#![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() {}