Skip to content

Commit 2441253

Browse files
committed
Fix fallout from deny(unused_lifetimes).
1 parent 37799a5 commit 2441253

File tree

167 files changed

+583
-586
lines changed

Some content is hidden

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

167 files changed

+583
-586
lines changed

src/librustc/cfg/construct.rs

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

src/librustc/cfg/mod.rs

+1-1
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<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
52+
pub fn new<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
5353
body: &hir::Body) -> CFG {
5454
construct::construct(tcx, body)
5555
}

src/librustc/dep_graph/graph.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ impl DepGraph {
842842
//
843843
// This method will only load queries that will end up in the disk cache.
844844
// Other queries will not be executed.
845-
pub fn exec_cache_promotions<'a, 'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
845+
pub fn exec_cache_promotions<'tcx>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
846846
let green_nodes: Vec<DepNode> = {
847847
let data = self.data.as_ref().unwrap();
848848
data.colors.values.indices().filter_map(|prev_index| {

src/librustc/dep_graph/safe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl DepGraphSafe for DefId {
3333

3434
/// The type context itself can be used to access all kinds of tracked
3535
/// state, but those accesses should always generate read events.
36-
impl<'a, 'gcx, 'tcx> DepGraphSafe for TyCtxt<'tcx, 'gcx, 'tcx> {
36+
impl<'gcx, 'tcx> DepGraphSafe for TyCtxt<'tcx, 'gcx, 'tcx> {
3737
}
3838

3939
/// Tuples make it easy to build up state.

src/librustc/infer/canonical/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ impl<'tcx> CanonicalVarValues<'tcx> {
478478
/// `self.var_values == [Type(u32), Lifetime('a), Type(u64)]`
479479
/// we'll return a substitution `subst` with:
480480
/// `subst.var_values == [Type(^0), Lifetime(^1), Type(^2)]`.
481-
pub fn make_identity<'a>(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Self {
481+
pub fn make_identity(&self, tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Self {
482482
use crate::ty::subst::UnpackedKind;
483483

484484
CanonicalVarValues {

src/librustc/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ mod need_type_info;
6767

6868
pub mod nice_region_error;
6969

70-
impl<'a, 'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
70+
impl<'gcx, 'tcx> TyCtxt<'tcx, 'gcx, 'tcx> {
7171
pub fn note_and_explain_region(
7272
self,
7373
region_scope_tree: &region::ScopeTree,

src/librustc/infer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for ShallowResolver<'a, 'gcx, 'tcx>
16241624
}
16251625
}
16261626

1627-
impl<'a, 'gcx, 'tcx> TypeTrace<'tcx> {
1627+
impl<'gcx, 'tcx> TypeTrace<'tcx> {
16281628
pub fn span(&self) -> Span {
16291629
self.cause.span
16301630
}

src/librustc/infer/outlives/free_region_map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl<'tcx> FreeRegionMap<'tcx> {
2828
/// cases, this is more conservative than necessary, in order to
2929
/// avoid making arbitrary choices. See
3030
/// `TransitiveRelation::postdom_upper_bound` for more details.
31-
pub fn lub_free_regions<'a, 'gcx>(&self,
31+
pub fn lub_free_regions<'gcx>(&self,
3232
tcx: TyCtxt<'tcx, 'gcx, 'tcx>,
3333
r_a: Region<'tcx>,
3434
r_b: Region<'tcx>)
@@ -90,7 +90,7 @@ impl_stable_hash_for!(struct FreeRegionMap<'tcx> {
9090

9191
impl<'a, 'tcx> Lift<'tcx> for FreeRegionMap<'a> {
9292
type Lifted = FreeRegionMap<'tcx>;
93-
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<FreeRegionMap<'tcx>> {
93+
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<FreeRegionMap<'tcx>> {
9494
self.relation.maybe_map(|&fr| tcx.lift(&fr))
9595
.map(|relation| FreeRegionMap { relation })
9696
}

src/librustc/infer/region_constraints/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ impl<'tcx> fmt::Display for GenericKind<'tcx> {
849849
}
850850
}
851851

852-
impl<'a, 'gcx, 'tcx> GenericKind<'tcx> {
852+
impl<'gcx, 'tcx> GenericKind<'tcx> {
853853
pub fn to_ty(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
854854
match *self {
855855
GenericKind::Param(ref p) => p.to_ty(tcx),

src/librustc/infer/unify_key.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::marker::PhantomData;
1010
use std::cell::RefMut;
1111

1212
pub trait ToType {
13-
fn to_type<'a, 'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx>;
13+
fn to_type<'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx>;
1414
}
1515

1616
impl UnifyKey for ty::IntVid {
@@ -52,7 +52,7 @@ impl UnifyKey for ty::RegionVid {
5252
}
5353

5454
impl ToType for IntVarValue {
55-
fn to_type<'a, 'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
55+
fn to_type<'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
5656
match *self {
5757
ty::IntType(i) => tcx.mk_mach_int(i),
5858
ty::UintType(i) => tcx.mk_mach_uint(i),
@@ -72,7 +72,7 @@ impl UnifyKey for ty::FloatVid {
7272
impl EqUnifyValue for FloatVarValue {}
7373

7474
impl ToType for FloatVarValue {
75-
fn to_type<'a, 'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
75+
fn to_type<'gcx, 'tcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Ty<'tcx> {
7676
tcx.mk_mach_float(self.0)
7777
}
7878
}

src/librustc/lint/mod.rs

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

769-
fn lint_levels<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, cnum: CrateNum)
769+
fn lint_levels<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, cnum: CrateNum)
770770
-> &'tcx LintLevelMap
771771
{
772772
assert_eq!(cnum, LOCAL_CRATE);

src/librustc/macros.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ macro_rules! BraceStructLiftImpl {
264264
{
265265
type Lifted = $lifted;
266266

267-
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<$lifted> {
267+
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<$lifted> {
268268
$(let $field = tcx.lift(&self.$field)?;)*
269269
Some(Self::Lifted { $($field),* })
270270
}
@@ -283,7 +283,7 @@ macro_rules! EnumLiftImpl {
283283
{
284284
type Lifted = $lifted;
285285

286-
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<$lifted> {
286+
fn lift_to_tcx<'gcx>(&self, tcx: TyCtxt<'tcx, 'gcx, 'tcx>) -> Option<$lifted> {
287287
EnumLiftImpl!(@Variants(self, tcx) input($($variants)*) output())
288288
}
289289
}

src/librustc/middle/cstore.rs

+1-1
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<'a, 'tcx>(&self,
214+
fn encode_metadata<'tcx>(&self,
215215
tcx: TyCtxt<'tcx, 'tcx, 'tcx>)
216216
-> EncodedMetadata;
217217
fn metadata_encoding_version(&self) -> &[u8];

src/librustc/middle/dead.rs

+4-4
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<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
29+
fn should_explore<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
3030
hir_id: hir::HirId) -> bool {
3131
match tcx.hir().find_by_hir_id(hir_id) {
3232
Some(Node::Item(..)) |
@@ -423,7 +423,7 @@ impl<'v, 'k, 'tcx> ItemLikeVisitor<'v> for LifeSeeder<'k, 'tcx> {
423423
}
424424
}
425425

426-
fn create_and_seed_worklist<'a, 'tcx>(
426+
fn create_and_seed_worklist<'tcx>(
427427
tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
428428
access_levels: &privacy::AccessLevels,
429429
krate: &hir::Crate,
@@ -451,7 +451,7 @@ fn create_and_seed_worklist<'a, 'tcx>(
451451
(life_seeder.worklist, life_seeder.struct_constructors)
452452
}
453453

454-
fn find_live<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
454+
fn find_live<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
455455
access_levels: &privacy::AccessLevels,
456456
krate: &hir::Crate)
457457
-> FxHashSet<hir::HirId> {
@@ -660,7 +660,7 @@ impl Visitor<'tcx> for DeadVisitor<'tcx> {
660660
}
661661
}
662662

663-
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
663+
pub fn check_crate<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
664664
let access_levels = &tcx.privacy_access_levels(LOCAL_CRATE);
665665
let krate = tcx.hir().krate();
666666
let live_symbols = find_live(tcx, access_levels, krate);

src/librustc/middle/dependency_format.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub enum Linkage {
8181
Dynamic,
8282
}
8383

84-
pub fn calculate<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
84+
pub fn calculate<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
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<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) {
9292
sess.dependency_formats.set(fmts);
9393
}
9494

95-
fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
95+
fn calculate_type<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
9696
ty: config::CrateType) -> DependencyList {
9797

9898
let sess = &tcx.sess;
@@ -267,7 +267,7 @@ fn add_library(tcx: TyCtxt<'_, '_, '_>,
267267
}
268268
}
269269

270-
fn attempt_static<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> Option<DependencyList> {
270+
fn attempt_static<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> 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<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, list: &[Linkage]) {
327+
fn verify_ok<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>, list: &[Linkage]) {
328328
let sess = &tcx.sess;
329329
if list.len() == 0 {
330330
return

src/librustc/middle/intrinsicck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct ExprVisitor<'tcx> {
3636

3737
/// If the type is `Option<T>`, it will return `T`, otherwise
3838
/// the type itself. Works on most `Option`-like types.
39-
fn unpack_option_like<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
39+
fn unpack_option_like<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
4040
ty: Ty<'tcx>)
4141
-> Ty<'tcx> {
4242
let (def, substs) = match ty.sty {

src/librustc/middle/lang_items.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<(Symbol, Span)> {
217217
}
218218

219219
/// Traverse and collect all the lang items in all crates.
220-
pub fn collect<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> LanguageItems {
220+
pub fn collect<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> LanguageItems {
221221
// Initialize the collector.
222222
let mut collector = LanguageItemCollector::new(tcx);
223223

@@ -402,7 +402,7 @@ language_item_table! {
402402
Rc, "rc", rc, Target::Struct;
403403
}
404404

405-
impl<'a, 'tcx, 'gcx> TyCtxt<'gcx, 'tcx, 'gcx> {
405+
impl<'tcx, 'gcx> TyCtxt<'gcx, 'tcx, 'gcx> {
406406
/// Returns the `DefId` for a given `LangItem`.
407407
/// If not found, fatally abort compilation.
408408
pub fn require_lang_item(&self, lang_item: LangItem) -> DefId {

src/librustc/middle/lib_features.rs

+1-1
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<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> LibFeatures {
145+
pub fn collect<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>) -> 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

+5-5
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt<'_, '_, '_>) -> Strin
166166
}
167167
}
168168

169-
impl<'a, 'tcx> Visitor<'tcx> for IrMaps<'tcx> {
169+
impl<'tcx> Visitor<'tcx> for IrMaps<'tcx> {
170170
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
171171
NestedVisitorMap::OnlyBodies(&self.tcx.hir())
172172
}
@@ -411,7 +411,7 @@ fn visit_fn<'a, 'tcx: 'a>(ir: &mut IrMaps<'tcx>,
411411
lsets.warn_about_unused_args(body, entry_ln);
412412
}
413413

414-
fn add_from_pat<'a, 'tcx>(ir: &mut IrMaps<'tcx>, pat: &P<hir::Pat>) {
414+
fn add_from_pat<'tcx>(ir: &mut IrMaps<'tcx>, pat: &P<hir::Pat>) {
415415
// For struct patterns, take note of which fields used shorthand
416416
// (`x` rather than `x: x`).
417417
let mut shorthand_field_ids = HirIdSet::default();
@@ -457,19 +457,19 @@ fn add_from_pat<'a, 'tcx>(ir: &mut IrMaps<'tcx>, pat: &P<hir::Pat>) {
457457
});
458458
}
459459

460-
fn visit_local<'a, 'tcx>(ir: &mut IrMaps<'tcx>, local: &'tcx hir::Local) {
460+
fn visit_local<'tcx>(ir: &mut IrMaps<'tcx>, local: &'tcx hir::Local) {
461461
add_from_pat(ir, &local.pat);
462462
intravisit::walk_local(ir, local);
463463
}
464464

465-
fn visit_arm<'a, 'tcx>(ir: &mut IrMaps<'tcx>, arm: &'tcx hir::Arm) {
465+
fn visit_arm<'tcx>(ir: &mut IrMaps<'tcx>, arm: &'tcx hir::Arm) {
466466
for pat in &arm.pats {
467467
add_from_pat(ir, pat);
468468
}
469469
intravisit::walk_arm(ir, arm);
470470
}
471471

472-
fn visit_expr<'a, 'tcx>(ir: &mut IrMaps<'tcx>, expr: &'tcx Expr) {
472+
fn visit_expr<'tcx>(ir: &mut IrMaps<'tcx>, expr: &'tcx Expr) {
473473
match expr.node {
474474
// live nodes required for uses or definitions of variables:
475475
hir::ExprKind::Path(hir::QPath::Resolved(_, ref path)) => {

src/librustc/middle/reachable.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn item_might_be_inlined(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
4444
}
4545
}
4646

47-
fn method_might_be_inlined<'a, 'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
47+
fn method_might_be_inlined<'tcx>(tcx: TyCtxt<'tcx, 'tcx, 'tcx>,
4848
impl_item: &hir::ImplItem,
4949
impl_src: DefId) -> bool {
5050
let codegen_fn_attrs = tcx.codegen_fn_attrs(impl_item.hir_id.owner_def_id());
@@ -391,7 +391,7 @@ impl<'a, 'tcx: 'a> ItemLikeVisitor<'tcx> for CollectPrivateImplItemsVisitor<'a,
391391
#[derive(Clone, HashStable)]
392392
pub struct ReachableSet(pub Lrc<HirIdSet>);
393393

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

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

0 commit comments

Comments
 (0)