rust/tests/ui/impl-trait/unsized_coercion.next.stderr
2024-06-19 08:28:31 +00:00

27 lines
804 B
Plaintext

error[E0271]: type mismatch resolving `impl Trait <: dyn Trait`
--> $DIR/unsized_coercion.rs:14:17
|
LL | let x = hello();
| ^^^^^^^ types differ
error[E0308]: mismatched types
--> $DIR/unsized_coercion.rs:18:14
|
LL | fn hello() -> Box<impl Trait> {
| ---------- the expected opaque type
...
LL | Box::new(1u32)
| -------- ^^^^ types differ
| |
| arguments to this function are incorrect
|
= note: expected opaque type `impl Trait`
found type `u32`
note: associated function defined here
--> $SRC_DIR/alloc/src/boxed.rs:LL:COL
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0271, E0308.
For more information about an error, try `rustc --explain E0271`.