From 0a493514d7596649cc9ca9e70f00fc9b53ba434e Mon Sep 17 00:00:00 2001 From: tempdragon <645703113@qq.com> Date: Sat, 16 Mar 2024 21:26:16 +0800 Subject: [PATCH] fix(lifetime): Add lifetimes back. --- src/attributes.rs | 5 ++++- src/builder.rs | 5 ++++- src/consts.rs | 6 +++++- src/intrinsic/mod.rs | 10 ++++++++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/attributes.rs b/src/attributes.rs index 6238daaed1d..2ce0c83008f 100644 --- a/src/attributes.rs +++ b/src/attributes.rs @@ -15,7 +15,10 @@ /// Get GCC attribute for the provided inline heuristic. #[cfg(feature = "master")] #[inline] -fn inline_attr<'gcc>(cx: &CodegenCx<'gcc, '_>, inline: InlineAttr) -> Option> { +fn inline_attr<'gcc, 'tcx>( + cx: &CodegenCx<'gcc, 'tcx>, + inline: InlineAttr, +) -> Option> { match inline { InlineAttr::Hint => Some(FnAttribute::Inline), InlineAttr::Always => Some(FnAttribute::AlwaysInline), diff --git a/src/builder.rs b/src/builder.rs index 55ab20a03ae..385ca7a44a7 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -506,7 +506,10 @@ impl<'gcc, 'tcx> BackendTypes for Builder<'_, 'gcc, 'tcx> { type DIVariable = as BackendTypes>::DIVariable; } -fn set_rvalue_location<'gcc>(bx: &mut Builder<'_, 'gcc, '_>, rvalue: RValue<'gcc>) -> RValue<'gcc> { +fn set_rvalue_location<'a, 'gcc, 'tcx>( + bx: &mut Builder<'a, 'gcc, 'tcx>, + rvalue: RValue<'gcc>, +) -> RValue<'gcc> { if bx.location.is_some() { #[cfg(feature = "master")] rvalue.set_location(bx.location.unwrap()); diff --git a/src/consts.rs b/src/consts.rs index bbc1de1dfae..f47fd565533 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -18,7 +18,11 @@ use crate::errors::InvalidMinimumAlignment; use crate::type_of::LayoutGccExt; -fn set_global_alignment<'gcc>(cx: &CodegenCx<'gcc, '_>, gv: LValue<'gcc>, mut align: Align) { +fn set_global_alignment<'gcc, 'tcx>( + cx: &CodegenCx<'gcc, 'tcx>, + gv: LValue<'gcc>, + mut align: Align, +) { // The target may require greater alignment for globals than the type does. // Note: GCC and Clang also allow `__attribute__((aligned))` on variables, // which can force it to be smaller. Rust doesn't support this yet. diff --git a/src/intrinsic/mod.rs b/src/intrinsic/mod.rs index b1d8ced6619..eca4a72c756 100644 --- a/src/intrinsic/mod.rs +++ b/src/intrinsic/mod.rs @@ -39,7 +39,10 @@ use crate::intrinsic::simd::generic_simd_intrinsic; use crate::type_of::LayoutGccExt; -fn get_simple_intrinsic<'gcc>(cx: &CodegenCx<'gcc, '_>, name: Symbol) -> Option> { +fn get_simple_intrinsic<'gcc, 'tcx>( + cx: &CodegenCx<'gcc, 'tcx>, + name: Symbol, +) -> Option> { let gcc_name = match name { sym::sqrtf32 => "sqrtf", sym::sqrtf64 => "sqrt", @@ -584,7 +587,10 @@ fn store_fn_arg<'a>( } } -fn int_type_width_signed<'tcx>(ty: Ty<'tcx>, cx: &CodegenCx<'_, 'tcx>) -> Option<(u64, bool)> { +fn int_type_width_signed<'gcc, 'tcx>( + ty: Ty<'tcx>, + cx: &CodegenCx<'gcc, 'tcx>, +) -> Option<(u64, bool)> { match *ty.kind() { ty::Int(t) => Some(( match t {