Skip to content

Commit 7fc4b96

Browse files
committed
tests: Add regression test for self referential struct with cow as last field
1 parent 7db7489 commit 7fc4b96

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Regression test for #107481
2+
3+
//@ check-pass
4+
5+
use std::{borrow::Cow, collections::HashMap};
6+
7+
#[derive(Clone)]
8+
struct Foo<'a>(Cow<'a, [Self]>);
9+
10+
#[derive(Clone)]
11+
struct Bar<'a>(Cow<'a, HashMap<String, Self>>);
12+
13+
#[derive(Clone)]
14+
struct Baz<'a>(Cow<'a, Vec<Self>>);
15+
16+
#[derive(Clone)]
17+
struct Qux<'a>(Cow<'a, Box<Self>>);
18+
19+
fn main() {}

0 commit comments

Comments
 (0)