about summary refs log tree commit diff
path: root/tests/ui/coercion
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-06-17 09:21:25 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-06-17 10:57:52 +0000
commit3e6e6b190d005b9cb8d1eca529598a89d7c2f23f (patch)
tree1efb98cb3671e7743c3ebd6bafc00e605b268da5 /tests/ui/coercion
parent94f549502f4bf6fae35f17c823924f041217c8f4 (diff)
downloadrust-3e6e6b190d005b9cb8d1eca529598a89d7c2f23f.tar.gz
rust-3e6e6b190d005b9cb8d1eca529598a89d7c2f23f.zip
Remove windows-specific copy of test
Diffstat (limited to 'tests/ui/coercion')
-rw-r--r--tests/ui/coercion/coerce-issue-49593-box-never-windows.nofallback.stderr19
-rw-r--r--tests/ui/coercion/coerce-issue-49593-box-never-windows.rs58
-rw-r--r--tests/ui/coercion/coerce-issue-49593-box-never.fallback.stderr2
-rw-r--r--tests/ui/coercion/coerce-issue-49593-box-never.nofallback.stderr8
-rw-r--r--tests/ui/coercion/coerce-issue-49593-box-never.rs11
5 files changed, 10 insertions, 88 deletions
diff --git a/tests/ui/coercion/coerce-issue-49593-box-never-windows.nofallback.stderr b/tests/ui/coercion/coerce-issue-49593-box-never-windows.nofallback.stderr
deleted file mode 100644
index b976f70acf7..00000000000
--- a/tests/ui/coercion/coerce-issue-49593-box-never-windows.nofallback.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `(): std::error::Error` is not satisfied
-  --> $DIR/coerce-issue-49593-box-never-windows.rs:18:53
-   |
-LL |     /* *mut $0 is coerced to Box<dyn Error> here */ 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-windows.rs:23:49
-   |
-LL |     /* *mut $0 is coerced to *mut Error here */ 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)`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/coercion/coerce-issue-49593-box-never-windows.rs b/tests/ui/coercion/coerce-issue-49593-box-never-windows.rs
deleted file mode 100644
index b317841ab6e..00000000000
--- a/tests/ui/coercion/coerce-issue-49593-box-never-windows.rs
+++ /dev/null
@@ -1,58 +0,0 @@
-//@ revisions: nofallback fallback
-//@ only-windows - the number of `Error` impls is platform-dependent
-//@[fallback] check-pass
-//@[nofallback] check-fail
-
-#![feature(never_type)]
-#![cfg_attr(fallback, feature(never_type_fallback))]
-#![allow(unreachable_code)]
-
-use std::error::Error;
-use std::mem;
-
-fn raw_ptr_box<T>(t: T) -> *mut T {
-    panic!()
-}
-
-fn foo(x: !) -> Box<dyn Error> {
-    /* *mut $0 is coerced to Box<dyn Error> here */ Box::<_ /* ! */>::new(x)
-    //[nofallback]~^ ERROR trait bound `(): std::error::Error` is not satisfied
-}
-
-fn foo_raw_ptr(x: !) -> *mut dyn Error {
-    /* *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 */
-    d as *mut _
-}
-
-trait Xyz {}
-struct S;
-struct T;
-impl Xyz for S {}
-impl Xyz for T {}
-
-fn foo_no_never() {
-    let mut x /* : Option<S> */ = None;
-    let mut first_iter = false;
-    loop {
-        if !first_iter {
-            let y: Box<dyn Xyz>
-                = /* Box<$0> is coerced to Box<Xyz> here */ Box::new(x.unwrap());
-        }
-
-        x = Some(S);
-        first_iter = true;
-    }
-
-    let mut y : Option<S> = None;
-    // assert types are equal
-    mem::swap(&mut x, &mut y);
-}
-
-fn main() {
-}
diff --git a/tests/ui/coercion/coerce-issue-49593-box-never.fallback.stderr b/tests/ui/coercion/coerce-issue-49593-box-never.fallback.stderr
index e9b43d6145c..ef5633f7134 100644
--- a/tests/ui/coercion/coerce-issue-49593-box-never.fallback.stderr
+++ b/tests/ui/coercion/coerce-issue-49593-box-never.fallback.stderr
@@ -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 `()`
diff --git a/tests/ui/coercion/coerce-issue-49593-box-never.nofallback.stderr b/tests/ui/coercion/coerce-issue-49593-box-never.nofallback.stderr
index 1215f5f9d88..7222af43b01 100644
--- a/tests/ui/coercion/coerce-issue-49593-box-never.nofallback.stderr
+++ b/tests/ui/coercion/coerce-issue-49593-box-never.nofallback.stderr
@@ -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 `()`
@@ -7,10 +7,10 @@ LL |     Box::<_ /* ! */>::new(x)
    = 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)`
 
diff --git a/tests/ui/coercion/coerce-issue-49593-box-never.rs b/tests/ui/coercion/coerce-issue-49593-box-never.rs
index f93fbb70dce..53071be47dc 100644
--- a/tests/ui/coercion/coerce-issue-49593-box-never.rs
+++ b/tests/ui/coercion/coerce-issue-49593-box-never.rs
@@ -1,5 +1,4 @@
 //@ revisions: nofallback fallback
-//@ ignore-windows - the number of `Error` impls is platform-dependent
 //@check-fail
 
 #![feature(never_type)]
@@ -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 _
 }
 
@@ -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() {}