Closed
Description
The code is obviously silly, but I did run into the essential problem genuinely:
fn foo(f: impl Fn()) {
f();
foo(&f);
}
fn main() {
foo(|| {});
}
cargo check
does mention unconditional recursion although that's not the real problem and that warning can be dodged (without fixing cargo build
) by making the code a little more complicated.
I had assumed that cargo check
passing where cargo build
failed was a bug, but I've been told by @dtolnay that that's not quite true. He did say to file the bug anyway?
cargo 1.42.1, rustc 1.42.0