Skip to content

Commit d4379d2

Browse files
committed
Remove an unnecessary lifetime
1 parent a54bfcf commit d4379d2

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

compiler/rustc_codegen_gcc/src/common.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn type_is_pointer(typ: Type<'_>) -> bool {
5959
typ.get_pointee().is_some()
6060
}
6161

62-
impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
62+
impl<'gcc, 'tcx> ConstCodegenMethods for CodegenCx<'gcc, 'tcx> {
6363
fn const_null(&self, typ: Type<'gcc>) -> RValue<'gcc> {
6464
if type_is_pointer(typ) { self.context.new_null(typ) } else { self.const_int(typ, 0) }
6565
}
@@ -263,7 +263,7 @@ impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
263263
}
264264
}
265265

266-
fn const_data_from_alloc(&self, alloc: ConstAllocation<'tcx>) -> Self::Value {
266+
fn const_data_from_alloc(&self, alloc: ConstAllocation<'_>) -> Self::Value {
267267
const_alloc_to_gcc(self, alloc)
268268
}
269269

compiler/rustc_codegen_gcc/src/consts.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
302302
}
303303
}
304304

305-
pub fn const_alloc_to_gcc<'gcc, 'tcx>(
306-
cx: &CodegenCx<'gcc, 'tcx>,
307-
alloc: ConstAllocation<'tcx>,
305+
pub fn const_alloc_to_gcc<'gcc>(
306+
cx: &CodegenCx<'gcc, '_>,
307+
alloc: ConstAllocation<'_>,
308308
) -> RValue<'gcc> {
309309
let alloc = alloc.inner();
310310
let mut llvals = Vec::with_capacity(alloc.provenance().ptrs().len() + 1);

compiler/rustc_codegen_llvm/src/common.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<'ll> CodegenCx<'ll, '_> {
118118
}
119119
}
120120

121-
impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
121+
impl<'ll, 'tcx> ConstCodegenMethods for CodegenCx<'ll, 'tcx> {
122122
fn const_null(&self, t: &'ll Type) -> &'ll Value {
123123
unsafe { llvm::LLVMConstNull(t) }
124124
}
@@ -350,7 +350,7 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
350350
}
351351
}
352352

353-
fn const_data_from_alloc(&self, alloc: ConstAllocation<'tcx>) -> Self::Value {
353+
fn const_data_from_alloc(&self, alloc: ConstAllocation<'_>) -> Self::Value {
354354
const_alloc_to_llvm(self, alloc, /*static*/ false)
355355
}
356356

compiler/rustc_codegen_ssa/src/mir/place.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
133133
Self::alloca(bx, ptr_layout)
134134
}
135135

136-
pub fn len<Cx: ConstCodegenMethods<'tcx, Value = V>>(&self, cx: &Cx) -> V {
136+
pub fn len<Cx: ConstCodegenMethods<Value = V>>(&self, cx: &Cx) -> V {
137137
if let FieldsShape::Array { count, .. } = self.layout.fields {
138138
if self.layout.is_unsized() {
139139
assert_eq!(count, 0);

compiler/rustc_codegen_ssa/src/traits/consts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use rustc_middle::mir::interpret::{ConstAllocation, Scalar};
33

44
use super::BackendTypes;
55

6-
pub trait ConstCodegenMethods<'tcx>: BackendTypes {
6+
pub trait ConstCodegenMethods: BackendTypes {
77
// Constant constructors
88
fn const_null(&self, t: Self::Type) -> Self::Value;
99
/// Generate an uninitialized value (matching uninitialized memory in MIR).
@@ -38,7 +38,7 @@ pub trait ConstCodegenMethods<'tcx>: BackendTypes {
3838
fn const_to_opt_uint(&self, v: Self::Value) -> Option<u64>;
3939
fn const_to_opt_u128(&self, v: Self::Value, sign_ext: bool) -> Option<u128>;
4040

41-
fn const_data_from_alloc(&self, alloc: ConstAllocation<'tcx>) -> Self::Value;
41+
fn const_data_from_alloc(&self, alloc: ConstAllocation<'_>) -> Self::Value;
4242

4343
fn scalar_to_backend(&self, cv: Scalar, layout: abi::Scalar, llty: Self::Type) -> Self::Value;
4444

compiler/rustc_codegen_ssa/src/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub trait CodegenObject = Copy + PartialEq + fmt::Debug;
5555
pub trait CodegenMethods<'tcx> = LayoutOf<'tcx, LayoutOfResult = TyAndLayout<'tcx>>
5656
+ FnAbiOf<'tcx, FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>>
5757
+ TypeCodegenMethods<'tcx>
58-
+ ConstCodegenMethods<'tcx>
58+
+ ConstCodegenMethods
5959
+ StaticCodegenMethods
6060
+ DebugInfoCodegenMethods<'tcx>
6161
+ AsmCodegenMethods<'tcx>

0 commit comments

Comments
 (0)