Skip to content

Commit

Permalink
rustc_codegen_llvm: deny(unused_lifetimes).
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Jun 12, 2019
1 parent fff08cb commit 87b6b86
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/librustc_codegen_llvm/base.rs
Expand Up @@ -41,7 +41,7 @@ use rustc::hir::CodegenFnAttrs;

use crate::value::Value;

pub fn write_compressed_metadata<'a, 'gcx>(
pub fn write_compressed_metadata<'gcx>(
tcx: TyCtxt<'gcx, 'gcx>,
metadata: &EncodedMetadata,
llvm_module: &mut ModuleLlvm,
Expand Down Expand Up @@ -123,7 +123,7 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'tcx, 'tcx>, cgu_name: InternedString) {

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

fn module_codegen<'ll, 'tcx>(
fn module_codegen<'tcx>(
tcx: TyCtxt<'tcx, 'tcx>,
cgu_name: InternedString,
) -> ModuleCodegen<ModuleLlvm> {
Expand Down
4 changes: 1 addition & 3 deletions src/librustc_codegen_llvm/builder.rs
Expand Up @@ -1228,9 +1228,7 @@ impl Builder<'a, 'll, 'tcx> {
ret.expect("LLVM does not have support for catchret")
}

fn check_store<'b>(&mut self,
val: &'ll Value,
ptr: &'ll Value) -> &'ll Value {
fn check_store(&mut self, val: &'ll Value, ptr: &'ll Value) -> &'ll Value {
let dest_ptr_ty = self.cx.val_ty(ptr);
let stored_ty = self.cx.val_ty(val);
let stored_ptr_ty = self.cx.type_ptr_to(stored_ty);
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_codegen_llvm/debuginfo/metadata.rs
Expand Up @@ -222,8 +222,7 @@ impl TypeMap<'ll, 'tcx> {
// Get the unique type id string for an enum variant part.
// Variant parts are not types and shouldn't really have their own id,
// but it makes set_members_of_composite_type() simpler.
fn get_unique_type_id_str_of_enum_variant_part<'a>(&mut self,
enum_type_id: UniqueTypeId) -> &str {
fn get_unique_type_id_str_of_enum_variant_part(&mut self, enum_type_id: UniqueTypeId) -> &str {
let variant_part_type_id = format!("{}_variant_part",
self.get_unique_type_id_as_string(enum_type_id));
let interner_key = self.unique_id_interner.intern(&variant_part_type_id);
Expand Down
7 changes: 4 additions & 3 deletions src/librustc_codegen_llvm/lib.rs
Expand Up @@ -22,6 +22,7 @@
#![feature(static_nobundle)]
#![feature(trusted_len)]
#![deny(rust_2018_idioms)]
#![deny(unused_lifetimes)]
#![allow(explicit_outlives_requirements)]

use back::write::{create_target_machine, create_informational_target_machine};
Expand Down Expand Up @@ -107,15 +108,15 @@ impl ExtraBackendMethods for LlvmCodegenBackend {
ModuleLlvm::new_metadata(tcx, mod_name)
}

fn write_compressed_metadata<'b, 'gcx>(
fn write_compressed_metadata<'gcx>(
&self,
tcx: TyCtxt<'gcx, 'gcx>,
metadata: &EncodedMetadata,
llvm_module: &mut ModuleLlvm,
) {
base::write_compressed_metadata(tcx, metadata, llvm_module)
}
fn codegen_allocator<'b, 'gcx>(
fn codegen_allocator<'gcx>(
&self,
tcx: TyCtxt<'gcx, 'gcx>,
mods: &mut ModuleLlvm,
Expand Down Expand Up @@ -284,7 +285,7 @@ impl CodegenBackend for LlvmCodegenBackend {
attributes::provide_extern(providers);
}

fn codegen_crate<'b, 'tcx>(
fn codegen_crate<'tcx>(
&self,
tcx: TyCtxt<'tcx, 'tcx>,
metadata: EncodedMetadata,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_codegen_llvm/type_.rs
Expand Up @@ -327,7 +327,7 @@ impl LayoutTypeMethods<'tcx> for CodegenCx<'ll, 'tcx> {
fn backend_field_index(&self, layout: TyLayout<'tcx>, index: usize) -> u64 {
layout.llvm_field_index(index)
}
fn scalar_pair_element_backend_type<'a>(
fn scalar_pair_element_backend_type(
&self,
layout: TyLayout<'tcx>,
index: usize,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_codegen_llvm/type_of.rs
Expand Up @@ -175,7 +175,7 @@ impl<'a, 'tcx> CodegenCx<'a, 'tcx> {

pub trait LayoutLlvmExt<'tcx> {
fn is_llvm_immediate(&self) -> bool;
fn is_llvm_scalar_pair<'a>(&self) -> bool;
fn is_llvm_scalar_pair(&self) -> bool;
fn llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>) -> &'a Type;
fn immediate_llvm_type<'a>(&self, cx: &CodegenCx<'a, 'tcx>) -> &'a Type;
fn scalar_llvm_type_at<'a>(&self, cx: &CodegenCx<'a, 'tcx>,
Expand All @@ -198,7 +198,7 @@ impl<'tcx> LayoutLlvmExt<'tcx> for TyLayout<'tcx> {
}
}

fn is_llvm_scalar_pair<'a>(&self) -> bool {
fn is_llvm_scalar_pair(&self) -> bool {
match self.abi {
layout::Abi::ScalarPair(..) => true,
layout::Abi::Uninhabited |
Expand Down

0 comments on commit 87b6b86

Please sign in to comment.