From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_target/src/abi/call/loongarch.rs | 4 ++-- compiler/rustc_target/src/abi/call/mod.rs | 15 +++++---------- compiler/rustc_target/src/abi/call/riscv.rs | 4 ++-- compiler/rustc_target/src/abi/mod.rs | 5 ++--- 4 files changed, 11 insertions(+), 17 deletions(-) (limited to 'compiler/rustc_target/src/abi') diff --git a/compiler/rustc_target/src/abi/call/loongarch.rs b/compiler/rustc_target/src/abi/call/loongarch.rs index d29b479de..4a2d39cc7 100644 --- a/compiler/rustc_target/src/abi/call/loongarch.rs +++ b/compiler/rustc_target/src/abi/call/loongarch.rs @@ -19,7 +19,7 @@ enum FloatConv { #[derive(Copy, Clone)] struct CannotUseFpConv; -fn is_loongarch_aggregate<'a, Ty>(arg: &ArgAbi<'a, Ty>) -> bool { +fn is_loongarch_aggregate(arg: &ArgAbi<'_, Ty>) -> bool { match arg.layout.abi { Abi::Vector { .. } => true, _ => arg.layout.is_aggregate(), @@ -290,7 +290,7 @@ fn classify_arg<'a, Ty, C>( } } -fn extend_integer_width<'a, Ty>(arg: &mut ArgAbi<'a, Ty>, xlen: u64) { +fn extend_integer_width(arg: &mut ArgAbi<'_, Ty>, xlen: u64) { if let Abi::Scalar(scalar) = arg.layout.abi { if let abi::Int(i, _) = scalar.primitive() { // 32-bit integers are always sign-extended diff --git a/compiler/rustc_target/src/abi/call/mod.rs b/compiler/rustc_target/src/abi/call/mod.rs index a5ffaebea..3b8c867d3 100644 --- a/compiler/rustc_target/src/abi/call/mod.rs +++ b/compiler/rustc_target/src/abi/call/mod.rs @@ -71,12 +71,7 @@ mod attr_impl { const NonNull = 1 << 3; const ReadOnly = 1 << 4; const InReg = 1 << 5; - // Due to past miscompiles in LLVM, we use a separate attribute for - // &mut arguments, so that the codegen backend can decide whether - // or not to actually emit the attribute. It can also be controlled - // with the `-Zmutable-noalias` debugging option. - const NoAliasMutRef = 1 << 6; - const NoUndef = 1 << 7; + const NoUndef = 1 << 6; } } } @@ -177,12 +172,12 @@ impl Reg { 17..=32 => dl.i32_align.abi, 33..=64 => dl.i64_align.abi, 65..=128 => dl.i128_align.abi, - _ => panic!("unsupported integer: {:?}", self), + _ => panic!("unsupported integer: {self:?}"), }, RegKind::Float => match self.size.bits() { 32 => dl.f32_align.abi, 64 => dl.f64_align.abi, - _ => panic!("unsupported float: {:?}", self), + _ => panic!("unsupported float: {self:?}"), }, RegKind::Vector => dl.vector_align(self.size).abi, } @@ -642,7 +637,7 @@ impl fmt::Display for AdjustForForeignAbiError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Self::Unsupported { arch, abi } => { - write!(f, "target architecture {:?} does not support `extern {}` ABI", arch, abi) + write!(f, "target architecture {arch:?} does not support `extern {abi}` ABI") } } } @@ -760,7 +755,7 @@ impl FromStr for Conv { "AmdGpuKernel" => Ok(Conv::AmdGpuKernel), "AvrInterrupt" => Ok(Conv::AvrInterrupt), "AvrNonBlockingInterrupt" => Ok(Conv::AvrNonBlockingInterrupt), - _ => Err(format!("'{}' is not a valid value for entry function call convetion.", s)), + _ => Err(format!("'{s}' is not a valid value for entry function call convetion.")), } } } diff --git a/compiler/rustc_target/src/abi/call/riscv.rs b/compiler/rustc_target/src/abi/call/riscv.rs index 1cb360f83..34280d38e 100644 --- a/compiler/rustc_target/src/abi/call/riscv.rs +++ b/compiler/rustc_target/src/abi/call/riscv.rs @@ -25,7 +25,7 @@ enum FloatConv { #[derive(Copy, Clone)] struct CannotUseFpConv; -fn is_riscv_aggregate<'a, Ty>(arg: &ArgAbi<'a, Ty>) -> bool { +fn is_riscv_aggregate(arg: &ArgAbi<'_, Ty>) -> bool { match arg.layout.abi { Abi::Vector { .. } => true, _ => arg.layout.is_aggregate(), @@ -296,7 +296,7 @@ fn classify_arg<'a, Ty, C>( } } -fn extend_integer_width<'a, Ty>(arg: &mut ArgAbi<'a, Ty>, xlen: u64) { +fn extend_integer_width(arg: &mut ArgAbi<'_, Ty>, xlen: u64) { if let Abi::Scalar(scalar) = arg.layout.abi { if let abi::Int(i, _) = scalar.primitive() { // 32-bit integers are always sign-extended diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs index 53c9878ab..88a0a1f8e 100644 --- a/compiler/rustc_target/src/abi/mod.rs +++ b/compiler/rustc_target/src/abi/mod.rs @@ -20,9 +20,8 @@ impl ToJson for Endian { } rustc_index::newtype_index! { - pub struct VariantIdx { - derive [HashStable_Generic] - } + #[derive(HashStable_Generic)] + pub struct VariantIdx {} } #[derive(Copy, Clone, PartialEq, Eq, Hash, HashStable_Generic)] -- cgit v1.2.3