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