Skip to content

Commit 11a0cce

Browse files
authored
Merge pull request #350 from rust-lang/sync_from_rust_2023_10_08
Sync from rust 2023/10/08
2 parents d484836 + a7532da commit 11a0cce

27 files changed

+77
-69
lines changed

Diff for: example/alloc_system.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
target_arch = "mips",
1313
target_arch = "mips32r6",
1414
target_arch = "powerpc",
15+
target_arch = "csky",
1516
target_arch = "powerpc64"))]
1617
const MIN_ALIGN: usize = 8;
1718
#[cfg(any(target_arch = "x86_64",

Diff for: example/mini_core.rs

+9
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,15 @@ fn panic_cannot_unwind() -> ! {
429429
}
430430
}
431431

432+
#[lang = "panic_in_cleanup"]
433+
#[rustc_nounwind]
434+
fn panic_in_cleanup() -> ! {
435+
unsafe {
436+
libc::printf("panic in a destructor during cleanup\n\0" as *const str as *const i8);
437+
intrinsics::abort();
438+
}
439+
}
440+
432441
#[lang = "panic_bounds_check"]
433442
#[track_caller]
434443
fn panic_bounds_check(index: usize, len: usize) -> ! {

Diff for: failing-ui-tests.txt

+3
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,6 @@ tests/ui/lto/thin-lto-global-allocator.rs
6868
tests/ui/lto/msvc-imp-present.rs
6969
tests/ui/lto/lto-thin-rustc-loads-linker-plugin.rs
7070
tests/ui/lto/all-crates.rs
71+
tests/ui/async-await/deep-futures-are-freeze.rs
72+
tests/ui/closures/capture-unsized-by-ref.rs
73+
tests/ui/generator/resume-after-return.rs

Diff for: rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2023-08-12"
2+
channel = "nightly-2023-10-08"
33
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

Diff for: src/abi.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
115115
match self.ret.mode {
116116
PassMode::Ignore => cx.type_void(),
117117
PassMode::Direct(_) | PassMode::Pair(..) => self.ret.layout.immediate_gcc_type(cx),
118-
PassMode::Cast(ref cast, _) => cast.gcc_type(cx),
118+
PassMode::Cast { ref cast, .. } => cast.gcc_type(cx),
119119
PassMode::Indirect { .. } => {
120120
argument_tys.push(cx.type_ptr_to(self.ret.memory_ty(cx)));
121121
cx.type_void()
@@ -141,30 +141,30 @@ impl<'gcc, 'tcx> FnAbiGccExt<'gcc, 'tcx> for FnAbi<'tcx, Ty<'tcx>> {
141141
let arg_ty = match arg.mode {
142142
PassMode::Ignore => continue,
143143
PassMode::Pair(a, b) => {
144-
argument_tys.push(apply_attrs(arg.layout.scalar_pair_element_gcc_type(cx, 0, true), &a));
145-
argument_tys.push(apply_attrs(arg.layout.scalar_pair_element_gcc_type(cx, 1, true), &b));
144+
argument_tys.push(apply_attrs(arg.layout.scalar_pair_element_gcc_type(cx, 0), &a));
145+
argument_tys.push(apply_attrs(arg.layout.scalar_pair_element_gcc_type(cx, 1), &b));
146146
continue;
147147
}
148-
PassMode::Cast(ref cast, pad_i32) => {
148+
PassMode::Cast { ref cast, pad_i32 } => {
149149
// add padding
150150
if pad_i32 {
151151
argument_tys.push(Reg::i32().gcc_type(cx));
152152
}
153153
let ty = cast.gcc_type(cx);
154154
apply_attrs(ty, &cast.attrs)
155155
}
156-
PassMode::Indirect { attrs: _, extra_attrs: None, on_stack: true } => {
156+
PassMode::Indirect { attrs: _, meta_attrs: None, on_stack: true } => {
157157
// This is a "byval" argument, so we don't apply the `restrict` attribute on it.
158158
on_stack_param_indices.insert(argument_tys.len());
159159
arg.memory_ty(cx)
160160
},
161161
PassMode::Direct(attrs) => apply_attrs(arg.layout.immediate_gcc_type(cx), &attrs),
162-
PassMode::Indirect { attrs, extra_attrs: None, on_stack: false } => {
162+
PassMode::Indirect { attrs, meta_attrs: None, on_stack: false } => {
163163
apply_attrs(cx.type_ptr_to(arg.memory_ty(cx)), &attrs)
164164
}
165-
PassMode::Indirect { attrs, extra_attrs: Some(extra_attrs), on_stack } => {
165+
PassMode::Indirect { attrs, meta_attrs: Some(meta_attrs), on_stack } => {
166166
assert!(!on_stack);
167-
apply_attrs(apply_attrs(cx.type_ptr_to(arg.memory_ty(cx)), &attrs), &extra_attrs)
167+
apply_attrs(apply_attrs(cx.type_ptr_to(arg.memory_ty(cx)), &attrs), &meta_attrs)
168168
}
169169
};
170170
argument_tys.push(arg_ty);

Diff for: src/asm.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ enum ConstraintOrRegister {
107107

108108

109109
impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
110-
fn codegen_inline_asm(&mut self, template: &[InlineAsmTemplatePiece], rust_operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, span: &[Span], _instance: Instance<'_>, _dest_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>) {
110+
fn codegen_inline_asm(&mut self, template: &[InlineAsmTemplatePiece], rust_operands: &[InlineAsmOperandRef<'tcx, Self>], options: InlineAsmOptions, span: &[Span], instance: Instance<'_>, _dest_catch_funclet: Option<(Self::BasicBlock, Self::BasicBlock, Option<&Self::Funclet>)>) {
111111
if options.contains(InlineAsmOptions::MAY_UNWIND) {
112112
self.sess()
113113
.create_err(UnwindingInlineAsm { span: span[0] })
@@ -173,7 +173,7 @@ impl<'a, 'gcc, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
173173
let is_target_supported = reg.reg_class().supported_types(asm_arch).iter()
174174
.any(|&(_, feature)| {
175175
if let Some(feature) = feature {
176-
self.tcx.sess.target_features.contains(&feature)
176+
self.tcx.asm_target_features(instance.def_id()).contains(&feature)
177177
} else {
178178
true // Register class is unconditionally supported
179179
}
@@ -593,6 +593,8 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister {
593593
InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg) => "r",
594594
InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg_addr) => "a",
595595
InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg_data) => "d",
596+
InlineAsmRegClass::CSKY(CSKYInlineAsmRegClass::reg) => "r",
597+
InlineAsmRegClass::CSKY(CSKYInlineAsmRegClass::freg) => "f",
596598
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::reg) => "d", // more specific than "r"
597599
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::freg) => "f",
598600
InlineAsmRegClass::Msp430(Msp430InlineAsmRegClass::reg) => "r",
@@ -669,6 +671,8 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
669671
InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg) => cx.type_i32(),
670672
InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg_addr) => cx.type_i32(),
671673
InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg_data) => cx.type_i32(),
674+
InlineAsmRegClass::CSKY(CSKYInlineAsmRegClass::reg) => cx.type_i32(),
675+
InlineAsmRegClass::CSKY(CSKYInlineAsmRegClass::freg) => cx.type_f32(),
672676
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::reg) => cx.type_i32(),
673677
InlineAsmRegClass::Mips(MipsInlineAsmRegClass::freg) => cx.type_f32(),
674678
InlineAsmRegClass::Msp430(_) => unimplemented!(),
@@ -856,6 +860,7 @@ fn modifier_to_gcc(arch: InlineAsmArch, reg: InlineAsmRegClass, modifier: Option
856860
InlineAsmRegClass::S390x(_) => None,
857861
InlineAsmRegClass::Msp430(_) => None,
858862
InlineAsmRegClass::M68k(_) => None,
863+
InlineAsmRegClass::CSKY(_) => None,
859864
InlineAsmRegClass::SpirV(SpirVInlineAsmRegClass::reg) => {
860865
bug!("LLVM backend does not support SPIR-V")
861866
}

Diff for: src/builder.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -656,15 +656,15 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
656656
}
657657

658658
fn unchecked_sadd(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
659-
a + b
659+
self.gcc_add(a, b)
660660
}
661661

662662
fn unchecked_uadd(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
663663
self.gcc_add(a, b)
664664
}
665665

666666
fn unchecked_ssub(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
667-
a - b
667+
self.gcc_sub(a, b)
668668
}
669669

670670
fn unchecked_usub(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
@@ -673,11 +673,11 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
673673
}
674674

675675
fn unchecked_smul(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
676-
a * b
676+
self.gcc_mul(a, b)
677677
}
678678

679679
fn unchecked_umul(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
680-
a * b
680+
self.gcc_mul(a, b)
681681
}
682682

683683
fn fadd_fast(&mut self, lhs: RValue<'gcc>, rhs: RValue<'gcc>) -> RValue<'gcc> {
@@ -814,7 +814,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
814814

815815
let mut load = |i, scalar: &abi::Scalar, align| {
816816
let llptr = self.struct_gep(pair_type, place.llval, i as u64);
817-
let llty = place.layout.scalar_pair_element_gcc_type(self, i, false);
817+
let llty = place.layout.scalar_pair_element_gcc_type(self, i);
818818
let load = self.load(llty, llptr, align);
819819
scalar_load_metadata(self, load, scalar);
820820
if scalar.is_bool() { self.trunc(load, self.type_i1()) } else { load }
@@ -1421,7 +1421,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
14211421
self.cx
14221422
}
14231423

1424-
fn do_not_inline(&mut self, _llret: RValue<'gcc>) {
1424+
fn apply_attrs_to_cleanup_callsite(&mut self, _llret: RValue<'gcc>) {
14251425
// FIXME(bjorn3): implement
14261426
}
14271427

Diff for: src/callee.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub fn get_fn<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, instance: Instance<'tcx>)
100100
// whether we are sharing generics or not. The important thing here is
101101
// that the visibility we apply to the declaration is the same one that
102102
// has been applied to the definition (wherever that definition may be).
103-
let is_generic = instance.args.non_erasable_generics().next().is_some();
103+
let is_generic = instance.args.non_erasable_generics(tcx, instance.def_id()).next().is_some();
104104

105105
if is_generic {
106106
// This is a monomorphization. Its expected visibility depends

Diff for: src/context.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use rustc_codegen_ssa::traits::{
77
BaseTypeMethods,
88
MiscMethods,
99
};
10+
use rustc_codegen_ssa::errors as ssa_errors;
1011
use rustc_data_structures::base_n;
1112
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
1213
use rustc_middle::span_bug;
@@ -479,7 +480,7 @@ impl<'gcc, 'tcx> LayoutOfHelpers<'tcx> for CodegenCx<'gcc, 'tcx> {
479480
if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
480481
self.sess().emit_fatal(respan(span, err.into_diagnostic()))
481482
} else {
482-
span_bug!(span, "failed to get layout for `{}`: {}", ty, err)
483+
self.tcx.sess.emit_fatal(ssa_errors::FailedToGetLayout { span, ty, err })
483484
}
484485
}
485486
}

Diff for: src/debuginfo.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'gcc, 'tcx> DebugInfoMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
5555
_fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
5656
_llfn: RValue<'gcc>,
5757
_mir: &mir::Body<'tcx>,
58-
) -> Option<FunctionDebugContext<Self::DIScope, Self::DILocation>> {
58+
) -> Option<FunctionDebugContext<'tcx, Self::DIScope, Self::DILocation>> {
5959
// TODO(antoyo)
6060
None
6161
}

Diff for: src/intrinsic/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
144144
sym::volatile_load | sym::unaligned_volatile_load => {
145145
let tp_ty = fn_args.type_at(0);
146146
let mut ptr = args[0].immediate();
147-
if let PassMode::Cast(ty, _) = &fn_abi.ret.mode {
147+
if let PassMode::Cast { cast: ty, .. } = &fn_abi.ret.mode {
148148
ptr = self.pointercast(ptr, self.type_ptr_to(ty.gcc_type(self)));
149149
}
150150
let load = self.volatile_load(ptr.get_type(), ptr);
@@ -353,7 +353,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
353353
};
354354

355355
if !fn_abi.ret.is_ignore() {
356-
if let PassMode::Cast(ty, _) = &fn_abi.ret.mode {
356+
if let PassMode::Cast { cast: ty, .. } = &fn_abi.ret.mode {
357357
let ptr_llty = self.type_ptr_to(ty.gcc_type(self));
358358
let ptr = self.pointercast(result.llval, ptr_llty);
359359
self.store(llval, ptr, result.align);
@@ -449,7 +449,7 @@ impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
449449
else if self.is_unsized_indirect() {
450450
bug!("unsized `ArgAbi` must be handled through `store_fn_arg`");
451451
}
452-
else if let PassMode::Cast(ref cast, _) = self.mode {
452+
else if let PassMode::Cast { ref cast, .. } = self.mode {
453453
// FIXME(eddyb): Figure out when the simpler Store is safe, clang
454454
// uses it for i16 -> {i8, i8}, but not for i24 -> {i8, i8, i8}.
455455
let can_store_through_cast_ptr = false;
@@ -511,10 +511,10 @@ impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
511511
PassMode::Pair(..) => {
512512
OperandValue::Pair(next(), next()).store(bx, dst);
513513
},
514-
PassMode::Indirect { extra_attrs: Some(_), .. } => {
514+
PassMode::Indirect { meta_attrs: Some(_), .. } => {
515515
OperandValue::Ref(next(), Some(next()), self.layout.align.abi).store(bx, dst);
516516
},
517-
PassMode::Direct(_) | PassMode::Indirect { extra_attrs: None, .. } | PassMode::Cast(..) => {
517+
PassMode::Direct(_) | PassMode::Indirect { meta_attrs: None, .. } | PassMode::Cast { .. } => {
518518
let next_arg = next();
519519
self.store(bx, next_arg, dst);
520520
},

Diff for: src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ use rustc_errors::{DiagnosticMessage, ErrorGuaranteed, Handler, SubdiagnosticMes
9898
use rustc_fluent_macro::fluent_messages;
9999
use rustc_metadata::EncodedMetadata;
100100
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
101-
use rustc_middle::query::Providers;
101+
use rustc_middle::util::Providers;
102102
use rustc_middle::ty::TyCtxt;
103103
use rustc_session::config::{Lto, OptLevel, OutputFilenames};
104104
use rustc_session::Session;

Diff for: src/type_of.rs

+17-29
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use gccjit::{Struct, Type};
44
use crate::rustc_codegen_ssa::traits::{BaseTypeMethods, DerivedTypeMethods, LayoutTypeMethods};
55
use rustc_middle::bug;
66
use rustc_middle::ty::{self, Ty, TypeVisitableExt};
7-
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout};
7+
use rustc_middle::ty::layout::{LayoutOf, TyAndLayout};
88
use rustc_middle::ty::print::with_no_trimmed_paths;
99
use rustc_target::abi::{self, Abi, Align, F32, F64, FieldsShape, Int, Integer, Pointer, PointeeInfo, Size, TyAbiInterface, Variants};
1010
use rustc_target::abi::call::{CastTarget, FnAbi, Reg};
@@ -74,8 +74,8 @@ fn uncached_gcc_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, layout: TyAndLayout
7474
Abi::ScalarPair(..) => {
7575
return cx.type_struct(
7676
&[
77-
layout.scalar_pair_element_gcc_type(cx, 0, false),
78-
layout.scalar_pair_element_gcc_type(cx, 1, false),
77+
layout.scalar_pair_element_gcc_type(cx, 0),
78+
layout.scalar_pair_element_gcc_type(cx, 1),
7979
],
8080
false,
8181
);
@@ -150,7 +150,7 @@ pub trait LayoutGccExt<'tcx> {
150150
fn gcc_type<'gcc>(&self, cx: &CodegenCx<'gcc, 'tcx>) -> Type<'gcc>;
151151
fn immediate_gcc_type<'gcc>(&self, cx: &CodegenCx<'gcc, 'tcx>) -> Type<'gcc>;
152152
fn scalar_gcc_type_at<'gcc>(&self, cx: &CodegenCx<'gcc, 'tcx>, scalar: &abi::Scalar, offset: Size) -> Type<'gcc>;
153-
fn scalar_pair_element_gcc_type<'gcc>(&self, cx: &CodegenCx<'gcc, 'tcx>, index: usize, immediate: bool) -> Type<'gcc>;
153+
fn scalar_pair_element_gcc_type<'gcc>(&self, cx: &CodegenCx<'gcc, 'tcx>, index: usize) -> Type<'gcc>;
154154
fn gcc_field_index(&self, index: usize) -> u64;
155155
fn pointee_info_at<'gcc>(&self, cx: &CodegenCx<'gcc, 'tcx>, offset: Size) -> Option<PointeeInfo>;
156156
}
@@ -182,6 +182,10 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
182182
/// of that field's type - this is useful for taking the address of
183183
/// that field and ensuring the struct has the right alignment.
184184
fn gcc_type<'gcc>(&self, cx: &CodegenCx<'gcc, 'tcx>) -> Type<'gcc> {
185+
use crate::rustc_middle::ty::layout::FnAbiOf;
186+
// This must produce the same result for `repr(transparent)` wrappers as for the inner type!
187+
// In other words, this should generally not look at the type at all, but only at the
188+
// layout.
185189
if let Abi::Scalar(ref scalar) = self.abi {
186190
// Use a different cache for scalars because pointers to DSTs
187191
// can be either fat or thin (data pointers of fat pointers).
@@ -190,12 +194,9 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
190194
}
191195
let ty =
192196
match *self.ty.kind() {
193-
ty::Ref(_, ty, _) | ty::RawPtr(ty::TypeAndMut { ty, .. }) => {
194-
cx.type_ptr_to(cx.layout_of(ty).gcc_type(cx))
195-
}
196-
ty::Adt(def, _) if def.is_box() => {
197-
cx.type_ptr_to(cx.layout_of(self.ty.boxed_ty()).gcc_type(cx))
198-
}
197+
// NOTE: we cannot remove this match like in the LLVM codegen because the call
198+
// to fn_ptr_backend_type handle the on-stack attribute.
199+
// TODO(antoyo): find a less hackish way to hande the on-stack attribute.
199200
ty::FnPtr(sig) => cx.fn_ptr_backend_type(&cx.fn_abi_of_fn_ptr(sig, ty::List::empty())),
200201
_ => self.scalar_gcc_type_at(cx, scalar, Size::ZERO),
201202
};
@@ -272,23 +273,10 @@ impl<'tcx> LayoutGccExt<'tcx> for TyAndLayout<'tcx> {
272273
}
273274
}
274275

275-
fn scalar_pair_element_gcc_type<'gcc>(&self, cx: &CodegenCx<'gcc, 'tcx>, index: usize, immediate: bool) -> Type<'gcc> {
276-
// TODO(antoyo): remove llvm hack:
277-
// HACK(eddyb) special-case fat pointers until LLVM removes
278-
// pointee types, to avoid bitcasting every `OperandRef::deref`.
279-
match self.ty.kind() {
280-
ty::Ref(..) | ty::RawPtr(_) => {
281-
return self.field(cx, index).gcc_type(cx);
282-
}
283-
// only wide pointer boxes are handled as pointers
284-
// thin pointer boxes with scalar allocators are handled by the general logic below
285-
ty::Adt(def, args) if def.is_box() && cx.layout_of(args.type_at(1)).is_zst() => {
286-
let ptr_ty = Ty::new_mut_ptr(cx.tcx,self.ty.boxed_ty());
287-
return cx.layout_of(ptr_ty).scalar_pair_element_gcc_type(cx, index, immediate);
288-
}
289-
_ => {}
290-
}
291-
276+
fn scalar_pair_element_gcc_type<'gcc>(&self, cx: &CodegenCx<'gcc, 'tcx>, index: usize) -> Type<'gcc> {
277+
// This must produce the same result for `repr(transparent)` wrappers as for the inner type!
278+
// In other words, this should generally not look at the type at all, but only at the
279+
// layout.
292280
let (a, b) = match self.abi {
293281
Abi::ScalarPair(ref a, ref b) => (a, b),
294282
_ => bug!("TyAndLayout::scalar_pair_element_llty({:?}): not applicable", self),
@@ -367,8 +355,8 @@ impl<'gcc, 'tcx> LayoutTypeMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
367355
layout.gcc_field_index(index)
368356
}
369357

370-
fn scalar_pair_element_backend_type(&self, layout: TyAndLayout<'tcx>, index: usize, immediate: bool) -> Type<'gcc> {
371-
layout.scalar_pair_element_gcc_type(self, index, immediate)
358+
fn scalar_pair_element_backend_type(&self, layout: TyAndLayout<'tcx>, index: usize, _immediate: bool) -> Type<'gcc> {
359+
layout.scalar_pair_element_gcc_type(self, index)
372360
}
373361

374362
fn cast_backend_type(&self, ty: &CastTarget) -> Type<'gcc> {

0 commit comments

Comments
 (0)