Skip to content

Commit 390f906

Browse files
committed
revert(lifetime): Add "needless" lifetime(s) and allow it in clippy
This reverts commit ad97b8c.
1 parent 878f572 commit 390f906

File tree

7 files changed

+15
-14
lines changed

7 files changed

+15
-14
lines changed

src/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister {
691691

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

src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
976976
return OperandRef::zero_sized(place.layout);
977977
}
978978

979-
fn scalar_load_metadata<'gcc>(
980-
bx: &mut Builder<'_, 'gcc, '_>,
979+
fn scalar_load_metadata<'a, 'gcc, 'tcx>(
980+
bx: &mut Builder<'a, 'gcc, 'tcx>,
981981
load: RValue<'gcc>,
982982
scalar: &abi::Scalar,
983983
) {

src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
3030
}
3131
}
3232

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

src/intrinsic/llvm.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use rustc_codegen_ssa::traits::BuilderMethods;
55

66
use crate::{builder::Builder, context::CodegenCx};
77

8-
pub fn adjust_intrinsic_arguments<'b, 'gcc>(
9-
builder: &Builder<'_, 'gcc, '_>,
8+
pub fn adjust_intrinsic_arguments<'a, 'b, 'gcc, 'tcx>(
9+
builder: &Builder<'a, 'gcc, 'tcx>,
1010
gcc_func: FunctionPtrType<'gcc>,
1111
mut args: Cow<'b, [RValue<'gcc>]>,
1212
func_name: &str,
@@ -479,8 +479,8 @@ pub fn adjust_intrinsic_arguments<'b, 'gcc>(
479479
args
480480
}
481481

482-
pub fn adjust_intrinsic_return_value<'gcc>(
483-
builder: &Builder<'_, 'gcc, '_>,
482+
pub fn adjust_intrinsic_return_value<'a, 'gcc, 'tcx>(
483+
builder: &Builder<'a, 'gcc, 'tcx>,
484484
mut return_value: RValue<'gcc>,
485485
func_name: &str,
486486
args: &[RValue<'gcc>],
@@ -628,7 +628,7 @@ pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function
628628
}
629629

630630
#[cfg(feature = "master")]
631-
pub fn intrinsic<'gcc>(name: &str, cx: &CodegenCx<'gcc, '_>) -> Function<'gcc> {
631+
pub fn intrinsic<'gcc, 'tcx>(name: &str, cx: &CodegenCx<'gcc, 'tcx>) -> Function<'gcc> {
632632
if name == "llvm.prefetch" {
633633
let gcc_name = "__builtin_prefetch";
634634
let func = cx.context.get_builtin_function(gcc_name);

src/intrinsic/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,8 +1093,8 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
10931093
}
10941094
}
10951095

1096-
fn try_intrinsic<'gcc>(
1097-
bx: &mut Builder<'_, 'gcc, '_>,
1096+
fn try_intrinsic<'a, 'b, 'gcc, 'tcx>(
1097+
bx: &'b mut Builder<'a, 'gcc, 'tcx>,
10981098
try_func: RValue<'gcc>,
10991099
data: RValue<'gcc>,
11001100
_catch_func: RValue<'gcc>,

src/intrinsic/simd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,11 +692,11 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
692692
}
693693

694694
#[cfg(feature = "master")]
695-
fn gather<'gcc>(
695+
fn gather<'a, 'gcc, 'tcx>(
696696
default: RValue<'gcc>,
697697
pointers: RValue<'gcc>,
698698
mask: RValue<'gcc>,
699-
bx: &mut Builder<'_, 'gcc, '_>,
699+
bx: &mut Builder<'a, 'gcc, 'tcx>,
700700
in_len: u64,
701701
invert: bool,
702702
) -> RValue<'gcc> {

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#![warn(rust_2018_idioms)]
3030
#![warn(unused_lifetimes)]
3131
#![deny(clippy::pattern_type_mismatch)]
32+
#![allow(clippy::needless_lifetimes)]
3233

3334
extern crate rustc_apfloat;
3435
extern crate rustc_ast;
@@ -270,7 +271,7 @@ impl CodegenBackend for GccCodegenBackend {
270271
}
271272
}
272273

273-
fn new_context<'gcc>(tcx: TyCtxt<'_>) -> Context<'gcc> {
274+
fn new_context<'gcc, 'tcx>(tcx: TyCtxt<'tcx>) -> Context<'gcc> {
274275
let context = Context::default();
275276
if tcx.sess.target.arch == "x86" || tcx.sess.target.arch == "x86_64" {
276277
context.add_command_line_option("-masm=intel");

0 commit comments

Comments
 (0)