Skip to content

Commit 87b6b86

Browse files
committed
rustc_codegen_llvm: deny(unused_lifetimes).
1 parent fff08cb commit 87b6b86

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

src/librustc_codegen_llvm/base.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use rustc::hir::CodegenFnAttrs;
4141

4242
use crate::value::Value;
4343

44-
pub fn write_compressed_metadata<'a, 'gcx>(
44+
pub fn write_compressed_metadata<'gcx>(
4545
tcx: TyCtxt<'gcx, 'gcx>,
4646
metadata: &EncodedMetadata,
4747
llvm_module: &mut ModuleLlvm,
@@ -123,7 +123,7 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'tcx, 'tcx>, cgu_name: InternedString) {
123123

124124
submit_codegened_module_to_llvm(&LlvmCodegenBackend(()), tcx, module, cost);
125125

126-
fn module_codegen<'ll, 'tcx>(
126+
fn module_codegen<'tcx>(
127127
tcx: TyCtxt<'tcx, 'tcx>,
128128
cgu_name: InternedString,
129129
) -> ModuleCodegen<ModuleLlvm> {

src/librustc_codegen_llvm/builder.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1228,9 +1228,7 @@ impl Builder<'a, 'll, 'tcx> {
12281228
ret.expect("LLVM does not have support for catchret")
12291229
}
12301230

1231-
fn check_store<'b>(&mut self,
1232-
val: &'ll Value,
1233-
ptr: &'ll Value) -> &'ll Value {
1231+
fn check_store(&mut self, val: &'ll Value, ptr: &'ll Value) -> &'ll Value {
12341232
let dest_ptr_ty = self.cx.val_ty(ptr);
12351233
let stored_ty = self.cx.val_ty(val);
12361234
let stored_ptr_ty = self.cx.type_ptr_to(stored_ty);

src/librustc_codegen_llvm/debuginfo/metadata.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ impl TypeMap<'ll, 'tcx> {
222222
// Get the unique type id string for an enum variant part.
223223
// Variant parts are not types and shouldn't really have their own id,
224224
// but it makes set_members_of_composite_type() simpler.
225-
fn get_unique_type_id_str_of_enum_variant_part<'a>(&mut self,
226-
enum_type_id: UniqueTypeId) -> &str {
225+
fn get_unique_type_id_str_of_enum_variant_part(&mut self, enum_type_id: UniqueTypeId) -> &str {
227226
let variant_part_type_id = format!("{}_variant_part",
228227
self.get_unique_type_id_as_string(enum_type_id));
229228
let interner_key = self.unique_id_interner.intern(&variant_part_type_id);

src/librustc_codegen_llvm/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#![feature(static_nobundle)]
2323
#![feature(trusted_len)]
2424
#![deny(rust_2018_idioms)]
25+
#![deny(unused_lifetimes)]
2526
#![allow(explicit_outlives_requirements)]
2627

2728
use back::write::{create_target_machine, create_informational_target_machine};
@@ -107,15 +108,15 @@ impl ExtraBackendMethods for LlvmCodegenBackend {
107108
ModuleLlvm::new_metadata(tcx, mod_name)
108109
}
109110

110-
fn write_compressed_metadata<'b, 'gcx>(
111+
fn write_compressed_metadata<'gcx>(
111112
&self,
112113
tcx: TyCtxt<'gcx, 'gcx>,
113114
metadata: &EncodedMetadata,
114115
llvm_module: &mut ModuleLlvm,
115116
) {
116117
base::write_compressed_metadata(tcx, metadata, llvm_module)
117118
}
118-
fn codegen_allocator<'b, 'gcx>(
119+
fn codegen_allocator<'gcx>(
119120
&self,
120121
tcx: TyCtxt<'gcx, 'gcx>,
121122
mods: &mut ModuleLlvm,
@@ -284,7 +285,7 @@ impl CodegenBackend for LlvmCodegenBackend {
284285
attributes::provide_extern(providers);
285286
}
286287

287-
fn codegen_crate<'b, 'tcx>(
288+
fn codegen_crate<'tcx>(
288289
&self,
289290
tcx: TyCtxt<'tcx, 'tcx>,
290291
metadata: EncodedMetadata,

src/librustc_codegen_llvm/type_.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl LayoutTypeMethods<'tcx> for CodegenCx<'ll, 'tcx> {
327327
fn backend_field_index(&self, layout: TyLayout<'tcx>, index: usize) -> u64 {
328328
layout.llvm_field_index(index)
329329
}
330-
fn scalar_pair_element_backend_type<'a>(
330+
fn scalar_pair_element_backend_type(
331331
&self,
332332
layout: TyLayout<'tcx>,
333333
index: usize,

src/librustc_codegen_llvm/type_of.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl<'a, 'tcx> CodegenCx<'a, 'tcx> {
175175

176176
pub trait LayoutLlvmExt<'tcx> {
177177
fn is_llvm_immediate(&self) -> bool;
178-
fn is_llvm_scalar_pair<'a>(&self) -> bool;
178+
fn is_llvm_scalar_pair(&self) -> bool;
179179
fn llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>) -> &'a Type;
180180
fn immediate_llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>) -> &'a Type;
181181
fn scalar_llvm_type_at<'a>(&self, cx: &CodegenCx<'a, 'tcx>,
@@ -198,7 +198,7 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyLayout<'tcx> {
198198
}
199199
}
200200

201-
fn is_llvm_scalar_pair<'a>(&self) -> bool {
201+
fn is_llvm_scalar_pair(&self) -> bool {
202202
match self.abi {
203203
layout::Abi::ScalarPair(..) => true,
204204
layout::Abi::Uninhabited |

0 commit comments

Comments
 (0)