Skip to content

Commit 856b427

Browse files
committed
Remove needless lifetimes
1 parent 69e8a77 commit 856b427

File tree

48 files changed

+182
-182
lines changed

Some content is hidden

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

48 files changed

+182
-182
lines changed

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

src/librustc/middle/dead.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use syntax_pos;
2626
// explored. For example, if it's a live Node::Item that is a
2727
// function, then we should explore its block to check for codes that
2828
// may need to be marked as live.
29-
fn should_explore<'tcx>(tcx: TyCtxt<'tcx>, hir_id: hir::HirId) -> bool {
29+
fn should_explore(tcx: TyCtxt<'_>, hir_id: hir::HirId) -> bool {
3030
match tcx.hir().find(hir_id) {
3131
Some(Node::Item(..)) |
3232
Some(Node::ImplItem(..)) |
@@ -662,7 +662,7 @@ impl Visitor<'tcx> for DeadVisitor<'tcx> {
662662
}
663663
}
664664

665-
pub fn check_crate<'tcx>(tcx: TyCtxt<'tcx>) {
665+
pub fn check_crate(tcx: TyCtxt<'_>) {
666666
let access_levels = &tcx.privacy_access_levels(LOCAL_CRATE);
667667
let krate = tcx.hir().krate();
668668
let live_symbols = find_live(tcx, access_levels, krate);

src/librustc/middle/dependency_format.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub enum Linkage {
8181
Dynamic,
8282
}
8383

84-
pub fn calculate<'tcx>(tcx: TyCtxt<'tcx>) {
84+
pub fn calculate(tcx: TyCtxt<'_>) {
8585
let sess = &tcx.sess;
8686
let fmts = sess.crate_types.borrow().iter().map(|&ty| {
8787
let linkage = calculate_type(tcx, ty);
@@ -92,7 +92,7 @@ pub fn calculate<'tcx>(tcx: TyCtxt<'tcx>) {
9292
sess.dependency_formats.set(fmts);
9393
}
9494

95-
fn calculate_type<'tcx>(tcx: TyCtxt<'tcx>, ty: config::CrateType) -> DependencyList {
95+
fn calculate_type(tcx: TyCtxt<'_>, ty: config::CrateType) -> DependencyList {
9696
let sess = &tcx.sess;
9797

9898
if !sess.opts.output_types.should_codegen() {
@@ -267,7 +267,7 @@ fn add_library(
267267
}
268268
}
269269

270-
fn attempt_static<'tcx>(tcx: TyCtxt<'tcx>) -> Option<DependencyList> {
270+
fn attempt_static(tcx: TyCtxt<'_>) -> Option<DependencyList> {
271271
let sess = &tcx.sess;
272272
let crates = cstore::used_crates(tcx, RequireStatic);
273273
if !crates.iter().by_ref().all(|&(_, ref p)| p.is_some()) {
@@ -324,7 +324,7 @@ fn activate_injected_dep(injected: Option<CrateNum>,
324324

325325
// After the linkage for a crate has been determined we need to verify that
326326
// there's only going to be one allocator in the output.
327-
fn verify_ok<'tcx>(tcx: TyCtxt<'tcx>, list: &[Linkage]) {
327+
fn verify_ok(tcx: TyCtxt<'_>, list: &[Linkage]) {
328328
let sess = &tcx.sess;
329329
if list.len() == 0 {
330330
return

src/librustc/middle/intrinsicck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use syntax_pos::{Span, sym};
1010
use crate::hir::intravisit::{self, Visitor, NestedVisitorMap};
1111
use crate::hir;
1212

13-
fn check_mod_intrinsics<'tcx>(tcx: TyCtxt<'tcx>, module_def_id: DefId) {
13+
fn check_mod_intrinsics(tcx: TyCtxt<'_>, module_def_id: DefId) {
1414
tcx.hir().visit_item_likes_in_module(
1515
module_def_id,
1616
&mut ItemVisitor { tcx }.as_deep_visitor()

src/librustc/middle/lib_features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl Visitor<'tcx> for LibFeatureCollector<'tcx> {
142142
}
143143
}
144144

145-
pub fn collect<'tcx>(tcx: TyCtxt<'tcx>) -> LibFeatures {
145+
pub fn collect(tcx: TyCtxt<'_>) -> LibFeatures {
146146
let mut collector = LibFeatureCollector::new(tcx);
147147
intravisit::walk_crate(&mut collector, tcx.hir().krate());
148148
collector.lib_features

src/librustc/middle/liveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl<'tcx> Visitor<'tcx> for IrMaps<'tcx> {
181181
fn visit_arm(&mut self, a: &'tcx hir::Arm) { visit_arm(self, a); }
182182
}
183183

184-
fn check_mod_liveness<'tcx>(tcx: TyCtxt<'tcx>, module_def_id: DefId) {
184+
fn check_mod_liveness(tcx: TyCtxt<'_>, module_def_id: DefId) {
185185
tcx.hir().visit_item_likes_in_module(
186186
module_def_id,
187187
&mut IrMaps::new(tcx, module_def_id).as_deep_visitor(),

src/librustc/middle/reachable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ fn item_might_be_inlined(tcx: TyCtxt<'tcx>, item: &hir::Item, attrs: CodegenFnAt
4242
}
4343
}
4444

45-
fn method_might_be_inlined<'tcx>(
46-
tcx: TyCtxt<'tcx>,
45+
fn method_might_be_inlined(
46+
tcx: TyCtxt<'_>,
4747
impl_item: &hir::ImplItem,
4848
impl_src: DefId,
4949
) -> bool {
@@ -391,7 +391,7 @@ impl<'a, 'tcx> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a, 'tcx
391391
#[derive(Clone, HashStable)]
392392
pub struct ReachableSet(pub Lrc<HirIdSet>);
393393

394-
fn reachable_set<'tcx>(tcx: TyCtxt<'tcx>, crate_num: CrateNum) -> ReachableSet {
394+
fn reachable_set(tcx: TyCtxt<'_>, crate_num: CrateNum) -> ReachableSet {
395395
debug_assert!(crate_num == LOCAL_CRATE);
396396

397397
let access_levels = &tcx.privacy_access_levels(LOCAL_CRATE);

src/librustc/middle/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1446,7 +1446,7 @@ impl<'tcx> Visitor<'tcx> for RegionResolutionVisitor<'tcx> {
14461446
}
14471447
}
14481448

1449-
fn region_scope_tree<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> &'tcx ScopeTree {
1449+
fn region_scope_tree(tcx: TyCtxt<'_>, def_id: DefId) -> &ScopeTree {
14501450
let closure_base_def_id = tcx.closure_base_def_id(def_id);
14511451
if closure_base_def_id != def_id {
14521452
return tcx.region_scope_tree(closure_base_def_id);

src/librustc/middle/resolve_lifetime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ pub fn provide(providers: &mut ty::query::Providers<'_>) {
368368
/// entire crate. You should not read the result of this query
369369
/// directly, but rather use `named_region_map`, `is_late_bound_map`,
370370
/// etc.
371-
fn resolve_lifetimes<'tcx>(tcx: TyCtxt<'tcx>, for_krate: CrateNum) -> &'tcx ResolveLifetimes {
371+
fn resolve_lifetimes(tcx: TyCtxt<'_>, for_krate: CrateNum) -> &ResolveLifetimes {
372372
assert_eq!(for_krate, LOCAL_CRATE);
373373

374374
let named_region_map = krate(tcx);
@@ -395,7 +395,7 @@ fn resolve_lifetimes<'tcx>(tcx: TyCtxt<'tcx>, for_krate: CrateNum) -> &'tcx Reso
395395
tcx.arena.alloc(rl)
396396
}
397397

398-
fn krate<'tcx>(tcx: TyCtxt<'tcx>) -> NamedRegionMap {
398+
fn krate(tcx: TyCtxt<'_>) -> NamedRegionMap {
399399
let krate = tcx.hir().krate();
400400
let mut map = NamedRegionMap {
401401
defs: Default::default(),

src/librustc/middle/stability.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ impl<'tcx> Index<'tcx> {
466466

467467
/// Cross-references the feature names of unstable APIs with enabled
468468
/// features and possibly prints errors.
469-
fn check_mod_unstable_api_usage<'tcx>(tcx: TyCtxt<'tcx>, module_def_id: DefId) {
469+
fn check_mod_unstable_api_usage(tcx: TyCtxt<'_>, module_def_id: DefId) {
470470
tcx.hir().visit_item_likes_in_module(module_def_id, &mut Checker { tcx }.as_deep_visitor());
471471
}
472472

@@ -836,7 +836,7 @@ impl<'tcx> TyCtxt<'tcx> {
836836
/// Given the list of enabled features that were not language features (i.e., that
837837
/// were expected to be library features), and the list of features used from
838838
/// libraries, identify activated features that don't exist and error about them.
839-
pub fn check_unused_or_stable_features<'tcx>(tcx: TyCtxt<'tcx>) {
839+
pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
840840
let access_levels = &tcx.privacy_access_levels(LOCAL_CRATE);
841841

842842
if tcx.stability().staged_api[&LOCAL_CRATE] {
@@ -920,8 +920,8 @@ pub fn check_unused_or_stable_features<'tcx>(tcx: TyCtxt<'tcx>) {
920920
// don't lint about unused features. We should reenable this one day!
921921
}
922922

923-
fn unnecessary_stable_feature_lint<'tcx>(
924-
tcx: TyCtxt<'tcx>,
923+
fn unnecessary_stable_feature_lint(
924+
tcx: TyCtxt<'_>,
925925
span: Span,
926926
feature: Symbol,
927927
since: Symbol,

src/librustc/mir/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,19 +2867,19 @@ impl<'tcx> graph::WithStartNode for Body<'tcx> {
28672867
}
28682868

28692869
impl<'tcx> graph::WithPredecessors for Body<'tcx> {
2870-
fn predecessors<'graph>(
2871-
&'graph self,
2870+
fn predecessors(
2871+
&self,
28722872
node: Self::Node,
2873-
) -> <Self as GraphPredecessors<'graph>>::Iter {
2873+
) -> <Self as GraphPredecessors<'_>>::Iter {
28742874
self.predecessors_for(node).clone().into_iter()
28752875
}
28762876
}
28772877

28782878
impl<'tcx> graph::WithSuccessors for Body<'tcx> {
2879-
fn successors<'graph>(
2880-
&'graph self,
2879+
fn successors(
2880+
&self,
28812881
node: Self::Node,
2882-
) -> <Self as GraphSuccessors<'graph>>::Iter {
2882+
) -> <Self as GraphSuccessors<'_>>::Iter {
28832883
self.basic_blocks[node].terminator().successors().cloned()
28842884
}
28852885
}

src/librustc/session/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,11 @@ impl OutputTypes {
269269
self.0.contains_key(key)
270270
}
271271

272-
pub fn keys<'a>(&'a self) -> BTreeMapKeysIter<'a, OutputType, Option<PathBuf>> {
272+
pub fn keys(&self) -> BTreeMapKeysIter<'_, OutputType, Option<PathBuf>> {
273273
self.0.keys()
274274
}
275275

276-
pub fn values<'a>(&'a self) -> BTreeMapValuesIter<'a, OutputType, Option<PathBuf>> {
276+
pub fn values(&self) -> BTreeMapValuesIter<'_, OutputType, Option<PathBuf>> {
277277
self.0.values()
278278
}
279279

@@ -316,7 +316,7 @@ impl Externs {
316316
self.0.get(key)
317317
}
318318

319-
pub fn iter<'a>(&'a self) -> BTreeMapIter<'a, String, ExternEntry> {
319+
pub fn iter(&self) -> BTreeMapIter<'_, String, ExternEntry> {
320320
self.0.iter()
321321
}
322322
}

src/librustc/session/mod.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -215,66 +215,66 @@ impl Session {
215215
*self.crate_disambiguator.get()
216216
}
217217

218-
pub fn struct_span_warn<'a, S: Into<MultiSpan>>(
219-
&'a self,
218+
pub fn struct_span_warn<S: Into<MultiSpan>>(
219+
&self,
220220
sp: S,
221221
msg: &str,
222-
) -> DiagnosticBuilder<'a> {
222+
) -> DiagnosticBuilder<'_> {
223223
self.diagnostic().struct_span_warn(sp, msg)
224224
}
225-
pub fn struct_span_warn_with_code<'a, S: Into<MultiSpan>>(
226-
&'a self,
225+
pub fn struct_span_warn_with_code<S: Into<MultiSpan>>(
226+
&self,
227227
sp: S,
228228
msg: &str,
229229
code: DiagnosticId,
230-
) -> DiagnosticBuilder<'a> {
230+
) -> DiagnosticBuilder<'_> {
231231
self.diagnostic().struct_span_warn_with_code(sp, msg, code)
232232
}
233-
pub fn struct_warn<'a>(&'a self, msg: &str) -> DiagnosticBuilder<'a> {
233+
pub fn struct_warn(&self, msg: &str) -> DiagnosticBuilder<'_> {
234234
self.diagnostic().struct_warn(msg)
235235
}
236-
pub fn struct_span_err<'a, S: Into<MultiSpan>>(
237-
&'a self,
236+
pub fn struct_span_err<S: Into<MultiSpan>>(
237+
&self,
238238
sp: S,
239239
msg: &str,
240-
) -> DiagnosticBuilder<'a> {
240+
) -> DiagnosticBuilder<'_> {
241241
self.diagnostic().struct_span_err(sp, msg)
242242
}
243-
pub fn struct_span_err_with_code<'a, S: Into<MultiSpan>>(
244-
&'a self,
243+
pub fn struct_span_err_with_code<S: Into<MultiSpan>>(
244+
&self,
245245
sp: S,
246246
msg: &str,
247247
code: DiagnosticId,
248-
) -> DiagnosticBuilder<'a> {
248+
) -> DiagnosticBuilder<'_> {
249249
self.diagnostic().struct_span_err_with_code(sp, msg, code)
250250
}
251251
// FIXME: This method should be removed (every error should have an associated error code).
252-
pub fn struct_err<'a>(&'a self, msg: &str) -> DiagnosticBuilder<'a> {
252+
pub fn struct_err(&self, msg: &str) -> DiagnosticBuilder<'_> {
253253
self.diagnostic().struct_err(msg)
254254
}
255-
pub fn struct_err_with_code<'a>(
256-
&'a self,
255+
pub fn struct_err_with_code(
256+
&self,
257257
msg: &str,
258258
code: DiagnosticId,
259-
) -> DiagnosticBuilder<'a> {
259+
) -> DiagnosticBuilder<'_> {
260260
self.diagnostic().struct_err_with_code(msg, code)
261261
}
262-
pub fn struct_span_fatal<'a, S: Into<MultiSpan>>(
263-
&'a self,
262+
pub fn struct_span_fatal<S: Into<MultiSpan>>(
263+
&self,
264264
sp: S,
265265
msg: &str,
266-
) -> DiagnosticBuilder<'a> {
266+
) -> DiagnosticBuilder<'_> {
267267
self.diagnostic().struct_span_fatal(sp, msg)
268268
}
269-
pub fn struct_span_fatal_with_code<'a, S: Into<MultiSpan>>(
270-
&'a self,
269+
pub fn struct_span_fatal_with_code<S: Into<MultiSpan>>(
270+
&self,
271271
sp: S,
272272
msg: &str,
273273
code: DiagnosticId,
274-
) -> DiagnosticBuilder<'a> {
274+
) -> DiagnosticBuilder<'_> {
275275
self.diagnostic().struct_span_fatal_with_code(sp, msg, code)
276276
}
277-
pub fn struct_fatal<'a>(&'a self, msg: &str) -> DiagnosticBuilder<'a> {
277+
pub fn struct_fatal(&self, msg: &str) -> DiagnosticBuilder<'_> {
278278
self.diagnostic().struct_fatal(msg)
279279
}
280280

@@ -416,7 +416,7 @@ impl Session {
416416
pub fn next_node_id(&self) -> NodeId {
417417
self.reserve_node_ids(1)
418418
}
419-
pub fn diagnostic<'a>(&'a self) -> &'a errors::Handler {
419+
pub fn diagnostic(&self) -> &errors::Handler {
420420
&self.parse_sess.span_diagnostic
421421
}
422422

@@ -504,7 +504,7 @@ impl Session {
504504
);
505505
}
506506

507-
pub fn source_map<'a>(&'a self) -> &'a source_map::SourceMap {
507+
pub fn source_map(&self) -> &source_map::SourceMap {
508508
self.parse_sess.source_map()
509509
}
510510
pub fn verbose(&self) -> bool {

src/librustc/traits/specialize/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ pub fn find_associated_item<'tcx>(
145145
/// Specialization is determined by the sets of types to which the impls apply;
146146
/// `impl1` specializes `impl2` if it applies to a subset of the types `impl2` applies
147147
/// to.
148-
pub(super) fn specializes<'tcx>(
149-
tcx: TyCtxt<'tcx>,
148+
pub(super) fn specializes(
149+
tcx: TyCtxt<'_>,
150150
(impl1_def_id, impl2_def_id): (DefId, DefId),
151151
) -> bool {
152152
debug!("specializes({:?}, {:?})", impl1_def_id, impl2_def_id);
@@ -282,10 +282,10 @@ fn fulfill_implication<'a, 'tcx>(
282282
}
283283

284284
// Query provider for `specialization_graph_of`.
285-
pub(super) fn specialization_graph_provider<'tcx>(
286-
tcx: TyCtxt<'tcx>,
285+
pub(super) fn specialization_graph_provider(
286+
tcx: TyCtxt<'_>,
287287
trait_id: DefId,
288-
) -> &'tcx specialization_graph::Graph {
288+
) -> &specialization_graph::Graph {
289289
let mut sg = specialization_graph::Graph::new();
290290

291291
let mut trait_impls = tcx.all_impls(trait_id);

src/librustc/ty/query/on_disk_cache.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,9 @@ impl<'sess> OnDiskCache<'sess> {
306306
}
307307

308308
/// Loads a diagnostic emitted during the previous compilation session.
309-
pub fn load_diagnostics<'tcx>(
309+
pub fn load_diagnostics(
310310
&self,
311-
tcx: TyCtxt<'tcx>,
311+
tcx: TyCtxt<'_>,
312312
dep_node_index: SerializedDepNodeIndex,
313313
) -> Vec<Diagnostic> {
314314
let diagnostics: Option<EncodedDiagnostics> = self.load_indexed(
@@ -335,9 +335,9 @@ impl<'sess> OnDiskCache<'sess> {
335335

336336
/// Returns the cached query result if there is something in the cache for
337337
/// the given `SerializedDepNodeIndex`; otherwise returns `None`.
338-
pub fn try_load_query_result<'tcx, T>(
338+
pub fn try_load_query_result<T>(
339339
&self,
340-
tcx: TyCtxt<'tcx>,
340+
tcx: TyCtxt<'_>,
341341
dep_node_index: SerializedDepNodeIndex,
342342
) -> Option<T>
343343
where

src/librustc/ty/query/plumbing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,7 +1166,7 @@ macro_rules! define_provider_struct {
11661166
/// then `force_from_dep_node()` should not fail for it. Otherwise, you can just
11671167
/// add it to the "We don't have enough information to reconstruct..." group in
11681168
/// the match below.
1169-
pub fn force_from_dep_node<'tcx>(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> bool {
1169+
pub fn force_from_dep_node(tcx: TyCtxt<'_>, dep_node: &DepNode) -> bool {
11701170
use crate::dep_graph::RecoverKey;
11711171

11721172
// We must avoid ever having to call force_from_dep_node() for a

src/librustc_codegen_ssa/mir/analyze.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl CleanupKind {
273273
}
274274
}
275275

276-
pub fn cleanup_kinds<'tcx>(mir: &mir::Body<'tcx>) -> IndexVec<mir::BasicBlock, CleanupKind> {
276+
pub fn cleanup_kinds(mir: &mir::Body<'_>) -> IndexVec<mir::BasicBlock, CleanupKind> {
277277
fn discover_masters<'tcx>(result: &mut IndexVec<mir::BasicBlock, CleanupKind>,
278278
mir: &mir::Body<'tcx>) {
279279
for (bb, data) in mir.basic_blocks().iter_enumerated() {

0 commit comments

Comments
 (0)