]>
Commit | Line | Data |
---|---|---|
c295e0f8 XL |
1 | error[E0425]: cannot find value `x` in this scope |
2 | --> $DIR/ruby_style_closure.rs:13:14 | |
3 | | | |
4 | LL | Some(x * 2) | |
5 | | ^ not found in this scope | |
6 | ||
7 | error[E0277]: expected a `FnOnce<({integer},)>` closure, found `Option<_>` | |
8 | --> $DIR/ruby_style_closure.rs:10:31 | |
9 | | | |
10 | LL | let p = Some(45).and_then({ | |
11 | | ______________________--------_^ | |
12 | | | | | |
13 | | | required by a bound introduced by this call | |
14 | LL | | | |
15 | LL | | |x| println!("doubling {}", x); | |
16 | LL | | Some(x * 2) | |
2b03887a | 17 | | | ----------- this tail expression is of type `std::option::Option<_>` |
c295e0f8 XL |
18 | LL | | |
19 | LL | | }); | |
20 | | |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<_>` | |
21 | | | |
22 | = help: the trait `FnOnce<({integer},)>` is not implemented for `Option<_>` | |
3c0e092e XL |
23 | note: required by a bound in `Option::<T>::and_then` |
24 | --> $SRC_DIR/core/src/option.rs:LL:COL | |
25 | | | |
a2a8927a XL |
26 | LL | F: ~const FnOnce(T) -> Option<U>, |
27 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::and_then` | |
c295e0f8 XL |
28 | |
29 | error: aborting due to 2 previous errors | |
30 | ||
31 | Some errors have detailed explanations: E0277, E0425. | |
32 | For more information about an error, try `rustc --explain E0277`. |