mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
27 lines
598 B
Rust
27 lines
598 B
Rust
//@run-rustfix
|
|
//@aux-build:proc_macros.rs:proc-macro
|
|
#![allow(irrefutable_let_patterns, unused)]
|
|
#![warn(clippy::redundant_at_rest_pattern)]
|
|
|
|
#[macro_use]
|
|
extern crate proc_macros;
|
|
|
|
fn main() {
|
|
if let a = [()] {}
|
|
if let ref a = [()] {}
|
|
if let mut a = [()] {}
|
|
if let ref mut a = [()] {}
|
|
let v = vec![()];
|
|
if let a = &*v {}
|
|
let s = &[()];
|
|
if let a = s {}
|
|
// Don't lint
|
|
if let [..] = &*v {}
|
|
if let [a] = &*v {}
|
|
if let [()] = &*v {}
|
|
if let [first, rest @ ..] = &*v {}
|
|
if let a = [()] {}
|
|
external! {
|
|
if let [a @ ..] = [()] {}
|
|
}
|
|
}
|