Skip to content

Commit 2970a13

Browse files
authored
Rollup merge of rust-lang#62039 - jeremystucki:needless_lifetimes, r=eddyb
Remove needless lifetimes (rustc)
2 parents 088b987 + 88c515d commit 2970a13

File tree

128 files changed

+440
-440
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+440
-440
lines changed

src/libproc_macro/bridge/scoped_cell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<T: LambdaL> ScopedCell<T> {
7474
}
7575

7676
/// Sets the value in `self` to `value` while running `f`.
77-
pub fn set<'a, R>(&self, value: <T as ApplyL<'a>>::Out, f: impl FnOnce() -> R) -> R {
77+
pub fn set<R>(&self, value: <T as ApplyL<'_>>::Out, f: impl FnOnce() -> R) -> R {
7878
self.replace(value, |_| f())
7979
}
8080
}

src/librustc/cfg/construct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct LoopScope {
3030
break_index: CFGIndex, // where to go on a `break`
3131
}
3232

33-
pub fn construct<'tcx>(tcx: TyCtxt<'tcx>, body: &hir::Body) -> CFG {
33+
pub fn construct(tcx: TyCtxt<'_>, body: &hir::Body) -> CFG {
3434
let mut graph = graph::Graph::new();
3535
let entry = graph.add_node(CFGNodeData::Entry);
3636

src/librustc/cfg/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub type CFGNode = graph::Node<CFGNodeData>;
4949
pub type CFGEdge = graph::Edge<CFGEdgeData>;
5050

5151
impl CFG {
52-
pub fn new<'tcx>(tcx: TyCtxt<'tcx>, body: &hir::Body) -> CFG {
52+
pub fn new(tcx: TyCtxt<'_>, body: &hir::Body) -> CFG {
5353
construct::construct(tcx, body)
5454
}
5555

src/librustc/dep_graph/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ impl DepGraph {
841841
//
842842
// This method will only load queries that will end up in the disk cache.
843843
// Other queries will not be executed.
844-
pub fn exec_cache_promotions<'tcx>(&self, tcx: TyCtxt<'tcx>) {
844+
pub fn exec_cache_promotions(&self, tcx: TyCtxt<'_>) {
845845
let data = self.data.as_ref().unwrap();
846846
for prev_index in data.colors.values.indices() {
847847
match data.colors.get(prev_index) {

src/librustc/hir/check_attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ fn is_c_like_enum(item: &hir::Item) -> bool {
347347
}
348348
}
349349

350-
fn check_mod_attrs<'tcx>(tcx: TyCtxt<'tcx>, module_def_id: DefId) {
350+
fn check_mod_attrs(tcx: TyCtxt<'_>, module_def_id: DefId) {
351351
tcx.hir().visit_item_likes_in_module(
352352
module_def_id,
353353
&mut CheckAttrVisitor { tcx }.as_deep_visitor()

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/infer/type_variable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
115115
///
116116
/// Note that this function does not return care whether
117117
/// `vid` has been unified with something else or not.
118-
pub fn var_diverges<'a>(&'a self, vid: ty::TyVid) -> bool {
118+
pub fn var_diverges(&self, vid: ty::TyVid) -> bool {
119119
self.values.get(vid.index as usize).diverging
120120
}
121121

src/librustc/lint/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ pub fn maybe_lint_level_root(tcx: TyCtxt<'_>, id: hir::HirId) -> bool {
765765
attrs.iter().any(|attr| Level::from_symbol(attr.name_or_empty()).is_some())
766766
}
767767

768-
fn lint_levels<'tcx>(tcx: TyCtxt<'tcx>, cnum: CrateNum) -> &'tcx LintLevelMap {
768+
fn lint_levels(tcx: TyCtxt<'_>, cnum: CrateNum) -> &LintLevelMap {
769769
assert_eq!(cnum, LOCAL_CRATE);
770770
let mut builder = LintLevelMapBuilder {
771771
levels: LintLevelSets::builder(tcx.sess),

src/librustc/middle/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pub trait CrateStore {
211211
fn crates_untracked(&self) -> Vec<CrateNum>;
212212

213213
// utility functions
214-
fn encode_metadata<'tcx>(&self, tcx: TyCtxt<'tcx>) -> EncodedMetadata;
214+
fn encode_metadata(&self, tcx: TyCtxt<'_>) -> EncodedMetadata;
215215
fn metadata_encoding_version(&self) -> &[u8];
216216
}
217217

0 commit comments

Comments
 (0)