Skip to content

Commit

Permalink
Rollup merge of #133488 - Enselic:recurse-2, r=BoxyUwU
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jieyouxu authored Nov 30, 2024
2 parents 5192810 + 7fc4b96 commit f1d9ba8
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Regression test for #107481

//@ check-pass

use std::{borrow::Cow, collections::HashMap};

#[derive(Clone)]
struct Foo<'a>(Cow<'a, [Self]>);

#[derive(Clone)]
struct Bar<'a>(Cow<'a, HashMap<String, Self>>);

#[derive(Clone)]
struct Baz<'a>(Cow<'a, Vec<Self>>);

#[derive(Clone)]
struct Qux<'a>(Cow<'a, Box<Self>>);

fn main() {}

0 comments on commit f1d9ba8

Please sign in to comment.