Add regression tests

This commit is contained in:
Oliver Scherer 2019-03-22 18:33:12 +01:00
parent 9b87d22ea8
commit f9e29b279c
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,16 @@
// compile-pass
fn testfn(_arr: &mut [();0]) {}
trait TestTrait {
fn method();
}
impl TestTrait for [(); 0] {
fn method() {
let mut arr: Self = [(); 0];
testfn(&mut arr);
}
}
fn main() {}

View File

@ -0,0 +1,21 @@
// compile-pass
trait Gen<T> {
fn gen(x: Self) -> T;
}
struct A;
impl Gen<[(); 0]> for A {
fn gen(x: Self) -> [(); 0] {
[]
}
}
fn array() -> impl Gen<[(); 0]> {
A
}
fn main() {
let [] = Gen::gen(array());
}