]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/unnecessary_ref.fixed
Rollup merge of #84221 - ABouttefeux:generic-arg-elision, r=estebank
[rust.git] / src / tools / clippy / tests / ui / unnecessary_ref.fixed
1 // run-rustfix
2
3 #![feature(stmt_expr_attributes)]
4 #![allow(unused_variables, dead_code)]
5
6 struct Outer {
7     inner: u32,
8 }
9
10 #[deny(clippy::ref_in_deref)]
11 fn main() {
12     let outer = Outer { inner: 0 };
13     let inner = outer.inner;
14 }
15
16 struct Apple;
17 impl Apple {
18     fn hello(&self) {}
19 }
20 struct Package(pub *const Apple);
21 fn foobar(package: *const Package) {
22     unsafe { &*(*package).0 }.hello();
23 }