1// run-rustfix
2
3#![feature(stmt_expr_attributes)]
4#![allow(unused_variables, dead_code)]
5
6struct Outer {
7    inner: u32,
8}
9
10#[deny(clippy::ref_in_deref)]
11fn main() {
12    let outer = Outer { inner: 0 };
13    let inner = outer.inner;
14}
15
16struct Apple;
17impl Apple {
18    fn hello(&self) {}
19}
20struct Package(pub *const Apple);
21fn foobar(package: *const Package) {
22    unsafe { &*(*package).0 }.hello();
23}
24