Skip to content

Commit

Permalink
Remove windows-specific copy of test
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jun 17, 2024
1 parent 94f5495 commit 3e6e6b1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 88 deletions.

This file was deleted.

58 changes: 0 additions & 58 deletions tests/ui/coercion/coerce-issue-49593-box-never-windows.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `(): std::error::Error` is not satisfied
--> $DIR/coerce-issue-49593-box-never.rs:19:5
--> $DIR/coerce-issue-49593-box-never.rs:18:5
|
LL | Box::<_ /* ! */>::new(x)
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
error[E0277]: the trait bound `(): std::error::Error` is not satisfied
--> $DIR/coerce-issue-49593-box-never.rs:19:5
--> $DIR/coerce-issue-49593-box-never.rs:18:5
|
LL | Box::<_ /* ! */>::new(x)
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
|
= note: required for the cast from `Box<()>` to `Box<(dyn std::error::Error + 'static)>`

error[E0277]: the trait bound `(): std::error::Error` is not satisfied
--> $DIR/coerce-issue-49593-box-never.rs:24:49
--> $DIR/coerce-issue-49593-box-never.rs:24:5
|
LL | /* *mut $0 is coerced to *mut Error here */ raw_ptr_box::<_ /* ! */>(x)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
LL | raw_ptr_box::<_ /* ! */>(x)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()`
|
= note: required for the cast from `*mut ()` to `*mut (dyn std::error::Error + 'static)`

Expand Down
11 changes: 5 additions & 6 deletions tests/ui/coercion/coerce-issue-49593-box-never.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//@ revisions: nofallback fallback
//@ ignore-windows - the number of `Error` impls is platform-dependent
//@check-fail

#![feature(never_type)]
Expand All @@ -21,13 +20,14 @@ fn foo(x: !) -> Box<dyn Error> {
}

fn foo_raw_ptr(x: !) -> *mut dyn Error {
/* *mut $0 is coerced to *mut Error here */ raw_ptr_box::<_ /* ! */>(x)
/* *mut $0 is coerced to *mut Error here */
raw_ptr_box::<_ /* ! */>(x)
//[nofallback]~^ ERROR trait bound `(): std::error::Error` is not satisfied
}

fn no_coercion(d: *mut dyn Error) -> *mut dyn Error {
/* an unsize coercion won't compile here, and it is indeed not used
because there is nothing requiring the _ to be Sized */
because there is nothing requiring the _ to be Sized */
d as *mut _
}

Expand All @@ -50,10 +50,9 @@ fn foo_no_never() {
first_iter = true;
}

let mut y : Option<S> = None;
let mut y: Option<S> = None;
// assert types are equal
mem::swap(&mut x, &mut y);
}

fn main() {
}
fn main() {}

0 comments on commit 3e6e6b1

Please sign in to comment.