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)]
13 use std::collections::HashSet;
23 // Not yet testing for multi-byte characters
24 // Changing `r.len() == 1` to `r.chars().count() == 1` in `lint_clippy::single_char_pattern`
25 // should have done this but produced an ICE
27 // We may not want to suggest changing these anyway
28 // See: https://github.com/rust-lang-nursery/rust-clippy/issues/650#issuecomment-184328984
32 // Can't use this lint for unicode code points which don't fit in a char
40 x.split_terminator("x");
41 x.rsplit_terminator("x");
47 x.rmatch_indices("x");
48 x.trim_left_matches("x");
49 x.trim_right_matches("x");
50 // Make sure we escape characters correctly.
53 let h = HashSet::<String>::new();
54 h.contains("X"); // should not warn
56 x.replace(";", ",").split(","); // issue #2978
57 x.starts_with("\x03"); // issue #2996