]> git.lizzy.rs Git - rust.git/blob - src/test/ui/expr/malformed_closure/ruby_style_closure.stderr
Avoid trying to normalize unnormalizable types
[rust.git] / src / test / ui / expr / malformed_closure / ruby_style_closure.stderr
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)
17    | |         ----------- this tail expression is of type `std::option::Option<_>`
18 LL | |
19 LL | |     });
20    | |_____^ expected an `FnOnce<({integer},)>` closure, found `Option<_>`
21    |
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
25    |
26 LL |         F: ~const FnOnce(T) -> Option<U>,
27    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::and_then`
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`.