rust/tests/ui/non_expressive_names.rs

57 lines
1005 B
Rust
Raw Normal View History

#![warn(clippy::all)]
2018-07-28 10:34:52 -05:00
#![allow(unused, clippy::println_empty_string)]
#[derive(Clone, Debug)]
enum MaybeInst {
Split,
Split1(usize),
Split2(usize),
}
struct InstSplit {
uiae: usize,
}
impl MaybeInst {
fn fill(&mut self) {
let filled = match *self {
2021-10-23 02:42:52 -05:00
MaybeInst::Split1(goto1) => panic!("1"),
MaybeInst::Split2(goto2) => panic!("2"),
_ => unimplemented!(),
};
unimplemented!()
}
}
fn underscores_and_numbers() {
let _1 = 1; //~ERROR Consider a more descriptive name
let ____1 = 1; //~ERROR Consider a more descriptive name
let __1___2 = 12; //~ERROR Consider a more descriptive name
2018-12-09 16:26:16 -06:00
let _1_ok = 1;
2017-11-03 15:54:33 -05:00
}
2018-02-02 00:49:47 -06:00
2018-08-15 01:11:07 -05:00
fn issue2927() {
2018-12-09 16:26:16 -06:00
let args = 1;
format!("{:?}", 2);
2018-08-15 01:11:07 -05:00
}
2018-08-25 07:49:56 -05:00
fn issue3078() {
match "a" {
stringify!(a) => {},
2018-12-09 16:26:16 -06:00
_ => {},
2018-08-25 07:49:56 -05:00
}
}
2018-02-02 00:49:47 -06:00
struct Bar;
impl Bar {
fn bar() {
let _1 = 1;
let ____1 = 1;
let __1___2 = 12;
2018-12-09 16:26:16 -06:00
let _1_ok = 1;
2018-02-02 00:49:47 -06:00
}
}
fn main() {}