Skip to content

Commit ee4b03f

Browse files
committed
Add tests for slices being unsized and well-formed
1 parent f3d4b38 commit ee4b03f

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

tests/test/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ mod negation;
316316
mod projection;
317317
mod refs;
318318
mod scalars;
319+
mod slices;
319320
mod tuples;
320321
mod unify;
321322
mod wf_goals;

tests/test/slices.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
use super::*;
2+
3+
#[test]
4+
fn slices_are_not_sized() {
5+
test! {
6+
program {
7+
#[lang(sized)]
8+
trait Sized { }
9+
}
10+
11+
goal {
12+
forall<T> { not { [T]: Sized } }
13+
} yields {
14+
"Unique; substitution [], lifetime constraints []"
15+
}
16+
}
17+
}
18+
19+
#[test]
20+
fn slices_are_well_formed() {
21+
test! {
22+
program {
23+
}
24+
25+
goal {
26+
forall<T> { WellFormed([T]) }
27+
} yields {
28+
"Unique; substitution [], lifetime constraints []"
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)