mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
95 lines
1.6 KiB
Rust
95 lines
1.6 KiB
Rust
#![feature(deref_patterns)]
|
|
#![allow(
|
|
incomplete_features,
|
|
clippy::eq_op,
|
|
clippy::op_ref,
|
|
clippy::deref_addrof,
|
|
clippy::borrow_deref_ref,
|
|
clippy::needless_if
|
|
)]
|
|
#![deny(clippy::single_match_else)]
|
|
|
|
fn string() {
|
|
match *"" {
|
|
//~^ single_match
|
|
"" => {},
|
|
_ => {},
|
|
}
|
|
|
|
match *&*&*&*"" {
|
|
//~^ single_match
|
|
"" => {},
|
|
_ => {},
|
|
}
|
|
|
|
match ***&&"" {
|
|
//~^ single_match
|
|
"" => {},
|
|
_ => {},
|
|
}
|
|
|
|
match *&*&*"" {
|
|
//~^ single_match
|
|
"" => {},
|
|
_ => {},
|
|
}
|
|
|
|
match **&&*"" {
|
|
//~^ single_match
|
|
"" => {},
|
|
_ => {},
|
|
}
|
|
}
|
|
|
|
fn int() {
|
|
match &&&1 {
|
|
&&&2 => unreachable!(),
|
|
_ => {
|
|
// ok
|
|
},
|
|
}
|
|
//~^^^^^^ single_match_else
|
|
match &&&1 {
|
|
&&2 => unreachable!(),
|
|
_ => {
|
|
// ok
|
|
},
|
|
}
|
|
//~^^^^^^ single_match_else
|
|
match &&1 {
|
|
&&2 => unreachable!(),
|
|
_ => {
|
|
// ok
|
|
},
|
|
}
|
|
//~^^^^^^ single_match_else
|
|
match &&&1 {
|
|
&2 => unreachable!(),
|
|
_ => {
|
|
// ok
|
|
},
|
|
}
|
|
//~^^^^^^ single_match_else
|
|
match &&1 {
|
|
&2 => unreachable!(),
|
|
_ => {
|
|
// ok
|
|
},
|
|
}
|
|
//~^^^^^^ single_match_else
|
|
match &&&1 {
|
|
2 => unreachable!(),
|
|
_ => {
|
|
// ok
|
|
},
|
|
}
|
|
//~^^^^^^ single_match_else
|
|
match &&1 {
|
|
2 => unreachable!(),
|
|
_ => {
|
|
// ok
|
|
},
|
|
}
|
|
//~^^^^^^ single_match_else
|
|
}
|