]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/redundant_closure_call_early.rs
Update upstream source from tag 'upstream/1.52.1+dfsg1'
[rustc.git] / src / tools / clippy / tests / ui / redundant_closure_call_early.rs
CommitLineData
f20569fa
XL
1// non rustfixable, see redundant_closure_call_fixable.rs
2
3#![warn(clippy::redundant_closure_call)]
4
5fn main() {
6 let mut i = 1;
7
8 // lint here
9 let mut k = (|m| m + 1)(i);
10
11 // lint here
12 k = (|a, b| a * b)(1, 5);
13
14 // don't lint these
15 #[allow(clippy::needless_return)]
16 (|| return 2)();
17 (|| -> Option<i32> { None? })();
18 (|| -> Result<i32, i32> { Err(2)? })();
19}