diff --git a/tests/ui/structs-enums/enum-rec/issue-17431-6.rs b/tests/ui/structs-enums/enum-rec/issue-17431-6.rs index 0183bdba11193..a3b510848dcd3 100644 --- a/tests/ui/structs-enums/enum-rec/issue-17431-6.rs +++ b/tests/ui/structs-enums/enum-rec/issue-17431-6.rs @@ -1,8 +1,6 @@ -//@ ignore-apple: cycle error does not appear on apple +use std::cell::UnsafeCell; -use std::sync::Mutex; - -enum Foo { X(Mutex>) } +enum Foo { X(UnsafeCell>) } //~^ ERROR recursive type `Foo` has infinite size //~| ERROR cycle detected diff --git a/tests/ui/structs-enums/enum-rec/issue-17431-6.stderr b/tests/ui/structs-enums/enum-rec/issue-17431-6.stderr index 22f8519d0ef84..b192593d266b7 100644 --- a/tests/ui/structs-enums/enum-rec/issue-17431-6.stderr +++ b/tests/ui/structs-enums/enum-rec/issue-17431-6.stderr @@ -1,18 +1,18 @@ error[E0072]: recursive type `Foo` has infinite size - --> $DIR/issue-17431-6.rs:5:1 + --> $DIR/issue-17431-6.rs:3:1 | -LL | enum Foo { X(Mutex>) } - | ^^^^^^^^ --- recursive without indirection +LL | enum Foo { X(UnsafeCell>) } + | ^^^^^^^^ --- recursive without indirection | help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle | -LL | enum Foo { X(Mutex>>) } - | ++++ + +LL | enum Foo { X(UnsafeCell>>) } + | ++++ + error[E0391]: cycle detected when computing when `Foo` needs drop - --> $DIR/issue-17431-6.rs:5:1 + --> $DIR/issue-17431-6.rs:3:1 | -LL | enum Foo { X(Mutex>) } +LL | enum Foo { X(UnsafeCell>) } | ^^^^^^^^ | = note: ...which immediately requires computing when `Foo` needs drop again