Skip to content

Commit 755d030

Browse files
pnkfelixpietroalbini
authored andcommitted
Regression test for issue 55552.
1 parent bed6132 commit 755d030

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// compile-pass
2+
3+
// rust-lang/rust#55552: The strategy pnkfelix landed in PR #55274
4+
// (for ensuring that NLL respects user-provided lifetime annotations)
5+
// did not handle the case where the ascribed type has some expliit
6+
// wildcards (`_`) mixed in, and it caused an internal compiler error
7+
// (ICE).
8+
//
9+
// This test is just checking that we do not ICE when such things
10+
// occur.
11+
12+
struct X;
13+
struct Y;
14+
struct Z;
15+
16+
struct Pair { x: X, y: Y }
17+
18+
pub fn join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB)
19+
where A: FnOnce() -> RA + Send,
20+
B: FnOnce() -> RB + Send,
21+
RA: Send,
22+
RB: Send
23+
{
24+
(oper_a(), oper_b())
25+
}
26+
27+
fn main() {
28+
let ((_x, _y), _z): (_, Z) = join(|| (X, Y), || Z);
29+
30+
let (Pair { x: _x, y: _y }, Z): (_, Z) = join(|| Pair { x: X, y: Y }, || Z);
31+
}

0 commit comments

Comments
 (0)