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) => {

0 commit comments

Comments
 (0)