Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-Bertholet committed Jul 10, 2024
1 parent dce9679 commit 3d0856e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 33 deletions.
14 changes: 0 additions & 14 deletions tests/ui/impl-trait/unsized_coercion5.next.stderr

This file was deleted.

22 changes: 5 additions & 17 deletions tests/ui/impl-trait/unsized_coercion5.old.stderr
Original file line number Diff line number Diff line change
@@ -1,38 +1,26 @@
error[E0308]: mismatched types
--> $DIR/unsized_coercion5.rs:16:32
|
LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
| ------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait `Send`, found trait `Trait + Send`
| |
| expected due to this
|
= note: expected struct `Box<dyn Send>`
found struct `Box<dyn Trait + Send>`

error: cannot check whether the hidden type of opaque type satisfies auto traits
--> $DIR/unsized_coercion5.rs:16:32
--> $DIR/unsized_coercion5.rs:17:32
|
LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
| ^
|
= note: fetching the hidden types of an opaque inside of the defining scope is not supported. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule
note: opaque type is declared here
--> $DIR/unsized_coercion5.rs:13:19
--> $DIR/unsized_coercion5.rs:14:19
|
LL | fn hello() -> Box<impl Trait + ?Sized> {
| ^^^^^^^^^^^^^^^^^^^
= note: required for the cast from `Box<impl Trait + ?Sized>` to `Box<dyn Trait + Send>`

error[E0277]: the size for values of type `impl Trait + ?Sized` cannot be known at compilation time
--> $DIR/unsized_coercion5.rs:16:32
--> $DIR/unsized_coercion5.rs:17:32
|
LL | let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
| ^ doesn't have a size known at compile-time
|
= help: the trait `Sized` is not implemented for `impl Trait + ?Sized`
= note: required for the cast from `Box<impl Trait + ?Sized>` to `Box<dyn Trait + Send>`

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
For more information about this error, try `rustc --explain E0277`.
4 changes: 2 additions & 2 deletions tests/ui/impl-trait/unsized_coercion5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//@ revisions: next old
//@[next] compile-flags: -Znext-solver
//@[next] check-pass

#![feature(trait_upcasting)]

Expand All @@ -14,9 +15,8 @@ fn hello() -> Box<impl Trait + ?Sized> {
if true {
let x = hello();
let y: Box<dyn Send> = x as Box<dyn Trait + Send>;
//[old]~^ ERROR: the size for values of type `impl Trait + ?Sized` cannot be know
//[old]~^ ERROR: the size for values of type `impl Trait + ?Sized` cannot be known
//[old]~| ERROR: cannot check whether the hidden type of opaque type satisfies auto traits
//~^^^ ERROR: mismatched types
}
Box::new(1u32)
}
Expand Down

0 comments on commit 3d0856e

Please sign in to comment.