3 // The output for humans should just highlight the whole span without showing
4 // the suggested replacement, but we also want to test that suggested
5 // replacement only removes one set of parentheses, rather than naïvely
6 // stripping away any starting or ending parenthesis characters—hence this
7 // test of the JSON error format.
9 #![deny(clippy::unused_unit)]
10 #![allow(clippy::needless_return)]
14 // try to disorient the lint with multiple unit returns and newlines
15 pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) ->
18 let _y: &Fn() -> () = &f;
19 (); // this should not lint, as it's not in return type position
23 impl Into<()> for Unitter {
30 fn return_unit() -> () { () }
34 assert_eq!(u.get_unit(|| {}, return_unit), u.into());