Skip to content

Commit 97a84ca

Browse files
committed
Move opaque type tests into separate module
1 parent 24163d9 commit 97a84ca

File tree

3 files changed

+48
-46
lines changed

3 files changed

+48
-46
lines changed

tests/test/existential_types.rs

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,6 @@
22
33
use super::*;
44

5-
#[test]
6-
fn opaque_bounds() {
7-
test! {
8-
program {
9-
struct Ty { }
10-
11-
trait Clone { }
12-
opaque type T: Clone = Ty;
13-
}
14-
15-
goal {
16-
T: Clone
17-
} yields {
18-
"Unique; substitution []"
19-
}
20-
}
21-
}
22-
23-
#[test]
24-
fn opaque_reveal() {
25-
test! {
26-
program {
27-
struct Ty { }
28-
trait Trait { }
29-
impl Trait for Ty { }
30-
31-
trait Clone { }
32-
opaque type T: Clone = Ty;
33-
}
34-
35-
goal {
36-
if (Reveal) {
37-
T: Trait
38-
}
39-
} yields {
40-
"Unique; substitution []"
41-
}
42-
43-
goal {
44-
T: Trait
45-
} yields {
46-
"No possible solution"
47-
}
48-
}
49-
}
50-
515
#[test]
526
fn dyn_Clone_is_Clone() {
537
test! {

tests/test/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ mod impls;
308308
mod misc;
309309
mod negation;
310310
mod object_safe;
311+
mod opaque_types;
311312
mod projection;
312313
mod refs;
313314
mod scalars;

tests/test/opaque_types.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
use super::*;
2+
3+
#[test]
4+
fn opaque_bounds() {
5+
test! {
6+
program {
7+
struct Ty { }
8+
9+
trait Clone { }
10+
opaque type T: Clone = Ty;
11+
}
12+
13+
goal {
14+
T: Clone
15+
} yields {
16+
"Unique; substitution []"
17+
}
18+
}
19+
}
20+
21+
#[test]
22+
fn opaque_reveal() {
23+
test! {
24+
program {
25+
struct Ty { }
26+
trait Trait { }
27+
impl Trait for Ty { }
28+
29+
trait Clone { }
30+
opaque type T: Clone = Ty;
31+
}
32+
33+
goal {
34+
if (Reveal) {
35+
T: Trait
36+
}
37+
} yields {
38+
"Unique; substitution []"
39+
}
40+
41+
goal {
42+
T: Trait
43+
} yields {
44+
"No possible solution"
45+
}
46+
}
47+
}

0 commit comments

Comments
 (0)