Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make UI test OS-agnostic #133074

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions tests/ui/structs-enums/enum-rec/issue-17431-6.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down
14 changes: 7 additions & 7 deletions tests/ui/structs-enums/enum-rec/issue-17431-6.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading