Skip to content

Commit b9f26dc

Browse files
authored
Rollup merge of #69809 - matthiaskrgr:lifetimes, r=eddyb
remove lifetimes that can be elided (clippy::needless_lifetimes)
2 parents 1185d8b + 7b1b08c commit b9f26dc

File tree

32 files changed

+50
-50
lines changed

32 files changed

+50
-50
lines changed

src/liballoc/collections/linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ impl<'a, T> CursorMut<'a, T> {
14271427
/// `CursorMut`, which means it cannot outlive the `CursorMut` and that the
14281428
/// `CursorMut` is frozen for the lifetime of the `Cursor`.
14291429
#[unstable(feature = "linked_list_cursors", issue = "58533")]
1430-
pub fn as_cursor<'cm>(&'cm self) -> Cursor<'cm, T> {
1430+
pub fn as_cursor(&self) -> Cursor<'_, T> {
14311431
Cursor { list: self.list, current: self.current, index: self.index }
14321432
}
14331433
}

src/librustc/dep_graph/dep_node.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ macro_rules! define_dep_nodes {
179179
$(
180180
#[inline(always)]
181181
#[allow(unreachable_code, non_snake_case)]
182-
pub fn $variant<'tcx>(_tcx: TyCtxt<'tcx>, $(arg: $tuple_arg_ty)*) -> DepNode {
182+
pub fn $variant(_tcx: TyCtxt<'_>, $(arg: $tuple_arg_ty)*) -> DepNode {
183183
// tuple args
184184
$({
185185
erase!($tuple_arg_ty);

src/librustc/hir/map/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
340340
/// deep walking so that we walk nested items in the context of
341341
/// their outer items.
342342
343-
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, Self::Map> {
343+
fn nested_visit_map(&mut self) -> NestedVisitorMap<'_, Self::Map> {
344344
panic!("`visit_nested_xxx` must be manually implemented in this visitor");
345345
}
346346

src/librustc/hir/map/hir_id_validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<'a, 'hir> HirIdValidator<'a, 'hir> {
135135
impl<'a, 'hir> intravisit::Visitor<'hir> for HirIdValidator<'a, 'hir> {
136136
type Map = Map<'hir>;
137137

138-
fn nested_visit_map<'this>(&'this mut self) -> intravisit::NestedVisitorMap<'this, Self::Map> {
138+
fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<'_, Self::Map> {
139139
intravisit::NestedVisitorMap::OnlyBodies(self.hir_map)
140140
}
141141

src/librustc/mir/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ pub enum ClearCrossCrate<T> {
403403
}
404404

405405
impl<T> ClearCrossCrate<T> {
406-
pub fn as_ref(&'a self) -> ClearCrossCrate<&'a T> {
406+
pub fn as_ref(&self) -> ClearCrossCrate<&T> {
407407
match self {
408408
ClearCrossCrate::Clear => ClearCrossCrate::Clear,
409409
ClearCrossCrate::Set(v) => ClearCrossCrate::Set(v),
@@ -2503,7 +2503,7 @@ impl UserTypeProjection {
25032503

25042504
pub(crate) fn variant(
25052505
mut self,
2506-
adt_def: &'tcx AdtDef,
2506+
adt_def: &AdtDef,
25072507
variant_index: VariantIdx,
25082508
field: Field,
25092509
) -> Self {

src/librustc_codegen_llvm/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ impl ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
320320
}
321321
}
322322

323-
pub fn val_ty(v: &'ll Value) -> &'ll Type {
323+
pub fn val_ty(v: &Value) -> &Type {
324324
unsafe { llvm::LLVMTypeOf(v) }
325325
}
326326

@@ -342,6 +342,6 @@ fn hi_lo_to_u128(lo: u64, hi: u64) -> u128 {
342342
((hi as u128) << 64) | (lo as u128)
343343
}
344344

345-
fn try_as_const_integral(v: &'ll Value) -> Option<&'ll ConstantInt> {
345+
fn try_as_const_integral(v: &Value) -> Option<&ConstantInt> {
346346
unsafe { llvm::LLVMIsAConstantInt(v) }
347347
}

src/librustc_codegen_llvm/llvm/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,12 @@ impl Drop for SectionIter<'a> {
185185
}
186186
}
187187

188-
pub fn mk_section_iter(llof: &'a ffi::ObjectFile) -> SectionIter<'a> {
188+
pub fn mk_section_iter(llof: &ffi::ObjectFile) -> SectionIter<'_> {
189189
unsafe { SectionIter { llsi: LLVMGetSections(llof) } }
190190
}
191191

192192
/// Safe wrapper around `LLVMGetParam`, because segfaults are no fun.
193-
pub fn get_param(llfn: &'a Value, index: c_uint) -> &'a Value {
193+
pub fn get_param(llfn: &Value, index: c_uint) -> &Value {
194194
unsafe {
195195
assert!(
196196
index < LLVMCountParams(llfn),
@@ -203,7 +203,7 @@ pub fn get_param(llfn: &'a Value, index: c_uint) -> &'a Value {
203203
}
204204

205205
/// Safe wrapper for `LLVMGetValueName2` into a byte slice
206-
pub fn get_value_name(value: &'a Value) -> &'a [u8] {
206+
pub fn get_value_name(value: &Value) -> &[u8] {
207207
unsafe {
208208
let mut len = 0;
209209
let data = LLVMGetValueName2(value, &mut len);

src/librustc_codegen_llvm/type_.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl Type {
240240
unsafe { llvm::LLVMIntTypeInContext(llcx, num_bits as c_uint) }
241241
}
242242

243-
pub fn i8p_llcx(llcx: &'ll llvm::Context) -> &'ll Type {
243+
pub fn i8p_llcx(llcx: &llvm::Context) -> &Type {
244244
Type::i8_llcx(llcx).ptr_to()
245245
}
246246

src/librustc_data_structures/graph/scc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<N: Idx, S: Idx> GraphSuccessors<'graph> for Sccs<N, S> {
9797
}
9898

9999
impl<N: Idx, S: Idx> WithSuccessors for Sccs<N, S> {
100-
fn successors<'graph>(&'graph self, node: S) -> <Self as GraphSuccessors<'graph>>::Iter {
100+
fn successors(&self, node: S) -> <Self as GraphSuccessors<'_>>::Iter {
101101
self.successors(node).iter().cloned()
102102
}
103103
}

src/librustc_data_structures/graph/vec_graph/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<N: Idx> GraphSuccessors<'graph> for VecGraph<N> {
101101
}
102102

103103
impl<N: Idx> WithSuccessors for VecGraph<N> {
104-
fn successors<'graph>(&'graph self, node: N) -> <Self as GraphSuccessors<'graph>>::Iter {
104+
fn successors(&self, node: N) -> <Self as GraphSuccessors<'_>>::Iter {
105105
self.successors(node).iter().cloned()
106106
}
107107
}

0 commit comments

Comments
 (0)