Skip to content

Commit 1c333b6

Browse files
committed
Auto merge of #150447 - WaffleLapkin:maybe-dangling-semantics, r=RalfJung
Implement `MaybeDangling` compiler support Tracking issue: rust-lang/rust#118166 cc @RalfJung
2 parents 459d84d + e88e7b9 commit 1c333b6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/type_of.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
288288
Float(f) => cx.type_from_float(f),
289289
Pointer(address_space) => {
290290
// If we know the alignment, pick something better than i8.
291-
let pointee = if let Some(pointee) = self.pointee_info_at(cx, offset) {
291+
let pointee = if let Some(pointee) = self.pointee_info_at(cx, offset)
292+
&& pointee.align > rustc_abi::Align::ONE
293+
{
292294
cx.type_pointee_for_align(pointee.align)
293295
} else {
294296
cx.type_i8()

0 commit comments

Comments
 (0)