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 https://github.com/rust-lang/rust/issues/129541 for details. Closes #107481
This commit is contained in:
commit
f1d9ba8741
1 changed files with 19 additions and 0 deletions
|
@ -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() {}
|
Loading…
Add table
Reference in a new issue