Skip to content

Commit 774724b

Browse files
committed
rustc: deny(unused_lifetimes).
1 parent ce0ba38 commit 774724b

File tree

24 files changed

+46
-39
lines changed

24 files changed

+46
-39
lines changed

src/librustc/hir/map/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ struct HirItemLike<T> {
589589
hash_bodies: bool,
590590
}
591591

592-
impl<'a, 'hir, T> HashStable<StableHashingContext<'hir>> for HirItemLike<T>
592+
impl<'hir, T> HashStable<StableHashingContext<'hir>> for HirItemLike<T>
593593
where T: HashStable<StableHashingContext<'hir>>
594594
{
595595
fn hash_stable<W: StableHasherResult>(&self,

src/librustc/ich/hcx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for DelimSpan {
393393
}
394394
}
395395

396-
pub fn hash_stable_trait_impls<'a, 'gcx, W>(
396+
pub fn hash_stable_trait_impls<'a, W>(
397397
hcx: &mut StableHashingContext<'a>,
398398
hasher: &mut StableHasher<W>,
399399
blanket_impls: &[DefId],

src/librustc/ich/impls_ty.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<'gcx> HashStable<StableHashingContext<'gcx>> for ty::BoundVar {
135135
}
136136
}
137137

138-
impl<'a, 'gcx, T> HashStable<StableHashingContext<'a>> for ty::Binder<T>
138+
impl<'a, T> HashStable<StableHashingContext<'a>> for ty::Binder<T>
139139
where T: HashStable<StableHashingContext<'a>>
140140
{
141141
fn hash_stable<W: StableHasherResult>(&self,
@@ -192,7 +192,7 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for region::Scope {
192192
}
193193
}
194194

195-
impl<'a, 'gcx> HashStable<StableHashingContext<'a>>
195+
impl<'a> HashStable<StableHashingContext<'a>>
196196
for ty::TyVid
197197
{
198198
fn hash_stable<W: StableHasherResult>(&self,
@@ -204,7 +204,7 @@ for ty::TyVid
204204
}
205205
}
206206

207-
impl<'a, 'gcx> HashStable<StableHashingContext<'a>>
207+
impl<'a> HashStable<StableHashingContext<'a>>
208208
for ty::IntVid
209209
{
210210
fn hash_stable<W: StableHasherResult>(&self,
@@ -216,7 +216,7 @@ for ty::IntVid
216216
}
217217
}
218218

219-
impl<'a, 'gcx> HashStable<StableHashingContext<'a>>
219+
impl<'a> HashStable<StableHashingContext<'a>>
220220
for ty::FloatVid
221221
{
222222
fn hash_stable<W: StableHasherResult>(&self,
@@ -228,7 +228,7 @@ for ty::FloatVid
228228
}
229229
}
230230

231-
impl<'a, 'gcx, T> HashStable<StableHashingContext<'a>>
231+
impl<'a, T> HashStable<StableHashingContext<'a>>
232232
for ty::steal::Steal<T>
233233
where T: HashStable<StableHashingContext<'a>>
234234
{

src/librustc/infer/region_constraints/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ impl<'a, 'gcx, 'tcx> GenericKind<'tcx> {
858858
}
859859
}
860860

861-
impl<'a, 'gcx, 'tcx> VerifyBound<'tcx> {
861+
impl<'tcx> VerifyBound<'tcx> {
862862
pub fn must_hold(&self) -> bool {
863863
match self {
864864
VerifyBound::IfEq(..) => false,

src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#![deny(rust_2018_idioms)]
3232
#![deny(internal)]
33+
#![deny(unused_lifetimes)]
3334
#![allow(explicit_outlives_requirements)]
3435

3536
#![feature(arbitrary_self_types)]

src/librustc/lint/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ impl LintPassObject for EarlyLintPassObject {}
566566

567567
impl LintPassObject for LateLintPassObject {}
568568

569-
pub trait LintContext<'tcx>: Sized {
569+
pub trait LintContext: Sized {
570570
type PassObject: LintPassObject;
571571

572572
fn sess(&self) -> &Session;
@@ -700,7 +700,7 @@ impl<'a, T: EarlyLintPass> EarlyContextAndPass<'a, T> {
700700
}
701701
}
702702

703-
impl<'a, 'tcx> LintContext<'tcx> for LateContext<'a, 'tcx> {
703+
impl LintContext for LateContext<'_, '_> {
704704
type PassObject = LateLintPassObject;
705705

706706
/// Gets the overall compiler `Session` object.
@@ -728,7 +728,7 @@ impl<'a, 'tcx> LintContext<'tcx> for LateContext<'a, 'tcx> {
728728
}
729729
}
730730

731-
impl<'a> LintContext<'a> for EarlyContext<'a> {
731+
impl LintContext for EarlyContext<'_> {
732732
type PassObject = EarlyLintPassObject;
733733

734734
/// Gets the overall compiler `Session` object.

src/librustc/macros.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ macro_rules! impl_stable_hash_for {
8080
// We want to use the enum name both in the `impl ... for $enum_name` as well as for
8181
// importing all the variants. Unfortunately it seems we have to take the name
8282
// twice for this purpose
83-
(impl<$($lt:lifetime $(: $lt_bound:lifetime)? ),* $(,)? $($T:ident),* $(,)?>
83+
(impl<$($T:ident),* $(,)?>
8484
for enum $enum_name:path
8585
[ $enum_path:path ]
8686
{
@@ -91,7 +91,7 @@ macro_rules! impl_stable_hash_for {
9191
$( { $($named_field:ident $(-> $named_delegate:tt)?),* } )?
9292
),* $(,)?
9393
}) => {
94-
impl<'a, $($lt $(: $lt_bound)?,)* $($T,)*>
94+
impl<$($T,)*>
9595
::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>
9696
for $enum_name
9797
where $($T: ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>),*
@@ -117,13 +117,13 @@ macro_rules! impl_stable_hash_for {
117117
// Structs
118118
(struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
119119
impl_stable_hash_for!(
120-
impl<'tcx> for struct $struct_name { $($field $(-> $delegate)?),* }
120+
impl<> for struct $struct_name { $($field $(-> $delegate)?),* }
121121
);
122122
};
123-
(impl<$($lt:lifetime $(: $lt_bound:lifetime)? ),* $(,)? $($T:ident),* $(,)?> for struct $struct_name:path {
123+
(impl<$($T:ident),* $(,)?> for struct $struct_name:path {
124124
$($field:ident $(-> $delegate:tt)?),* $(,)?
125125
}) => {
126-
impl<'a, $($lt $(: $lt_bound)?,)* $($T,)*>
126+
impl<$($T,)*>
127127
::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $struct_name
128128
where $($T: ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>),*
129129
{
@@ -143,12 +143,12 @@ macro_rules! impl_stable_hash_for {
143143
// We cannot use normal parentheses here, the parser won't allow it
144144
(tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
145145
impl_stable_hash_for!(
146-
impl<'tcx> for tuple_struct $struct_name { $($field $(-> $delegate)?),* }
146+
impl<> for tuple_struct $struct_name { $($field $(-> $delegate)?),* }
147147
);
148148
};
149-
(impl<$($lt:lifetime $(: $lt_bound:lifetime)? ),* $(,)? $($T:ident),* $(,)?>
149+
(impl<$($T:ident),* $(,)?>
150150
for tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
151-
impl<'a, $($lt $(: $lt_bound)?,)* $($T,)*>
151+
impl<$($T,)*>
152152
::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $struct_name
153153
where $($T: ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>>),*
154154
{
@@ -170,7 +170,7 @@ macro_rules! impl_stable_hash_for {
170170
macro_rules! impl_stable_hash_for_spanned {
171171
($T:path) => (
172172

173-
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ::syntax::source_map::Spanned<$T>
173+
impl HashStable<StableHashingContext<'a>> for ::syntax::source_map::Spanned<$T>
174174
{
175175
#[inline]
176176
fn hash_stable<W: StableHasherResult>(&self,

src/librustc/mir/interpret/pointer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl From<AllocId> for Pointer {
105105
}
106106
}
107107

108-
impl<'tcx> Pointer<()> {
108+
impl Pointer<()> {
109109
#[inline(always)]
110110
pub fn new(alloc_id: AllocId, offset: Size) -> Self {
111111
Pointer { alloc_id, offset, tag: () }

src/librustc/mir/interpret/value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ impl<Tag> From<Double> for Scalar<Tag> {
146146
}
147147
}
148148

149-
impl<'tcx> Scalar<()> {
149+
impl Scalar<()> {
150150
#[inline(always)]
151151
fn check_data(data: u128, size: u8) {
152152
debug_assert_eq!(truncate(data, Size::from_bytes(size as u64)), data,

src/librustc/mir/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ pub enum PlaceContext {
967967
NonUse(NonUseContext),
968968
}
969969

970-
impl<'tcx> PlaceContext {
970+
impl PlaceContext {
971971
/// Returns `true` if this place context represents a drop.
972972
pub fn is_drop(&self) -> bool {
973973
match *self {

0 commit comments

Comments
 (0)