mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-17 02:08:28 +00:00
23 lines
402 B
Rust
23 lines
402 B
Rust
// run-rustfix
|
|
|
|
#![feature(stmt_expr_attributes)]
|
|
#![allow(unused_variables, dead_code)]
|
|
|
|
struct Outer {
|
|
inner: u32,
|
|
}
|
|
|
|
#[deny(clippy::ref_in_deref)]
|
|
fn main() {
|
|
let outer = Outer { inner: 0 };
|
|
let inner = (&outer).inner;
|
|
}
|
|
|
|
struct Apple;
|
|
impl Apple {
|
|
fn hello(&self) {}
|
|
}
|
|
struct Package(pub *const Apple);
|
|
fn foobar(package: *const Package) {
|
|
unsafe { &*(&*package).0 }.hello();
|
|
}
|