2020-11-04 08:07:40 +00:00
|
|
|
error: at least one trait must be specified
|
|
|
|
--> $DIR/issue-78720.rs:1:16
|
|
|
|
|
|
|
|
|
LL | fn server() -> impl {
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
error[E0412]: cannot find type `F` in this scope
|
|
|
|
--> $DIR/issue-78720.rs:13:12
|
|
|
|
|
|
|
|
|
LL | _func: F,
|
|
|
|
| ^
|
2022-12-09 15:56:23 +00:00
|
|
|
--> $SRC_DIR/core/src/ops/function.rs:LL:COL
|
2021-06-10 11:52:00 +00:00
|
|
|
|
|
2022-12-09 15:56:23 +00:00
|
|
|
= note: similarly named trait `Fn` defined here
|
2020-11-04 08:07:40 +00:00
|
|
|
|
|
|
|
|
help: a trait with a similar name exists
|
|
|
|
|
|
|
|
|
LL | _func: Fn,
|
2021-06-22 02:07:19 +00:00
|
|
|
| ~~
|
2020-11-04 08:07:40 +00:00
|
|
|
help: you might be missing a type parameter
|
|
|
|
|
|
|
|
|
LL | struct Map2<Segment2, F> {
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++
|
2020-11-04 08:07:40 +00:00
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
2021-03-08 23:43:18 +00:00
|
|
|
--> $DIR/issue-78720.rs:7:39
|
2020-11-04 08:07:40 +00:00
|
|
|
|
|
2021-03-08 23:43:18 +00:00
|
|
|
LL | fn map2<F>(self, f: F) -> Map2<F> {}
|
|
|
|
| ^^ expected struct `Map2`, found `()`
|
2020-11-04 08:07:40 +00:00
|
|
|
|
|
|
|
|
= note: expected struct `Map2<F>`
|
|
|
|
found unit type `()`
|
|
|
|
|
|
|
|
error[E0277]: the size for values of type `Self` cannot be known at compilation time
|
|
|
|
--> $DIR/issue-78720.rs:7:16
|
|
|
|
|
|
2021-03-08 23:43:18 +00:00
|
|
|
LL | fn map2<F>(self, f: F) -> Map2<F> {}
|
2020-11-04 08:07:40 +00:00
|
|
|
| ^^^^ doesn't have a size known at compile-time
|
|
|
|
|
|
|
|
|
= help: unsized fn params are gated as an unstable feature
|
|
|
|
help: consider further restricting `Self`
|
|
|
|
|
|
2021-03-08 23:43:18 +00:00
|
|
|
LL | fn map2<F>(self, f: F) -> Map2<F> where Self: Sized {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++++++++++++++++
|
2020-11-04 08:07:40 +00:00
|
|
|
help: function arguments must have a statically known size, borrowed types always have a known size
|
|
|
|
|
|
2021-03-08 23:43:18 +00:00
|
|
|
LL | fn map2<F>(&self, f: F) -> Map2<F> {}
|
2021-06-22 02:07:19 +00:00
|
|
|
| +
|
2020-11-04 08:07:40 +00:00
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
|
|
|
Some errors have detailed explanations: E0277, E0308, E0412.
|
|
|
|
For more information about an error, try `rustc --explain E0277`.
|