|
| 1 | +error[E0277]: the trait bound `{closure@$DIR/closure-mismatch.rs:12:9: 12:12}: Foo` is not satisfied |
| 2 | + --> $DIR/closure-mismatch.rs:12:9 |
| 3 | + | |
| 4 | +LL | baz(|_| ()); |
| 5 | + | --- ^^^^^^ unsatisfied trait bound |
| 6 | + | | |
| 7 | + | required by a bound introduced by this call |
| 8 | + | |
| 9 | + = help: the trait `for<'a> FnOnce(&'a ())` is not implemented for closure `{closure@$DIR/closure-mismatch.rs:12:9: 12:12}` |
| 10 | + = note: expected a closure with arguments `(&(),)` |
| 11 | + found a closure with arguments `(&(),)` |
| 12 | +note: this is a known limitation of the trait solver that will be lifted in the future |
| 13 | + --> $DIR/closure-mismatch.rs:12:9 |
| 14 | + | |
| 15 | +LL | baz(|_| ()); |
| 16 | + | ----^^^---- |
| 17 | + | | | |
| 18 | + | | the trait solver is unable to infer the generic types that should be inferred from this argument |
| 19 | + | add turbofish arguments to this call to specify the types manually, even if it's redundant |
| 20 | +note: required for `{closure@$DIR/closure-mismatch.rs:12:9: 12:12}` to implement `Foo` |
| 21 | + --> $DIR/closure-mismatch.rs:7:18 |
| 22 | + | |
| 23 | +LL | impl<T: Fn(&())> Foo for T {} |
| 24 | + | ------- ^^^ ^ |
| 25 | + | | |
| 26 | + | unsatisfied trait bound introduced here |
| 27 | +note: required by a bound in `baz` |
| 28 | + --> $DIR/closure-mismatch.rs:9:11 |
| 29 | + | |
| 30 | +LL | fn baz<T: Foo>(_: T) {} |
| 31 | + | ^^^ required by this bound in `baz` |
| 32 | + |
| 33 | +error[E0277]: the trait bound `{closure@$DIR/closure-mismatch.rs:16:9: 16:12}: Foo` is not satisfied |
| 34 | + --> $DIR/closure-mismatch.rs:16:9 |
| 35 | + | |
| 36 | +LL | baz(|x| ()); |
| 37 | + | --- ^^^^^^ unsatisfied trait bound |
| 38 | + | | |
| 39 | + | required by a bound introduced by this call |
| 40 | + | |
| 41 | + = help: the trait `for<'a> FnOnce(&'a ())` is not implemented for closure `{closure@$DIR/closure-mismatch.rs:16:9: 16:12}` |
| 42 | + = note: expected a closure with arguments `(&(),)` |
| 43 | + found a closure with arguments `(&(),)` |
| 44 | +note: this is a known limitation of the trait solver that will be lifted in the future |
| 45 | + --> $DIR/closure-mismatch.rs:16:9 |
| 46 | + | |
| 47 | +LL | baz(|x| ()); |
| 48 | + | ----^^^---- |
| 49 | + | | | |
| 50 | + | | the trait solver is unable to infer the generic types that should be inferred from this argument |
| 51 | + | add turbofish arguments to this call to specify the types manually, even if it's redundant |
| 52 | +note: required for `{closure@$DIR/closure-mismatch.rs:16:9: 16:12}` to implement `Foo` |
| 53 | + --> $DIR/closure-mismatch.rs:7:18 |
| 54 | + | |
| 55 | +LL | impl<T: Fn(&())> Foo for T {} |
| 56 | + | ------- ^^^ ^ |
| 57 | + | | |
| 58 | + | unsatisfied trait bound introduced here |
| 59 | +note: required by a bound in `baz` |
| 60 | + --> $DIR/closure-mismatch.rs:9:11 |
| 61 | + | |
| 62 | +LL | fn baz<T: Foo>(_: T) {} |
| 63 | + | ^^^ required by this bound in `baz` |
| 64 | + |
| 65 | +error: aborting due to 2 previous errors |
| 66 | + |
| 67 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments