rust/tests/ui/impl-trait/unsized_coercion.next.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
804 B
Plaintext
Raw Normal View History

2024-05-28 10:38:18 -05:00
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`.