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.
10 #![warn(clippy::double_parens)]
12 fn dummy_fn<T>(_: T) {}
17 fn dummy_method<T>(self, _: T) {}
20 fn simple_double_parens() -> i32 {
24 fn fn_double_parens() {
28 fn method_double_parens(x: DummyStruct) {
32 fn tuple_double_parens() -> (i32, i32) {
36 fn unit_double_parens() {
44 fn method_tuple_ok(x: DummyStruct) {
45 x.dummy_method((1, 2));
52 fn method_unit_ok(x: DummyStruct) {
58 assert_eq!((1, 2), (1, 2), "Error");
59 assert_eq!(((1, 2)), (1, 2), "Error");