Skip to content

Commit d37cc61

Browse files
committed
regression test for issue 80949.
1 parent a309126 commit d37cc61

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/test/ui/mir/issue-80949.rs

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// build-pass
2+
3+
trait Trait { type Item; }
4+
5+
impl<'a, X> Trait for &'a Vec<X> {
6+
type Item = &'a X;
7+
}
8+
9+
impl<X> Trait for Box<dyn Trait<Item = X>> {
10+
type Item = X;
11+
}
12+
13+
fn make_dyn_trait(_: &()) -> Box<dyn Trait<Item = &()>> {
14+
todo!()
15+
}
16+
17+
fn diff<'a, M, N, S>(_: N, _: S)
18+
where
19+
M: 'a,
20+
N: Trait<Item = &'a M>,
21+
S: Trait<Item = &'a M>,
22+
{
23+
todo!()
24+
}
25+
26+
fn may_panic<X>(_: X) { }
27+
28+
fn main() {
29+
let dyn_trait = make_dyn_trait(&());
30+
let storage = vec![()];
31+
let _x = may_panic(());
32+
let storage_ref = &storage;
33+
diff(dyn_trait, storage_ref);
34+
}

0 commit comments

Comments
 (0)