]> git.lizzy.rs Git - rust.git/blob - tests/ui/double_parens.rs
Adapt the *.stderr files of the ui-tests to the tool_lints
[rust.git] / tests / ui / double_parens.rs
1 #![feature(tool_lints)]
2
3
4 #![warn(clippy::double_parens)]
5 #![allow(dead_code)]
6
7 fn dummy_fn<T>(_: T) {}
8
9 struct DummyStruct;
10
11 impl DummyStruct {
12     fn dummy_method<T>(self, _: T) {}
13 }
14
15 fn simple_double_parens() -> i32 {
16     ((0))
17 }
18
19 fn fn_double_parens() {
20     dummy_fn((0));
21 }
22
23 fn method_double_parens(x: DummyStruct) {
24     x.dummy_method((0));
25 }
26
27 fn tuple_double_parens() -> (i32, i32) {
28     ((1, 2))
29 }
30
31 fn unit_double_parens() {
32     (())
33 }
34
35 fn fn_tuple_ok() {
36     dummy_fn((1, 2));
37 }
38
39 fn method_tuple_ok(x: DummyStruct) {
40     x.dummy_method((1, 2));
41 }
42
43 fn fn_unit_ok() {
44     dummy_fn(());
45 }
46
47 fn method_unit_ok(x: DummyStruct) {
48     x.dummy_method(());
49 }
50
51 fn main() {}