fix(liftime): Gen. by cargo clippy

cmd: `cargo clippy --fix --lib -p rustc_codegen_gcc --allow-dirtyxs`
This commit is contained in:
tempdragon 2024-03-11 12:20:36 +08:00
parent 8d4d87859b
commit ad97b8c061
9 changed files with 24 additions and 24 deletions

View File

@ -691,7 +691,7 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister {
/// Type to use for outputs that are discarded. It doesn't really matter what
/// the type is, as long as it is valid for the constraint code.
fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegClass) -> Type<'gcc> {
fn dummy_output_type<'gcc>(cx: &CodegenCx<'gcc, '_>, reg: InlineAsmRegClass) -> Type<'gcc> {
match reg {
InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::reg) => cx.type_i32(),
InlineAsmRegClass::AArch64(AArch64InlineAsmRegClass::preg) => unimplemented!(),

View File

@ -15,8 +15,8 @@ use crate::{context::CodegenCx, errors::TiedTargetFeatures};
/// Get GCC attribute for the provided inline heuristic.
#[cfg(feature = "master")]
#[inline]
fn inline_attr<'gcc, 'tcx>(
cx: &CodegenCx<'gcc, 'tcx>,
fn inline_attr<'gcc>(
cx: &CodegenCx<'gcc, '_>,
inline: InlineAttr,
) -> Option<FnAttribute<'gcc>> {
match inline {

View File

@ -506,8 +506,8 @@ impl<'gcc, 'tcx> BackendTypes for Builder<'_, 'gcc, 'tcx> {
type DIVariable = <CodegenCx<'gcc, 'tcx> as BackendTypes>::DIVariable;
}
fn set_rvalue_location<'a, 'gcc, 'tcx>(
bx: &mut Builder<'a, 'gcc, 'tcx>,
fn set_rvalue_location<'gcc>(
bx: &mut Builder<'_, 'gcc, '_>,
rvalue: RValue<'gcc>,
) -> RValue<'gcc> {
if bx.location.is_some() {
@ -979,8 +979,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
return OperandRef::zero_sized(place.layout);
}
fn scalar_load_metadata<'a, 'gcc, 'tcx>(
bx: &mut Builder<'a, 'gcc, 'tcx>,
fn scalar_load_metadata<'gcc>(
bx: &mut Builder<'_, 'gcc, '_>,
load: RValue<'gcc>,
scalar: &abi::Scalar,
) {

View File

@ -30,7 +30,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
}
}
pub fn bytes_in_context<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, bytes: &[u8]) -> RValue<'gcc> {
pub fn bytes_in_context<'gcc>(cx: &CodegenCx<'gcc, '_>, bytes: &[u8]) -> RValue<'gcc> {
let context = &cx.context;
let byte_type = context.new_type::<u8>();
let typ = context.new_array_type(None, byte_type, bytes.len() as u64);

View File

@ -18,8 +18,8 @@ use crate::context::CodegenCx;
use crate::errors::InvalidMinimumAlignment;
use crate::type_of::LayoutGccExt;
fn set_global_alignment<'gcc, 'tcx>(
cx: &CodegenCx<'gcc, 'tcx>,
fn set_global_alignment<'gcc>(
cx: &CodegenCx<'gcc, '_>,
gv: LValue<'gcc>,
mut align: Align,
) {

View File

@ -5,8 +5,8 @@ use rustc_codegen_ssa::traits::BuilderMethods;
use crate::{builder::Builder, context::CodegenCx};
pub fn adjust_intrinsic_arguments<'a, 'b, 'gcc, 'tcx>(
builder: &Builder<'a, 'gcc, 'tcx>,
pub fn adjust_intrinsic_arguments<'b, 'gcc>(
builder: &Builder<'_, 'gcc, '_>,
gcc_func: FunctionPtrType<'gcc>,
mut args: Cow<'b, [RValue<'gcc>]>,
func_name: &str,
@ -479,8 +479,8 @@ pub fn adjust_intrinsic_arguments<'a, 'b, 'gcc, 'tcx>(
args
}
pub fn adjust_intrinsic_return_value<'a, 'gcc, 'tcx>(
builder: &Builder<'a, 'gcc, 'tcx>,
pub fn adjust_intrinsic_return_value<'gcc>(
builder: &Builder<'_, 'gcc, '_>,
mut return_value: RValue<'gcc>,
func_name: &str,
args: &[RValue<'gcc>],
@ -628,7 +628,7 @@ pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function
}
#[cfg(feature = "master")]
pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function<'gcc> {
pub fn intrinsic<'gcc>(name: &str, cx: &CodegenCx<'gcc, '_>) -> Function<'gcc> {
if name == "llvm.prefetch" {
let gcc_name = "__builtin_prefetch";
let func = cx.context.get_builtin_function(gcc_name);

View File

@ -39,8 +39,8 @@ use crate::context::CodegenCx;
use crate::intrinsic::simd::generic_simd_intrinsic;
use crate::type_of::LayoutGccExt;
fn get_simple_intrinsic<'gcc, 'tcx>(
cx: &CodegenCx<'gcc, 'tcx>,
fn get_simple_intrinsic<'gcc>(
cx: &CodegenCx<'gcc, '_>,
name: Symbol,
) -> Option<Function<'gcc>> {
let gcc_name = match name {
@ -586,9 +586,9 @@ impl<'gcc, 'tcx> ArgAbiExt<'gcc, 'tcx> for ArgAbi<'tcx, Ty<'tcx>> {
}
}
fn int_type_width_signed<'gcc, 'tcx>(
fn int_type_width_signed<'tcx>(
ty: Ty<'tcx>,
cx: &CodegenCx<'gcc, 'tcx>,
cx: &CodegenCx<'_, 'tcx>,
) -> Option<(u64, bool)> {
match *ty.kind() {
ty::Int(t) => Some((
@ -1099,8 +1099,8 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
}
}
fn try_intrinsic<'a, 'b, 'gcc, 'tcx>(
bx: &'b mut Builder<'a, 'gcc, 'tcx>,
fn try_intrinsic<'gcc>(
bx: &mut Builder<'_, 'gcc, '_>,
try_func: RValue<'gcc>,
data: RValue<'gcc>,
_catch_func: RValue<'gcc>,

View File

@ -694,11 +694,11 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
}
#[cfg(feature = "master")]
fn gather<'a, 'gcc, 'tcx>(
fn gather<'gcc>(
default: RValue<'gcc>,
pointers: RValue<'gcc>,
mask: RValue<'gcc>,
bx: &mut Builder<'a, 'gcc, 'tcx>,
bx: &mut Builder<'_, 'gcc, '_>,
in_len: u64,
invert: bool,
) -> RValue<'gcc> {

View File

@ -270,7 +270,7 @@ impl CodegenBackend for GccCodegenBackend {
}
}
fn new_context<'gcc, 'tcx>(tcx: TyCtxt<'tcx>) -> Context<'gcc> {
fn new_context<'gcc>(tcx: TyCtxt<'_>) -> Context<'gcc> {
let context = Context::default();
if tcx.sess.target.arch == "x86" || tcx.sess.target.arch == "x86_64" {
context.add_command_line_option("-masm=intel");