Skip to content

Commit cc8040e

Browse files
authored
Rollup merge of #103704 - xxchan:xxchan/applicable-bug, r=compiler-errors
Add a test for TAIT used with impl/dyn Trait inside RPIT close #101750
2 parents 2ea6611 + 6bc5fdd commit cc8040e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
// check-pass
4+
5+
trait Trait {}
6+
7+
type TAIT = impl Trait;
8+
9+
struct Concrete;
10+
impl Trait for Concrete {}
11+
12+
fn tait() -> TAIT {
13+
Concrete
14+
}
15+
16+
trait OuterTrait {
17+
type Item;
18+
}
19+
struct Dummy<T> {
20+
t: T,
21+
}
22+
impl<T> OuterTrait for Dummy<T> {
23+
type Item = T;
24+
}
25+
26+
fn tait_and_impl_trait() -> impl OuterTrait<Item = (TAIT, impl Trait)> {
27+
Dummy {
28+
t: (tait(), Concrete),
29+
}
30+
}
31+
32+
fn tait_and_dyn_trait() -> impl OuterTrait<Item = (TAIT, Box<dyn Trait>)> {
33+
let b: Box<dyn Trait> = Box::new(Concrete);
34+
Dummy { t: (tait(), b) }
35+
}
36+
37+
fn main() {}

0 commit comments

Comments
 (0)