2018-12-09 09:18:16 -06:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
#![feature(stmt_expr_attributes)]
|
2021-01-19 08:51:10 -06:00
|
|
|
#![allow(unused_variables, dead_code)]
|
2018-12-09 09:18:16 -06:00
|
|
|
|
|
|
|
struct Outer {
|
|
|
|
inner: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[deny(clippy::ref_in_deref)]
|
|
|
|
fn main() {
|
|
|
|
let outer = Outer { inner: 0 };
|
2018-12-09 10:25:45 -06:00
|
|
|
let inner = outer.inner;
|
2018-12-09 09:18:16 -06:00
|
|
|
}
|
2021-01-19 08:51:10 -06:00
|
|
|
|
|
|
|
struct Apple;
|
|
|
|
impl Apple {
|
|
|
|
fn hello(&self) {}
|
|
|
|
}
|
|
|
|
struct Package(pub *const Apple);
|
|
|
|
fn foobar(package: *const Package) {
|
|
|
|
unsafe { &*(*package).0 }.hello();
|
|
|
|
}
|