Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f1d9ba8

Browse files
authoredNov 30, 2024
Rollup merge of #133488 - Enselic:recurse-2, r=BoxyUwU
tests: Add regression test for self referential structs with cow as last field Making compilation pass for this code was retroactively stabilized via FCP in 1.79. The code does not compile in 1.78. See #129541 for details. Closes #107481
2 parents 5192810 + 7fc4b96 commit f1d9ba8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
 
Lines changed: 19 additions & 0 deletions
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)
Please sign in to comment.