We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 77497c7 commit 1458687Copy full SHA for 1458687
compiler/rustc_typeck/src/check/upvar.rs
@@ -1639,7 +1639,8 @@ fn restrict_repr_packed_field_ref_capture<'tcx>(
1639
match p.kind {
1640
ProjectionKind::Field(..) => match ty.kind() {
1641
ty::Adt(def, _) if def.repr.packed() => {
1642
- match tcx.layout_of(param_env.and(p.ty)) {
+ // We erase regions here because they cannot be hashed
1643
+ match tcx.layout_of(param_env.and(tcx.erase_regions(p.ty))) {
1644
Ok(layout) if layout.align.abi.bytes() == 1 => {
1645
// if the alignment is 1, the type can't be further
1646
// disaligned.
0 commit comments