about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/structs-enums/enum-rec/issue-17431-6.rs6
-rw-r--r--tests/ui/structs-enums/enum-rec/issue-17431-6.stderr14
2 files changed, 9 insertions, 11 deletions
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 0183bdba111..a3b510848dc 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<Option<Foo>>) }
+enum Foo { X(UnsafeCell<Option<Foo>>) }
 //~^ 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 22f8519d0ef..b192593d266 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<Option<Foo>>) }
-   | ^^^^^^^^                  --- recursive without indirection
+LL | enum Foo { X(UnsafeCell<Option<Foo>>) }
+   | ^^^^^^^^                       --- recursive without indirection
    |
 help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
    |
-LL | enum Foo { X(Mutex<Option<Box<Foo>>>) }
-   |                           ++++   +
+LL | enum Foo { X(UnsafeCell<Option<Box<Foo>>>) }
+   |                                ++++   +
 
 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<Option<Foo>>) }
+LL | enum Foo { X(UnsafeCell<Option<Foo>>) }
    | ^^^^^^^^
    |
    = note: ...which immediately requires computing when `Foo` needs drop again