rust/tests/ui/ref_patterns.rs

20 lines
277 B
Rust
Raw Normal View History

2023-05-08 06:20:33 -05:00
#![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() {}