2023-05-20 08:39:26 -05:00
|
|
|
#![allow(unused)]
|
|
|
|
#![warn(clippy::ref_patterns)]
|
|
|
|
|
|
|
|
fn use_in_pattern() {
|
|
|
|
let opt = Some(5);
|
|
|
|
match opt {
|
|
|
|
None => {},
|
|
|
|
Some(ref opt) => {},
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: usage of ref pattern
|
2023-05-20 08:39:26 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn use_in_binding() {
|
|
|
|
let x = 5;
|
|
|
|
let ref y = x;
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: usage of ref pattern
|
2023-05-20 08:39:26 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn use_in_parameter(ref x: i32) {}
|
2023-08-24 14:32:12 -05:00
|
|
|
//~^ ERROR: usage of ref pattern
|
2023-05-20 08:39:26 -05:00
|
|
|
|
|
|
|
fn main() {}
|