Auto merge of #10989 - ericmarkmartin:use-placeref-abstraction, r=Manishearth
Use placeref abstraction rust-lang/rust#80647 suggests refactoring certain patterns with MIR places to use higher-level abstractions provided by the [`Place`](https://doc.rust-lang.org/stable/nightly-rustc/rustc_middle/mir/struct.Place.html)/[`PlaceRef`](https://doc.rust-lang.org/stable/nightly-rustc/rustc_middle/mir/struct.PlaceRef.html). While working on that issue, I found a couple candidates for such refactoring in clippy. *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: none
This commit is contained in:
commit
1919dff4ee
3 changed files with 16 additions and 15 deletions
|
|
@ -157,3 +157,12 @@ impl Issue10617 {
|
|||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
union U {
|
||||
f: u32,
|
||||
}
|
||||
|
||||
// Do not lint because accessing union fields from const functions is unstable
|
||||
fn h(u: U) -> u32 {
|
||||
unsafe { u.f }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue