about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/misnamed_getters_2021.fixed
blob: 7112719a9f284edba418e812a87e22aadea96203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//@edition: 2021
#![allow(unused)]
#![allow(clippy::struct_field_names)]
#![warn(clippy::misnamed_getters)]

// Edition 2021 specific check, where `unsafe` blocks are not required
// inside `unsafe fn`.

union B {
    a: u8,
    b: u8,
}

impl B {
    unsafe fn a(&self) -> &u8 {
        //~^ misnamed_getters

        &self.a
    }
}

fn main() {
    // test code goes here
}