We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f88212c commit 401ced3Copy full SHA for 401ced3
src/librustc_mir/analysis/local_paths/collect.rs
@@ -58,7 +58,9 @@ impl<'tcx> PathTree<'tcx> {
58
match *elem {
59
ProjectionElem::Field(f, ty) => {
60
if let Some(adt) = self.ty.ty_adt_def() {
61
- if adt.is_union() {
+ // Unions and packed types have additional (safety-related)
62
+ // restrictions and it's easier to just not look into them.
63
+ if adt.is_union() || adt.repr.packed() {
64
return None;
65
}
66
0 commit comments