+// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![warn(
+ clippy::all,
+ clippy::pedantic,
+ clippy::shadow_same,
+ clippy::shadow_reuse,
+ clippy::shadow_unrelated
+)]
+#![allow(unused_parens, unused_variables, clippy::missing_docs_in_private_items)]
+
+fn id<T>(x: T) -> T {
+ x
+}
-
-
-#![warn(clippy, clippy_pedantic)]
-#![allow(unused_parens, unused_variables, missing_docs_in_private_items)]
-
-fn id<T>(x: T) -> T { x }
-
-fn first(x: (isize, isize)) -> isize { x.0 }
+fn first(x: (isize, isize)) -> isize {
+ x.0
+}
fn main() {
let mut x = 1;
let o = Some(1_u8);
- if let Some(p) = o { assert_eq!(1, p); }
+ if let Some(p) = o {
+ assert_eq!(1, p);
+ }
match o {
Some(p) => p, // no error, because the p above is in its own scope
None => 0,