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