From 5183b33018ed175334f86752b266b27914745e2b Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 17 Jan 2025 14:57:22 +0100 Subject: [PATCH] bless tests yay, I fixed the bug/missing feature :') --- tests/ui/cast/ptr-to-trait-obj-wrap.rs | 5 +- tests/ui/cast/ptr-to-trait-obj-wrap.stderr | 57 ---------------------- 2 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 tests/ui/cast/ptr-to-trait-obj-wrap.stderr diff --git a/tests/ui/cast/ptr-to-trait-obj-wrap.rs b/tests/ui/cast/ptr-to-trait-obj-wrap.rs index facb5bb795a61..4227ae031dc1c 100644 --- a/tests/ui/cast/ptr-to-trait-obj-wrap.rs +++ b/tests/ui/cast/ptr-to-trait-obj-wrap.rs @@ -1,3 +1,4 @@ +//@ check-pass #![allow(unused)] trait A {} @@ -7,14 +8,10 @@ struct X(T); fn unwrap(a: *const W) -> *const dyn A { a as _ - //~^ error - //~| error } fn unwrap_nested(a: *const W>) -> *const W { a as _ - //~^ error - //~| error } fn rewrap(a: *const W) -> *const X { diff --git a/tests/ui/cast/ptr-to-trait-obj-wrap.stderr b/tests/ui/cast/ptr-to-trait-obj-wrap.stderr deleted file mode 100644 index 5b64bcfc73489..0000000000000 --- a/tests/ui/cast/ptr-to-trait-obj-wrap.stderr +++ /dev/null @@ -1,57 +0,0 @@ -error[E0277]: the trait bound `W<(dyn A + 'static)>: A` is not satisfied - --> $DIR/ptr-to-trait-obj-wrap.rs:9:5 - | -LL | a as _ - | ^ the trait `A` is not implemented for `W<(dyn A + 'static)>` - | -help: this trait has no implementations, consider adding one - --> $DIR/ptr-to-trait-obj-wrap.rs:3:1 - | -LL | trait A {} - | ^^^^^^^ - = note: required for the cast from `*const W<(dyn A + 'static)>` to `*const dyn A` - -error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time - --> $DIR/ptr-to-trait-obj-wrap.rs:9:5 - | -LL | a as _ - | ^ doesn't have a size known at compile-time - | - = help: within `W<(dyn A + 'static)>`, the trait `Sized` is not implemented for `(dyn A + 'static)` -note: required because it appears within the type `W<(dyn A + 'static)>` - --> $DIR/ptr-to-trait-obj-wrap.rs:5:8 - | -LL | struct W(T); - | ^ - = note: required for the cast from `*const W<(dyn A + 'static)>` to `*const dyn A` - -error[E0277]: the trait bound `W<(dyn A + 'static)>: A` is not satisfied - --> $DIR/ptr-to-trait-obj-wrap.rs:15:5 - | -LL | a as _ - | ^ the trait `A` is not implemented for `W<(dyn A + 'static)>` - | -help: this trait has no implementations, consider adding one - --> $DIR/ptr-to-trait-obj-wrap.rs:3:1 - | -LL | trait A {} - | ^^^^^^^ - = note: required for the cast from `*const W>` to `*const W` - -error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time - --> $DIR/ptr-to-trait-obj-wrap.rs:15:5 - | -LL | a as _ - | ^ doesn't have a size known at compile-time - | - = help: within `W<(dyn A + 'static)>`, the trait `Sized` is not implemented for `(dyn A + 'static)` -note: required because it appears within the type `W<(dyn A + 'static)>` - --> $DIR/ptr-to-trait-obj-wrap.rs:5:8 - | -LL | struct W(T); - | ^ - = note: required for the cast from `*const W>` to `*const W` - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0277`.