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 #![allow(unused_variables, unused_assignments, clippy::similar_names, clippy::blacklisted_name)]
15 #![warn(clippy::useless_let_if_seq)]
17 fn f() -> bool { true }
18 fn g(x: i32) -> i32 { x + 1 }
20 fn issue985() -> i32 {
29 fn issue985_alt() -> i32 {
40 fn issue975() -> String {
41 let mut udn = "dummy".to_string();
42 if udn.starts_with("uuid:") {
43 udn = String::from(&udn[5..]);
48 fn early_return() -> u8 {
49 // FIXME: we could extend the lint to include such cases:
88 // `toto` is used several times
100 // found in libcore, the inner if is not a statement but the block's expr
109 // baz needs to be mut