mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-01 07:13:24 +03:00
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:
@@ -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() {}
|
||||
Reference in New Issue
Block a user