1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
11 #![feature(tool_lints)]
14 #![warn(clippy::double_parens)]
17 fn dummy_fn<T>(_: T) {}
22 fn dummy_method<T>(self, _: T) {}
25 fn simple_double_parens() -> i32 {
29 fn fn_double_parens() {
33 fn method_double_parens(x: DummyStruct) {
37 fn tuple_double_parens() -> (i32, i32) {
41 fn unit_double_parens() {
49 fn method_tuple_ok(x: DummyStruct) {
50 x.dummy_method((1, 2));
57 fn method_unit_ok(x: DummyStruct) {
63 assert_eq!((1, 2), (1, 2), "Error");
64 assert_eq!(((1, 2)), (1, 2), "Error");