summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/ref_patterns.rs
blob: c51e0bc76efdab9862deaf47f93235af5aac2669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#![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() {}