Skip to content

Commit 0477e07

Browse files
committed
Remove needless lifetimes
1 parent 87e8613 commit 0477e07

File tree

17 files changed

+38
-38
lines changed

17 files changed

+38
-38
lines changed

src/librustc/hir/map/hir_id_validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::hir::itemlikevisit::ItemLikeVisitor;
44
use rustc_data_structures::fx::FxHashSet;
55
use rustc_data_structures::sync::{Lock, ParallelIterator, par_iter};
66

7-
pub fn check_crate<'hir>(hir_map: &hir::map::Map<'hir>) {
7+
pub fn check_crate(hir_map: &hir::map::Map<'_>) {
88
hir_map.dep_graph.assert_ignored();
99

1010
let errors = Lock::new(Vec::new());

src/librustc/hir/map/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ impl Forest {
147147
}
148148
}
149149

150-
pub fn krate<'hir>(&'hir self) -> &'hir Crate {
150+
pub fn krate(&self) -> &Crate {
151151
self.dep_graph.read(DepNode::new_no_params(DepKind::Krate));
152152
&self.krate
153153
}
154154

155155
/// This is used internally in the dependency tracking system.
156156
/// Use the `krate` method to ensure your dependency on the
157157
/// crate is tracked.
158-
pub fn untracked_krate<'hir>(&'hir self) -> &'hir Crate {
158+
pub fn untracked_krate(&self) -> &Crate {
159159
&self.krate
160160
}
161161
}
@@ -1085,7 +1085,7 @@ impl<'a> NodesMatchingSuffix<'a> {
10851085
// If `id` itself is a mod named `m` with parent `p`, then
10861086
// returns `Some(id, m, p)`. If `id` has no mod in its parent
10871087
// chain, then returns `None`.
1088-
fn find_first_mod_parent<'a>(map: &'a Map<'_>, mut id: HirId) -> Option<(HirId, Name)> {
1088+
fn find_first_mod_parent(map: &Map<'_>, mut id: HirId) -> Option<(HirId, Name)> {
10891089
loop {
10901090
if let Node::Item(item) = map.find(id)? {
10911091
if item_is_mod(&item) {

src/librustc/traits/coherence.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub fn add_placeholder_note(err: &mut errors::DiagnosticBuilder<'_>) {
4848
/// If there are types that satisfy both impls, invokes `on_overlap`
4949
/// with a suitably-freshened `ImplHeader` with those types
5050
/// substituted. Otherwise, invokes `no_overlap`.
51-
pub fn overlapping_impls<'tcx, F1, F2, R>(
52-
tcx: TyCtxt<'tcx>,
51+
pub fn overlapping_impls<F1, F2, R>(
52+
tcx: TyCtxt<'_>,
5353
impl1_def_id: DefId,
5454
impl2_def_id: DefId,
5555
intercrate_mode: IntercrateMode,
@@ -247,10 +247,10 @@ pub enum OrphanCheckErr<'tcx> {
247247
///
248248
/// 1. All type parameters in `Self` must be "covered" by some local type constructor.
249249
/// 2. Some local type must appear in `Self`.
250-
pub fn orphan_check<'tcx>(
251-
tcx: TyCtxt<'tcx>,
250+
pub fn orphan_check(
251+
tcx: TyCtxt<'_>,
252252
impl_def_id: DefId,
253-
) -> Result<(), OrphanCheckErr<'tcx>> {
253+
) -> Result<(), OrphanCheckErr<'_>> {
254254
debug!("orphan_check({:?})", impl_def_id);
255255

256256
// We only except this routine to be invoked on implementations

src/librustc/traits/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
247247
fn fuzzy_match_tys(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> bool {
248248
/// returns the fuzzy category of a given type, or None
249249
/// if the type can be equated to any type.
250-
fn type_category<'tcx>(t: Ty<'tcx>) -> Option<u32> {
250+
fn type_category(t: Ty<'_>) -> Option<u32> {
251251
match t.sty {
252252
ty::Bool => Some(0),
253253
ty::Char => Some(1),

src/librustc/traits/object_safety.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,6 @@ impl<'tcx> TyCtxt<'tcx> {
702702
}
703703
}
704704

705-
pub(super) fn is_object_safe_provider<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId) -> bool {
705+
pub(super) fn is_object_safe_provider(tcx: TyCtxt<'_>, trait_def_id: DefId) -> bool {
706706
tcx.object_safety_violations(trait_def_id).is_empty()
707707
}

src/librustc/traits/project.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,8 +1509,8 @@ fn confirm_impl_candidate<'cx, 'tcx>(
15091509
///
15101510
/// Based on the "projection mode", this lookup may in fact only examine the
15111511
/// topmost impl. See the comments for `Reveal` for more details.
1512-
fn assoc_ty_def<'cx, 'tcx>(
1513-
selcx: &SelectionContext<'cx, 'tcx>,
1512+
fn assoc_ty_def(
1513+
selcx: &SelectionContext<'_, '_>,
15141514
impl_def_id: DefId,
15151515
assoc_ty_def_id: DefId,
15161516
) -> specialization_graph::NodeItem<ty::AssocItem> {

src/librustc/traits/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ pub struct SupertraitDefIds<'tcx> {
417417
visited: FxHashSet<DefId>,
418418
}
419419

420-
pub fn supertrait_def_ids<'tcx>(tcx: TyCtxt<'tcx>, trait_def_id: DefId) -> SupertraitDefIds<'tcx> {
420+
pub fn supertrait_def_ids(tcx: TyCtxt<'_>, trait_def_id: DefId) -> SupertraitDefIds<'_> {
421421
SupertraitDefIds {
422422
tcx,
423423
stack: vec![trait_def_id],

src/librustc_codegen_ssa/traits/backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub trait ExtraBackendMethods: CodegenBackend + WriteBackendMethods + Sized + Se
4444
mods: &mut Self::Module,
4545
kind: AllocatorKind,
4646
);
47-
fn compile_codegen_unit<'tcx>(&self, tcx: TyCtxt<'tcx>, cgu_name: InternedString);
47+
fn compile_codegen_unit(&self, tcx: TyCtxt<'_>, cgu_name: InternedString);
4848
// If find_features is true this won't access `sess.crate_types` by assuming
4949
// that `is_pie_binary` is false. When we discover LLVM target features
5050
// `sess.crate_types` is uninitialized so we cannot access it.

src/librustc_codegen_ssa/traits/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub trait BuilderMethods<'a, 'tcx>:
3636
{
3737
fn new_block<'b>(cx: &'a Self::CodegenCx, llfn: Self::Value, name: &'b str) -> Self;
3838
fn with_cx(cx: &'a Self::CodegenCx) -> Self;
39-
fn build_sibling_block<'b>(&self, name: &'b str) -> Self;
39+
fn build_sibling_block(&self, name: &str) -> Self;
4040
fn cx(&self) -> &Self::CodegenCx;
4141
fn llbb(&self) -> Self::BasicBlock;
4242

src/librustc_mir/transform/add_retag.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ pub struct AddRetag;
1414
/// after the assignment, we can be sure to obtain the same place value.
1515
/// (Concurrent accesses by other threads are no problem as these are anyway non-atomic
1616
/// copies. Data races are UB.)
17-
fn is_stable<'tcx>(
18-
place: &Place<'tcx>,
17+
fn is_stable(
18+
place: &Place<'_>,
1919
) -> bool {
2020
use rustc::mir::Place::*;
2121

0 commit comments

Comments
 (0)