mirror of
https://github.com/rust-lang/rust
synced 2024-09-15 22:50:55 +00:00
46 lines
1.7 KiB
Plaintext
46 lines
1.7 KiB
Plaintext
error[E0271]: type mismatch resolving `impl !Sized + Sized == ()`
|
|
--> $DIR/opaque-type-unsatisfied-bound.rs:15:16
|
|
|
|
|
LL | fn weird0() -> impl Sized + !Sized {}
|
|
| ^^^^^^^^^^^^^^^^^^^ types differ
|
|
|
|
error[E0271]: type mismatch resolving `impl !Sized + Sized == ()`
|
|
--> $DIR/opaque-type-unsatisfied-bound.rs:17:16
|
|
|
|
|
LL | fn weird1() -> impl !Sized + Sized {}
|
|
| ^^^^^^^^^^^^^^^^^^^ types differ
|
|
|
|
error[E0271]: type mismatch resolving `impl !Sized == ()`
|
|
--> $DIR/opaque-type-unsatisfied-bound.rs:19:16
|
|
|
|
|
LL | fn weird2() -> impl !Sized {}
|
|
| ^^^^^^^^^^^ types differ
|
|
|
|
error[E0277]: the size for values of type `impl !Sized` cannot be known at compilation time
|
|
--> $DIR/opaque-type-unsatisfied-bound.rs:19:16
|
|
|
|
|
LL | fn weird2() -> impl !Sized {}
|
|
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
|
|
|
|
= help: the trait `Sized` is not implemented for `impl !Sized`
|
|
= note: the return type of a function must have a statically known size
|
|
|
|
error[E0277]: the trait bound `impl !Trait: Trait` is not satisfied
|
|
--> $DIR/opaque-type-unsatisfied-bound.rs:12:13
|
|
|
|
|
LL | consume(produce());
|
|
| ------- ^^^^^^^^^ the trait `Trait` is not implemented for `impl !Trait`
|
|
| |
|
|
| required by a bound introduced by this call
|
|
|
|
|
note: required by a bound in `consume`
|
|
--> $DIR/opaque-type-unsatisfied-bound.rs:9:20
|
|
|
|
|
LL | fn consume(_: impl Trait) {}
|
|
| ^^^^^ required by this bound in `consume`
|
|
|
|
error: aborting due to 5 previous errors
|
|
|
|
Some errors have detailed explanations: E0271, E0277.
|
|
For more information about an error, try `rustc --explain E0271`.
|