mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
20 lines
277 B
Rust
20 lines
277 B
Rust
|
#![allow(unused)]
|
||
|
#![warn(clippy::ref_patterns)]
|
||
|
|
||
|
fn use_in_pattern() {
|
||
|
let opt = Some(5);
|
||
|
match opt {
|
||
|
None => {},
|
||
|
Some(ref opt) => {},
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn use_in_binding() {
|
||
|
let x = 5;
|
||
|
let ref y = x;
|
||
|
}
|
||
|
|
||
|
fn use_in_parameter(ref x: i32) {}
|
||
|
|
||
|
fn main() {}
|