mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 12:36:35 +03:00
25 lines
377 B
Rust
25 lines
377 B
Rust
//@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
|
|
}
|