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