Skip to content

Commit 1d34f2c

Browse files
committed
librustc_codegen_ssa: deny(elided_lifetimes_in_paths)
1 parent c1911ba commit 1d34f2c

File tree

11 files changed

+34
-30
lines changed

11 files changed

+34
-30
lines changed

src/librustc_codegen_ssa/back/command.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl Command {
159159
}
160160

161161
impl fmt::Debug for Command {
162-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
162+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
163163
self.command().fmt(f)
164164
}
165165
}

src/librustc_codegen_ssa/back/linker.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub struct LinkerInfo {
2525
}
2626

2727
impl LinkerInfo {
28-
pub fn new(tcx: TyCtxt) -> LinkerInfo {
28+
pub fn new(tcx: TyCtxt<'_, '_, '_>) -> LinkerInfo {
2929
LinkerInfo {
3030
exports: tcx.sess.crate_types.borrow().iter().map(|&c| {
3131
(c, exported_symbols(tcx, c))
@@ -1052,7 +1052,7 @@ impl<'a> Linker for WasmLd<'a> {
10521052
}
10531053
}
10541054

1055-
fn exported_symbols(tcx: TyCtxt, crate_type: CrateType) -> Vec<String> {
1055+
fn exported_symbols(tcx: TyCtxt<'_, '_, '_>, crate_type: CrateType) -> Vec<String> {
10561056
if let Some(ref exports) = tcx.sess.target.target.options.override_export_symbols {
10571057
return exports.clone()
10581058
}

src/librustc_codegen_ssa/back/symbol_export.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub type ExportedSymbols = FxHashMap<
2222
Arc<Vec<(String, SymbolExportLevel)>>,
2323
>;
2424

25-
pub fn threshold(tcx: TyCtxt) -> SymbolExportLevel {
25+
pub fn threshold(tcx: TyCtxt<'_, '_, '_>) -> SymbolExportLevel {
2626
crates_export_threshold(&tcx.sess.crate_types.borrow())
2727
}
2828

@@ -342,7 +342,7 @@ fn upstream_monomorphizations_for_provider<'a, 'tcx>(
342342
.cloned()
343343
}
344344

345-
fn is_unreachable_local_definition_provider(tcx: TyCtxt, def_id: DefId) -> bool {
345+
fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> bool {
346346
if let Some(node_id) = tcx.hir().as_local_node_id(def_id) {
347347
!tcx.reachable_set(LOCAL_CRATE).0.contains(&node_id)
348348
} else {
@@ -351,20 +351,20 @@ fn is_unreachable_local_definition_provider(tcx: TyCtxt, def_id: DefId) -> bool
351351
}
352352
}
353353

354-
pub fn provide(providers: &mut Providers) {
354+
pub fn provide(providers: &mut Providers<'_>) {
355355
providers.reachable_non_generics = reachable_non_generics_provider;
356356
providers.is_reachable_non_generic = is_reachable_non_generic_provider_local;
357357
providers.exported_symbols = exported_symbols_provider_local;
358358
providers.upstream_monomorphizations = upstream_monomorphizations_provider;
359359
providers.is_unreachable_local_definition = is_unreachable_local_definition_provider;
360360
}
361361

362-
pub fn provide_extern(providers: &mut Providers) {
362+
pub fn provide_extern(providers: &mut Providers<'_>) {
363363
providers.is_reachable_non_generic = is_reachable_non_generic_provider_extern;
364364
providers.upstream_monomorphizations_for = upstream_monomorphizations_for_provider;
365365
}
366366

367-
fn symbol_export_level(tcx: TyCtxt, sym_def_id: DefId) -> SymbolExportLevel {
367+
fn symbol_export_level(tcx: TyCtxt<'_, '_, '_>, sym_def_id: DefId) -> SymbolExportLevel {
368368
// We export anything that's not mangled at the "C" layer as it probably has
369369
// to do with ABI concerns. We do not, however, apply such treatment to
370370
// special symbols in the standard library for various plumbing between

src/librustc_codegen_ssa/back/write.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ fn need_pre_lto_bitcode_for_incr_comp(sess: &Session) -> bool {
321321

322322
pub fn start_async_codegen<B: ExtraBackendMethods>(
323323
backend: B,
324-
tcx: TyCtxt,
324+
tcx: TyCtxt<'_, '_, '_>,
325325
time_graph: Option<TimeGraph>,
326326
metadata: EncodedMetadata,
327327
coordinator_receive: Receiver<Box<dyn Any + Send>>,
@@ -947,7 +947,7 @@ enum MainThreadWorkerState {
947947

948948
fn start_executing_work<B: ExtraBackendMethods>(
949949
backend: B,
950-
tcx: TyCtxt,
950+
tcx: TyCtxt<'_, '_, '_>,
951951
crate_info: &CrateInfo,
952952
shared_emitter: SharedEmitter,
953953
codegen_worker_send: Sender<Message<B>>,
@@ -1683,7 +1683,7 @@ impl SharedEmitter {
16831683
}
16841684

16851685
impl Emitter for SharedEmitter {
1686-
fn emit(&mut self, db: &DiagnosticBuilder) {
1686+
fn emit(&mut self, db: &DiagnosticBuilder<'_>) {
16871687
drop(self.sender.send(SharedEmitterMessage::Diagnostic(Diagnostic {
16881688
msg: db.message(),
16891689
code: db.code.clone(),
@@ -1822,7 +1822,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> {
18221822
}
18231823

18241824
pub fn submit_pre_codegened_module_to_llvm(&self,
1825-
tcx: TyCtxt,
1825+
tcx: TyCtxt<'_, '_, '_>,
18261826
module: ModuleCodegen<B::Module>) {
18271827
self.wait_for_signal_to_codegen_item();
18281828
self.check_for_errors(tcx.sess);
@@ -1832,7 +1832,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> {
18321832
submit_codegened_module_to_llvm(&self.backend, tcx, module, cost);
18331833
}
18341834

1835-
pub fn codegen_finished(&self, tcx: TyCtxt) {
1835+
pub fn codegen_finished(&self, tcx: TyCtxt<'_, '_, '_>) {
18361836
self.wait_for_signal_to_codegen_item();
18371837
self.check_for_errors(tcx.sess);
18381838
drop(self.coordinator_send.send(Box::new(Message::CodegenComplete::<B>)));
@@ -1871,7 +1871,7 @@ impl<B: ExtraBackendMethods> OngoingCodegen<B> {
18711871

18721872
pub fn submit_codegened_module_to_llvm<B: ExtraBackendMethods>(
18731873
_backend: &B,
1874-
tcx: TyCtxt,
1874+
tcx: TyCtxt<'_, '_, '_>,
18751875
module: ModuleCodegen<B::Module>,
18761876
cost: u64
18771877
) {
@@ -1884,7 +1884,7 @@ pub fn submit_codegened_module_to_llvm<B: ExtraBackendMethods>(
18841884

18851885
pub fn submit_post_lto_module_to_llvm<B: ExtraBackendMethods>(
18861886
_backend: &B,
1887-
tcx: TyCtxt,
1887+
tcx: TyCtxt<'_, '_, '_>,
18881888
module: CachedModuleCodegen
18891889
) {
18901890
let llvm_work_item = WorkItem::CopyPostLtoArtifacts(module);
@@ -1896,7 +1896,7 @@ pub fn submit_post_lto_module_to_llvm<B: ExtraBackendMethods>(
18961896

18971897
pub fn submit_pre_lto_module_to_llvm<B: ExtraBackendMethods>(
18981898
_backend: &B,
1899-
tcx: TyCtxt,
1899+
tcx: TyCtxt<'_, '_, '_>,
19001900
module: CachedModuleCodegen
19011901
) {
19021902
let filename = pre_lto_bitcode_filename(&module.name);
@@ -1921,7 +1921,7 @@ pub fn pre_lto_bitcode_filename(module_name: &str) -> String {
19211921
format!("{}.{}", module_name, PRE_LTO_BC_EXT)
19221922
}
19231923

1924-
fn msvc_imps_needed(tcx: TyCtxt) -> bool {
1924+
fn msvc_imps_needed(tcx: TyCtxt<'_, '_, '_>) -> bool {
19251925
// This should never be true (because it's not supported). If it is true,
19261926
// something is wrong with commandline arg validation.
19271927
assert!(!(tcx.sess.opts.cg.linker_plugin_lto.enabled() &&

src/librustc_codegen_ssa/base.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ pub fn from_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
370370
pub fn to_immediate<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
371371
bx: &mut Bx,
372372
val: Bx::Value,
373-
layout: layout::TyLayout,
373+
layout: layout::TyLayout<'_>,
374374
) -> Bx::Value {
375375
if let layout::Abi::Scalar(ref scalar) = layout.abi {
376376
return to_immediate_scalar(bx, val, scalar);
@@ -802,7 +802,7 @@ fn assert_and_save_dep_graph<'ll, 'tcx>(tcx: TyCtxt<'ll, 'tcx, 'tcx>) {
802802
}
803803

804804
impl CrateInfo {
805-
pub fn new(tcx: TyCtxt) -> CrateInfo {
805+
pub fn new(tcx: TyCtxt<'_, '_, '_>) -> CrateInfo {
806806
let mut info = CrateInfo {
807807
panic_runtime: None,
808808
compiler_builtins: None,
@@ -880,7 +880,7 @@ impl CrateInfo {
880880
return info
881881
}
882882

883-
fn load_wasm_imports(&mut self, tcx: TyCtxt, cnum: CrateNum) {
883+
fn load_wasm_imports(&mut self, tcx: TyCtxt<'_, '_, '_>, cnum: CrateNum) {
884884
self.wasm_imports.extend(tcx.wasm_import_module_map(cnum).iter().map(|(&id, module)| {
885885
let instance = Instance::mono(tcx, id);
886886
let import_name = tcx.symbol_name(instance);
@@ -890,13 +890,13 @@ impl CrateInfo {
890890
}
891891
}
892892

893-
fn is_codegened_item(tcx: TyCtxt, id: DefId) -> bool {
893+
fn is_codegened_item(tcx: TyCtxt<'_, '_, '_>, id: DefId) -> bool {
894894
let (all_mono_items, _) =
895895
tcx.collect_and_partition_mono_items(LOCAL_CRATE);
896896
all_mono_items.contains(&id)
897897
}
898898

899-
pub fn provide_both(providers: &mut Providers) {
899+
pub fn provide_both(providers: &mut Providers<'_>) {
900900
providers.backend_optimization_level = |tcx, cratenum| {
901901
let for_speed = match tcx.sess.opts.optimize {
902902
// If globally no optimisation is done, #[optimize] has no effect.

src/librustc_codegen_ssa/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ mod temp_stable_hash_impls {
134134
}
135135
}
136136

137-
pub fn langcall(tcx: TyCtxt,
137+
pub fn langcall(tcx: TyCtxt<'_, '_, '_>,
138138
span: Option<Span>,
139139
msg: &str,
140140
li: LangItem)

src/librustc_codegen_ssa/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![allow(dead_code)]
1212
#![deny(rust_2018_idioms)]
1313
#![allow(explicit_outlives_requirements)]
14-
#![allow(elided_lifetimes_in_paths)]
1514

1615
#![recursion_limit="256"]
1716

src/librustc_codegen_ssa/mir/operand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub struct OperandRef<'tcx, V> {
4848
}
4949

5050
impl<V: CodegenObject> fmt::Debug for OperandRef<'tcx, V> {
51-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
51+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
5252
write!(f, "OperandRef({:?} @ {:?})", self.val, self.layout)
5353
}
5454
}

src/librustc_codegen_ssa/traits/backend.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,18 @@ impl<'tcx, T> Backend<'tcx> for T where
3232
}
3333

3434
pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Send {
35-
fn new_metadata(&self, sess: TyCtxt, mod_name: &str) -> Self::Module;
35+
fn new_metadata(&self, sess: TyCtxt<'_, '_, '_>, mod_name: &str) -> Self::Module;
3636
fn write_metadata<'b, 'gcx>(
3737
&self,
3838
tcx: TyCtxt<'b, 'gcx, 'gcx>,
3939
metadata: &mut Self::Module,
4040
) -> EncodedMetadata;
41-
fn codegen_allocator(&self, tcx: TyCtxt, mods: &mut Self::Module, kind: AllocatorKind);
41+
fn codegen_allocator(
42+
&self,
43+
tcx: TyCtxt<'_, '_, '_>,
44+
mods: &mut Self::Module,
45+
kind: AllocatorKind
46+
);
4247
fn compile_codegen_unit<'a, 'tcx: 'a>(
4348
&self,
4449
tcx: TyCtxt<'a, 'tcx, 'tcx>,

src/librustc_codegen_ssa/traits/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ pub trait BuilderMethods<'a, 'tcx: 'a>:
100100
fn checked_binop(
101101
&mut self,
102102
oop: OverflowOp,
103-
ty: Ty,
103+
ty: Ty<'_>,
104104
lhs: Self::Value,
105105
rhs: Self::Value,
106106
) -> (Self::Value, Self::Value);

src/librustc_codegen_ssa/traits/debuginfo.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ pub trait DebugInfoMethods<'tcx>: BackendTypes {
2222
instance: Instance<'tcx>,
2323
sig: ty::FnSig<'tcx>,
2424
llfn: Self::Value,
25-
mir: &mir::Mir,
25+
mir: &mir::Mir<'_>,
2626
) -> FunctionDebugContext<Self::DIScope>;
2727

2828
fn create_mir_scopes(
2929
&self,
30-
mir: &mir::Mir,
30+
mir: &mir::Mir<'_>,
3131
debug_context: &FunctionDebugContext<Self::DIScope>,
3232
) -> IndexVec<mir::SourceScope, MirDebugScope<Self::DIScope>>;
3333
fn extend_scope_to_file(

0 commit comments

Comments
 (0)