Skip to content

Commit 9159b61

Browse files
remove explicit deref of AbiAlign for most methods
Much of the compiler calls functions on Align projected from AbiAlign. AbiAlign impls Deref to its inner Align, so we can simplify these away. Also, it will minimize disruption when AbiAlign is removed. For now, preserve usages that might resolve to PartialOrd or PartialEq, as those have odd inference.
1 parent 62c1eea commit 9159b61

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
147147
let layout = tcx
148148
.layout_of(ty::TypingEnv::fully_monomorphized().as_query_input(rust_type))
149149
.unwrap();
150-
let align = layout.align.abi.bytes();
150+
let align = layout.align.bytes();
151151
// For types with size 1, the alignment can be 1 and only 1
152152
// So, we can skip the call to ``get_aligned`.
153153
// In the future, we can add a GCC API to query the type align,
@@ -186,9 +186,9 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
186186
(i128_type, u128_type)
187187
} else {
188188
/*let layout = tcx.layout_of(ParamEnv::reveal_all().and(tcx.types.i128)).unwrap();
189-
let i128_align = layout.align.abi.bytes();
189+
let i128_align = layout.align.bytes();
190190
let layout = tcx.layout_of(ParamEnv::reveal_all().and(tcx.types.u128)).unwrap();
191-
let u128_align = layout.align.abi.bytes();*/
191+
let u128_align = layout.align.bytes();*/
192192

193193
// TODO(antoyo): re-enable the alignment when libgccjit fixed the issue in
194194
// gcc_jit_context_new_array_constructor (it should not use reinterpret_cast).

0 commit comments

Comments
 (0)