]> git.proxmox.com Git - rustc.git/blob - src/test/ui/inference/cannot-infer-closure-circular.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / inference / cannot-infer-closure-circular.rs
1 fn main() {
2 // Below we call the closure with its own return as the argument, unifying
3 // its inferred input and return types. We want to make sure that the generated
4 // error handles this gracefully, and in particular doesn't generate an extra
5 // note about the `?` operator in the closure body, which isn't relevant to
6 // the inference.
7 let x = |r| { //~ ERROR type annotations needed for `Result<(), E>`
8 let v = r?;
9 Ok(v)
10 };
11
12 let _ = x(x(Ok(())));
13 }