| ... | @@ -35010,6 +35010,7 @@ fn resolvePeerTypesInner( | ... | @@ -35010,6 +35010,7 @@ fn resolvePeerTypesInner( |
| 35010 | // if there were no actual slices. Else, we want the slice index to report a conflict. | 35010 | // if there were no actual slices. Else, we want the slice index to report a conflict. |
| 35011 | var opt_slice_idx: ?usize = null; | 35011 | var opt_slice_idx: ?usize = null; |
| 35012 | | 35012 | |
| | 35013 | var any_abi_aligned = false; |
| 35013 | var opt_ptr_info: ?InternPool.Key.PtrType = null; | 35014 | var opt_ptr_info: ?InternPool.Key.PtrType = null; |
| 35014 | var first_idx: usize = undefined; | 35015 | var first_idx: usize = undefined; |
| 35015 | var other_idx: usize = undefined; // We sometimes need a second peer index to report a generic error | 35016 | var other_idx: usize = undefined; // We sometimes need a second peer index to report a generic error |
| ... | @@ -35054,17 +35055,14 @@ fn resolvePeerTypesInner( | ... | @@ -35054,17 +35055,14 @@ fn resolvePeerTypesInner( |
| 35054 | } }; | 35055 | } }; |
| 35055 | | 35056 | |
| 35056 | // Note that the align can be always non-zero; Type.ptr will canonicalize it | 35057 | // Note that the align can be always non-zero; Type.ptr will canonicalize it |
| 35057 | ptr_info.flags.alignment = Alignment.min( | 35058 | if (peer_info.flags.alignment == .none) { |
| 35058 | if (ptr_info.flags.alignment != .none) | 35059 | any_abi_aligned = true; |
| 35059 | ptr_info.flags.alignment | 35060 | } else if (ptr_info.flags.alignment == .none) { |
| 35060 | else | 35061 | any_abi_aligned = true; |
| 35061 | try Type.fromInterned(ptr_info.child).abiAlignmentSema(pt), | 35062 | ptr_info.flags.alignment = peer_info.flags.alignment; |
| 35062 | | 35063 | } else { |
| 35063 | if (peer_info.flags.alignment != .none) | 35064 | ptr_info.flags.alignment = ptr_info.flags.alignment.minStrict(peer_info.flags.alignment); |
| 35064 | peer_info.flags.alignment | 35065 | } |
| 35065 | else | | |
| 35066 | try Type.fromInterned(peer_info.child).abiAlignmentSema(pt), | | |
| 35067 | ); | | |
| 35068 | | 35066 | |
| 35069 | if (ptr_info.flags.address_space != peer_info.flags.address_space) { | 35067 | if (ptr_info.flags.address_space != peer_info.flags.address_space) { |
| 35070 | return generic_err; | 35068 | return generic_err; |
| ... | @@ -35312,6 +35310,12 @@ fn resolvePeerTypesInner( | ... | @@ -35312,6 +35310,12 @@ fn resolvePeerTypesInner( |
| 35312 | }, | 35310 | }, |
| 35313 | } | 35311 | } |
| 35314 | | 35312 | |
| | 35313 | if (any_abi_aligned and opt_ptr_info.?.flags.alignment != .none) { |
| | 35314 | opt_ptr_info.?.flags.alignment = opt_ptr_info.?.flags.alignment.minStrict( |
| | 35315 | try Type.fromInterned(pointee).abiAlignmentSema(pt), |
| | 35316 | ); |
| | 35317 | } |
| | 35318 | |
| 35315 | return .{ .success = try pt.ptrTypeSema(opt_ptr_info.?) }; | 35319 | return .{ .success = try pt.ptrTypeSema(opt_ptr_info.?) }; |
| 35316 | }, | 35320 | }, |
| 35317 | | 35321 | |