|
| 1 | +warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes |
| 2 | + --> $DIR/closure-infer.rs:4:12 |
| 3 | + | |
| 4 | +LL | #![feature(non_lifetime_binders)] |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^ |
| 6 | + | |
| 7 | + = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information |
| 8 | + = note: `#[warn(incomplete_features)]` on by default |
| 9 | + |
| 10 | +error[E0277]: expected a `Fn<(T,)>` closure, found `[closure@$DIR/closure-infer.rs:16:5: 16:8]` |
| 11 | + --> $DIR/closure-infer.rs:12:15 |
| 12 | + | |
| 13 | +LL | fn take2() -> impl for<T> Fn(T) -> T { |
| 14 | + | ^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn<(T,)>` closure, found `[closure@$DIR/closure-infer.rs:16:5: 16:8]` |
| 15 | + | |
| 16 | + = help: the trait `Fn<(T,)>` is not implemented for closure `[closure@$DIR/closure-infer.rs:16:5: 16:8]` |
| 17 | + |
| 18 | +error[E0277]: expected a `FnOnce<(T,)>` closure, found `[closure@$DIR/closure-infer.rs:16:5: 16:8]` |
| 19 | + --> $DIR/closure-infer.rs:12:15 |
| 20 | + | |
| 21 | +LL | fn take2() -> impl for<T> Fn(T) -> T { |
| 22 | + | ^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(T,)>` closure, found `[closure@$DIR/closure-infer.rs:16:5: 16:8]` |
| 23 | + | |
| 24 | + = help: the trait `FnOnce<(T,)>` is not implemented for closure `[closure@$DIR/closure-infer.rs:16:5: 16:8]` |
| 25 | + |
| 26 | +error[E0277]: expected a `Fn<(T,)>` closure, found `[closure@$DIR/closure-infer.rs:20:10: 20:13]` |
| 27 | + --> $DIR/closure-infer.rs:20:10 |
| 28 | + | |
| 29 | +LL | take(|x| x) |
| 30 | + | ---- ^^^^^ expected an `Fn<(T,)>` closure, found `[closure@$DIR/closure-infer.rs:20:10: 20:13]` |
| 31 | + | | |
| 32 | + | required by a bound introduced by this call |
| 33 | + | |
| 34 | + = help: the trait `Fn<(T,)>` is not implemented for closure `[closure@$DIR/closure-infer.rs:20:10: 20:13]` |
| 35 | +note: required by a bound in `take` |
| 36 | + --> $DIR/closure-infer.rs:7:18 |
| 37 | + | |
| 38 | +LL | fn take(id: impl for<T> Fn(T) -> T) { |
| 39 | + | ^^^^^^^^^^^^^^^^^ required by this bound in `take` |
| 40 | + |
| 41 | +error[E0277]: expected a `FnOnce<(T,)>` closure, found `[closure@$DIR/closure-infer.rs:20:10: 20:13]` |
| 42 | + --> $DIR/closure-infer.rs:20:10 |
| 43 | + | |
| 44 | +LL | take(|x| x) |
| 45 | + | ---- ^^^^^ expected an `FnOnce<(T,)>` closure, found `[closure@$DIR/closure-infer.rs:20:10: 20:13]` |
| 46 | + | | |
| 47 | + | required by a bound introduced by this call |
| 48 | + | |
| 49 | + = help: the trait `FnOnce<(T,)>` is not implemented for closure `[closure@$DIR/closure-infer.rs:20:10: 20:13]` |
| 50 | +note: required by a bound in `take` |
| 51 | + --> $DIR/closure-infer.rs:7:34 |
| 52 | + | |
| 53 | +LL | fn take(id: impl for<T> Fn(T) -> T) { |
| 54 | + | ^ required by this bound in `take` |
| 55 | + |
| 56 | +error: aborting due to 4 previous errors; 1 warning emitted |
| 57 | + |
| 58 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments