Skip to content

Commit 61807c5

Browse files
committed
Add a test for a GAT ICE with self-referential lifetime bounds
1 parent e27378c commit 61807c5

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/113793>.
2+
//!
3+
//! Using a GAT with a self-referential lifetime bound (`'b: 'b`) in a
4+
//! fully-qualified path with anonymous lifetimes used to ICE.
5+
6+
//@ check-pass
7+
8+
trait Gat {
9+
type FooArg<'a, 'b: 'b>;
10+
}
11+
12+
impl Gat for () {
13+
type FooArg<'a, 'b: 'b> = &'a dyn ToString;
14+
}
15+
16+
struct Test;
17+
18+
impl Iterator for Test {
19+
type Item = Box<dyn Fn(<() as Gat>::FooArg<'_, '_>)>;
20+
21+
fn next(&mut self) -> Option<Self::Item> {
22+
None
23+
}
24+
}
25+
26+
fn main() {}

0 commit comments

Comments
 (0)