Skip to content

Commit 69e8a77

Browse files
committed
Remove needless lifetimes
1 parent a3dda49 commit 69e8a77

File tree

29 files changed

+99
-99
lines changed

29 files changed

+99
-99
lines changed

src/librustc_borrowck/dataflow.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ struct PropagationContext<'a, 'tcx, O> {
8484
changed: bool,
8585
}
8686

87-
fn get_cfg_indices<'a>(id: hir::ItemLocalId,
88-
index: &'a FxHashMap<hir::ItemLocalId, Vec<CFGIndex>>)
89-
-> &'a [CFGIndex] {
87+
fn get_cfg_indices(id: hir::ItemLocalId,
88+
index: &FxHashMap<hir::ItemLocalId, Vec<CFGIndex>>)
89+
-> &[CFGIndex] {
9090
index.get(&id).map_or(&[], |v| &v[..])
9191
}
9292

src/librustc_codegen_llvm/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ pub fn compile_codegen_unit(tcx: TyCtxt<'tcx>, cgu_name: InternedString) {
123123

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

126-
fn module_codegen<'tcx>(
127-
tcx: TyCtxt<'tcx>,
126+
fn module_codegen(
127+
tcx: TyCtxt<'_>,
128128
cgu_name: InternedString,
129129
) -> ModuleCodegen<ModuleLlvm> {
130130
let cgu = tcx.codegen_unit(cgu_name);

src/librustc_codegen_llvm/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
144144
}
145145
}
146146

147-
fn build_sibling_block<'b>(&self, name: &'b str) -> Self {
147+
fn build_sibling_block(&self, name: &str) -> Self {
148148
Builder::new_block(self.cx, self.llfn(), name)
149149
}
150150

src/librustc_codegen_llvm/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl ExtraBackendMethods for LlvmCodegenBackend {
124124
) {
125125
unsafe { allocator::codegen(tcx, mods, kind) }
126126
}
127-
fn compile_codegen_unit<'tcx>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString) {
127+
fn compile_codegen_unit(&self, tcx: TyCtxt<'_>, cgu_name: InternedString) {
128128
base::compile_codegen_unit(tcx, cgu_name);
129129
}
130130
fn target_machine_factory(

src/librustc_codegen_ssa/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ impl<B: ExtraBackendMethods> Drop for AbortCodegenOnDrop<B> {
700700
}
701701
}
702702

703-
fn assert_and_save_dep_graph<'tcx>(tcx: TyCtxt<'tcx>) {
703+
fn assert_and_save_dep_graph(tcx: TyCtxt<'_>) {
704704
time(tcx.sess,
705705
"assert dep graph",
706706
|| ::rustc_incremental::assert_dep_graph(tcx));

src/librustc_codegen_utils/symbol_names_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use syntax::symbol::{Symbol, sym};
1111
const SYMBOL_NAME: Symbol = sym::rustc_symbol_name;
1212
const DEF_PATH: Symbol = sym::rustc_def_path;
1313

14-
pub fn report_symbol_names<'tcx>(tcx: TyCtxt<'tcx>) {
14+
pub fn report_symbol_names(tcx: TyCtxt<'_>) {
1515
// if the `rustc_attrs` feature is not enabled, then the
1616
// attributes we are interested in cannot be present anyway, so
1717
// skip the walk.

src/librustc_data_structures/bit_set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl<T: Idx> BitSet<T> {
168168

169169
/// Iterates over the indices of set bits in a sorted order.
170170
#[inline]
171-
pub fn iter<'a>(&'a self) -> BitIter<'a, T> {
171+
pub fn iter(&self) -> BitIter<'_, T> {
172172
BitIter {
173173
cur: None,
174174
iter: self.words.iter().enumerate(),
@@ -849,7 +849,7 @@ impl<R: Idx, C: Idx> BitMatrix<R, C> {
849849

850850
/// Iterates through all the columns set to true in a given row of
851851
/// the matrix.
852-
pub fn iter<'a>(&'a self, row: R) -> BitIter<'a, C> {
852+
pub fn iter(&self, row: R) -> BitIter<'_, C> {
853853
assert!(row.index() < self.num_rows);
854854
let (start, end) = self.range(row);
855855
BitIter {

src/librustc_data_structures/fingerprint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl Fingerprint {
5858
Ok(())
5959
}
6060

61-
pub fn decode_opaque<'a>(decoder: &mut Decoder<'a>) -> Result<Fingerprint, String> {
61+
pub fn decode_opaque(decoder: &mut Decoder<'_>) -> Result<Fingerprint, String> {
6262
let mut bytes = [0; 16];
6363

6464
decoder.read_raw_bytes(&mut bytes)?;

src/librustc_driver/pretty.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl PpSourceMode {
188188
_ => panic!("Should use call_with_pp_support_hir"),
189189
}
190190
}
191-
fn call_with_pp_support_hir<'tcx, A, F>(&self, tcx: TyCtxt<'tcx>, f: F) -> A
191+
fn call_with_pp_support_hir<A, F>(&self, tcx: TyCtxt<'_>, f: F) -> A
192192
where
193193
F: FnOnce(&dyn HirPrinterSupport<'_>, &hir::Crate) -> A,
194194
{
@@ -228,7 +228,7 @@ impl PpSourceMode {
228228
trait PrinterSupport: pprust::PpAnn {
229229
/// Provides a uniform interface for re-extracting a reference to a
230230
/// `Session` from a value that now owns it.
231-
fn sess<'a>(&'a self) -> &'a Session;
231+
fn sess(&self) -> &Session;
232232

233233
/// Produces the pretty-print annotation object.
234234
///
@@ -240,7 +240,7 @@ trait PrinterSupport: pprust::PpAnn {
240240
trait HirPrinterSupport<'hir>: pprust_hir::PpAnn {
241241
/// Provides a uniform interface for re-extracting a reference to a
242242
/// `Session` from a value that now owns it.
243-
fn sess<'a>(&'a self) -> &'a Session;
243+
fn sess(&self) -> &Session;
244244

245245
/// Provides a uniform interface for re-extracting a reference to an
246246
/// `hir_map::Map` from a value that now owns it.
@@ -272,7 +272,7 @@ struct NoAnn<'hir> {
272272
}
273273

274274
impl<'hir> PrinterSupport for NoAnn<'hir> {
275-
fn sess<'a>(&'a self) -> &'a Session {
275+
fn sess(&self) -> &Session {
276276
self.sess
277277
}
278278

@@ -282,7 +282,7 @@ impl<'hir> PrinterSupport for NoAnn<'hir> {
282282
}
283283

284284
impl<'hir> HirPrinterSupport<'hir> for NoAnn<'hir> {
285-
fn sess<'a>(&'a self) -> &'a Session {
285+
fn sess(&self) -> &Session {
286286
self.sess
287287
}
288288

@@ -313,7 +313,7 @@ struct IdentifiedAnnotation<'hir> {
313313
}
314314

315315
impl<'hir> PrinterSupport for IdentifiedAnnotation<'hir> {
316-
fn sess<'a>(&'a self) -> &'a Session {
316+
fn sess(&self) -> &Session {
317317
self.sess
318318
}
319319

@@ -360,7 +360,7 @@ impl<'hir> pprust::PpAnn for IdentifiedAnnotation<'hir> {
360360
}
361361

362362
impl<'hir> HirPrinterSupport<'hir> for IdentifiedAnnotation<'hir> {
363-
fn sess<'a>(&'a self) -> &'a Session {
363+
fn sess(&self) -> &Session {
364364
self.sess
365365
}
366366

@@ -458,7 +458,7 @@ struct TypedAnnotation<'a, 'tcx> {
458458
}
459459

460460
impl<'b, 'tcx> HirPrinterSupport<'tcx> for TypedAnnotation<'b, 'tcx> {
461-
fn sess<'a>(&'a self) -> &'a Session {
461+
fn sess(&self) -> &Session {
462462
&self.tcx.sess
463463
}
464464

@@ -866,8 +866,8 @@ pub fn print_after_hir_lowering<'tcx>(
866866
// analysis is performed. However, we want to call `phase_3_run_analysis_passes`
867867
// with a different callback than the standard driver, so that isn't easy.
868868
// Instead, we call that function ourselves.
869-
fn print_with_analysis<'tcx>(
870-
tcx: TyCtxt<'tcx>,
869+
fn print_with_analysis(
870+
tcx: TyCtxt<'_>,
871871
ppm: PpMode,
872872
uii: Option<UserIdentifiedItem>,
873873
ofile: Option<&Path>,

src/librustc_errors/emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1635,7 +1635,7 @@ impl Destination {
16351635
}
16361636
}
16371637

1638-
fn writable<'a>(&'a mut self) -> WritableDst<'a> {
1638+
fn writable(&mut self) -> WritableDst<'_> {
16391639
match *self {
16401640
Destination::Terminal(ref mut t) => WritableDst::Terminal(t),
16411641
Destination::Buffered(ref mut t) => {

src/librustc_errors/lib.rs

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -438,26 +438,26 @@ impl Handler {
438438
self.err_count.store(0, SeqCst);
439439
}
440440

441-
pub fn struct_dummy<'a>(&'a self) -> DiagnosticBuilder<'a> {
441+
pub fn struct_dummy(&self) -> DiagnosticBuilder<'_> {
442442
DiagnosticBuilder::new(self, Level::Cancelled, "")
443443
}
444444

445-
pub fn struct_span_warn<'a, S: Into<MultiSpan>>(&'a self,
446-
sp: S,
447-
msg: &str)
448-
-> DiagnosticBuilder<'a> {
445+
pub fn struct_span_warn<S: Into<MultiSpan>>(&self,
446+
sp: S,
447+
msg: &str)
448+
-> DiagnosticBuilder<'_> {
449449
let mut result = DiagnosticBuilder::new(self, Level::Warning, msg);
450450
result.set_span(sp);
451451
if !self.flags.can_emit_warnings {
452452
result.cancel();
453453
}
454454
result
455455
}
456-
pub fn struct_span_warn_with_code<'a, S: Into<MultiSpan>>(&'a self,
457-
sp: S,
458-
msg: &str,
459-
code: DiagnosticId)
460-
-> DiagnosticBuilder<'a> {
456+
pub fn struct_span_warn_with_code<S: Into<MultiSpan>>(&self,
457+
sp: S,
458+
msg: &str,
459+
code: DiagnosticId)
460+
-> DiagnosticBuilder<'_> {
461461
let mut result = DiagnosticBuilder::new(self, Level::Warning, msg);
462462
result.set_span(sp);
463463
result.code(code);
@@ -466,63 +466,63 @@ impl Handler {
466466
}
467467
result
468468
}
469-
pub fn struct_warn<'a>(&'a self, msg: &str) -> DiagnosticBuilder<'a> {
469+
pub fn struct_warn(&self, msg: &str) -> DiagnosticBuilder<'_> {
470470
let mut result = DiagnosticBuilder::new(self, Level::Warning, msg);
471471
if !self.flags.can_emit_warnings {
472472
result.cancel();
473473
}
474474
result
475475
}
476-
pub fn struct_span_err<'a, S: Into<MultiSpan>>(&'a self,
477-
sp: S,
478-
msg: &str)
479-
-> DiagnosticBuilder<'a> {
476+
pub fn struct_span_err<S: Into<MultiSpan>>(&self,
477+
sp: S,
478+
msg: &str)
479+
-> DiagnosticBuilder<'_> {
480480
let mut result = DiagnosticBuilder::new(self, Level::Error, msg);
481481
result.set_span(sp);
482482
result
483483
}
484-
pub fn struct_span_err_with_code<'a, S: Into<MultiSpan>>(&'a self,
485-
sp: S,
486-
msg: &str,
487-
code: DiagnosticId)
488-
-> DiagnosticBuilder<'a> {
484+
pub fn struct_span_err_with_code<S: Into<MultiSpan>>(&self,
485+
sp: S,
486+
msg: &str,
487+
code: DiagnosticId)
488+
-> DiagnosticBuilder<'_> {
489489
let mut result = DiagnosticBuilder::new(self, Level::Error, msg);
490490
result.set_span(sp);
491491
result.code(code);
492492
result
493493
}
494494
// FIXME: This method should be removed (every error should have an associated error code).
495-
pub fn struct_err<'a>(&'a self, msg: &str) -> DiagnosticBuilder<'a> {
495+
pub fn struct_err(&self, msg: &str) -> DiagnosticBuilder<'_> {
496496
DiagnosticBuilder::new(self, Level::Error, msg)
497497
}
498-
pub fn struct_err_with_code<'a>(
499-
&'a self,
498+
pub fn struct_err_with_code(
499+
&self,
500500
msg: &str,
501501
code: DiagnosticId,
502-
) -> DiagnosticBuilder<'a> {
502+
) -> DiagnosticBuilder<'_> {
503503
let mut result = DiagnosticBuilder::new(self, Level::Error, msg);
504504
result.code(code);
505505
result
506506
}
507-
pub fn struct_span_fatal<'a, S: Into<MultiSpan>>(&'a self,
508-
sp: S,
509-
msg: &str)
510-
-> DiagnosticBuilder<'a> {
507+
pub fn struct_span_fatal<S: Into<MultiSpan>>(&self,
508+
sp: S,
509+
msg: &str)
510+
-> DiagnosticBuilder<'_> {
511511
let mut result = DiagnosticBuilder::new(self, Level::Fatal, msg);
512512
result.set_span(sp);
513513
result
514514
}
515-
pub fn struct_span_fatal_with_code<'a, S: Into<MultiSpan>>(&'a self,
516-
sp: S,
517-
msg: &str,
518-
code: DiagnosticId)
519-
-> DiagnosticBuilder<'a> {
515+
pub fn struct_span_fatal_with_code<S: Into<MultiSpan>>(&self,
516+
sp: S,
517+
msg: &str,
518+
code: DiagnosticId)
519+
-> DiagnosticBuilder<'_> {
520520
let mut result = DiagnosticBuilder::new(self, Level::Fatal, msg);
521521
result.set_span(sp);
522522
result.code(code);
523523
result
524524
}
525-
pub fn struct_fatal<'a>(&'a self, msg: &str) -> DiagnosticBuilder<'a> {
525+
pub fn struct_fatal(&self, msg: &str) -> DiagnosticBuilder<'_> {
526526
DiagnosticBuilder::new(self, Level::Fatal, msg)
527527
}
528528

@@ -563,10 +563,10 @@ impl Handler {
563563
pub fn span_err<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
564564
self.emit(&sp.into(), msg, Error);
565565
}
566-
pub fn mut_span_err<'a, S: Into<MultiSpan>>(&'a self,
567-
sp: S,
568-
msg: &str)
569-
-> DiagnosticBuilder<'a> {
566+
pub fn mut_span_err<S: Into<MultiSpan>>(&self,
567+
sp: S,
568+
msg: &str)
569+
-> DiagnosticBuilder<'_> {
570570
let mut result = DiagnosticBuilder::new(self, Level::Error, msg);
571571
result.set_span(sp);
572572
result
@@ -605,10 +605,10 @@ impl Handler {
605605
pub fn span_note_without_error<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
606606
self.emit(&sp.into(), msg, Note);
607607
}
608-
pub fn span_note_diag<'a>(&'a self,
609-
sp: Span,
610-
msg: &str)
611-
-> DiagnosticBuilder<'a> {
608+
pub fn span_note_diag(&self,
609+
sp: Span,
610+
msg: &str)
611+
-> DiagnosticBuilder<'_> {
612612
let mut db = DiagnosticBuilder::new(self, Note, msg);
613613
db.set_span(sp);
614614
db

src/librustc_incremental/assert_dep_graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use std::io::Write;
5151
use syntax::ast;
5252
use syntax_pos::Span;
5353

54-
pub fn assert_dep_graph<'tcx>(tcx: TyCtxt<'tcx>) {
54+
pub fn assert_dep_graph(tcx: TyCtxt<'_>) {
5555
tcx.dep_graph.with_ignore(|| {
5656
if tcx.sess.opts.debugging_opts.dump_dep_graph {
5757
dump_graph(tcx);

src/librustc_incremental/assert_module_sources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const MODULE: Symbol = sym::module;
3535
const CFG: Symbol = sym::cfg;
3636
const KIND: Symbol = sym::kind;
3737

38-
pub fn assert_module_sources<'tcx>(tcx: TyCtxt<'tcx>) {
38+
pub fn assert_module_sources(tcx: TyCtxt<'_>) {
3939
tcx.dep_graph.with_ignore(|| {
4040
if tcx.sess.opts.incremental.is_none() {
4141
return;

src/librustc_interface/passes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ pub fn create_global_ctxt(
878878

879879
/// Runs the resolution, type-checking, region checking and other
880880
/// miscellaneous analysis passes on the crate.
881-
fn analysis<'tcx>(tcx: TyCtxt<'tcx>, cnum: CrateNum) -> Result<()> {
881+
fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
882882
assert_eq!(cnum, LOCAL_CRATE);
883883

884884
let sess = tcx.sess;
@@ -995,8 +995,8 @@ fn analysis<'tcx>(tcx: TyCtxt<'tcx>, cnum: CrateNum) -> Result<()> {
995995
Ok(())
996996
}
997997

998-
fn encode_and_write_metadata<'tcx>(
999-
tcx: TyCtxt<'tcx>,
998+
fn encode_and_write_metadata(
999+
tcx: TyCtxt<'_>,
10001000
outputs: &OutputFilenames,
10011001
) -> (middle::cstore::EncodedMetadata, bool) {
10021002
#[derive(PartialEq, Eq, PartialOrd, Ord)]

src/librustc_interface/proc_macro_decls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ use rustc::ty::query::Providers;
66
use syntax::attr;
77
use syntax::symbol::sym;
88

9-
pub fn find<'tcx>(tcx: TyCtxt<'tcx>) -> Option<DefId> {
9+
pub fn find(tcx: TyCtxt<'_>) -> Option<DefId> {
1010
tcx.proc_macro_decls_static(LOCAL_CRATE)
1111
}
1212

13-
fn proc_macro_decls_static<'tcx>(tcx: TyCtxt<'tcx>, cnum: CrateNum) -> Option<DefId> {
13+
fn proc_macro_decls_static(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<DefId> {
1414
assert_eq!(cnum, LOCAL_CRATE);
1515

1616
let mut finder = Finder { decls: None };

src/librustc_lint/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub fn provide(providers: &mut Providers<'_>) {
7474
};
7575
}
7676

77-
fn lint_mod<'tcx>(tcx: TyCtxt<'tcx>, module_def_id: DefId) {
77+
fn lint_mod(tcx: TyCtxt<'_>, module_def_id: DefId) {
7878
lint::late_lint_mod(tcx, module_def_id, BuiltinCombinedModuleLateLintPass::new());
7979
}
8080

0 commit comments

Comments
 (0)