Skip to content

Commit

Permalink
tests: Add regression test for self referential struct with cow as la…
Browse files Browse the repository at this point in the history
…st field
  • Loading branch information
Enselic committed Nov 26, 2024
1 parent 7db7489 commit 7fc4b96
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 7fc4b96

Please sign in to comment.