Skip to content

Commit 88b595d

Browse files
lf-facebook-github-bot
authored andcommitted
fix: a lot of instances of clippy::needless_lifetimes
Summary: This doesn't get all of them because: 1. there are so many of them 2. the lint is pretty jank Part of facebook/buck2#943 X-link: facebook/buck2#944 Reviewed By: JakobDegen Differential Revision: D74271655 Pulled By: dtolnay fbshipit-source-id: c7e41c47248d4be1f5d33a14b676ab35fc5180e2
1 parent 8decd37 commit 88b595d

File tree

19 files changed

+52
-52
lines changed

19 files changed

+52
-52
lines changed

allocative/allocative/src/flamegraph.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ struct TreeRef<'a> {
137137
tree_id: TreeId,
138138
}
139139

140-
impl<'a> TreeRef<'a> {
140+
impl TreeRef<'_> {
141141
fn write_flame_graph(&self, stack: &[&str], warnings: &mut String) -> FlameGraph {
142142
let mut flame_graph = FlameGraph::default();
143143
let tree = &self.trees[self.tree_id];
@@ -240,7 +240,7 @@ struct TreeStackRef<'t, 's> {
240240
stack: &'s mut TreeStack,
241241
}
242242

243-
impl<'t, 's> TreeStackRef<'t, 's> {
243+
impl<'t> TreeStackRef<'t, '_> {
244244
fn current_data(&'t mut self) -> &'t mut TreeData {
245245
&mut self.trees[self.stack.tree]
246246
}

allocative/allocative/src/visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub struct Visitor<'a> {
6161
pub(crate) node_kind: NodeKind,
6262
}
6363

64-
impl<'a> Drop for Visitor<'a> {
64+
impl Drop for Visitor<'_> {
6565
fn drop(&mut self) {
6666
self.exit_impl();
6767
}

gazebo/cmp_any/src/ord.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'a> PartialEq for OrdAny<'a> {
5151
}
5252
}
5353

54-
impl<'a> Eq for OrdAny<'a> {}
54+
impl Eq for OrdAny<'_> {}
5555

5656
impl<'a> PartialOrd for OrdAny<'a> {
5757
#[inline]
@@ -61,7 +61,7 @@ impl<'a> PartialOrd for OrdAny<'a> {
6161
}
6262

6363
/// Compare by type id first, then by value.
64-
impl<'a> Ord for OrdAny<'a> {
64+
impl Ord for OrdAny<'_> {
6565
#[inline]
6666
fn cmp(&self, other: &Self) -> Ordering {
6767
let type_cmp = self.type_id.cmp(&other.type_id);

gazebo/display_container/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pub fn display_pair<'a, K: Display + 'a, V: Display + 'a>(
9797

9898
struct DisplayPair<'a, K: Display, V: Display>(pub K, pub &'a str, pub V);
9999

100-
impl<'a, K: Display, V: Display> Display for DisplayPair<'a, K, V> {
100+
impl<K: Display, V: Display> Display for DisplayPair<'_, K, V> {
101101
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
102102
Display::fmt(&self.0, f)?;
103103
f.write_str(self.1)?;
@@ -210,7 +210,7 @@ where
210210
suffix: &'a str,
211211
items: C,
212212
}
213-
impl<'a, C> Display for Impl<'a, C>
213+
impl<C> Display for Impl<'_, C>
214214
where
215215
C: Copy + IntoIterator,
216216
<C as IntoIterator>::Item: Display,

gazebo/dupe/src/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub trait OptionDupedExt {
2828
Self::Item: Dupe;
2929
}
3030

31-
impl<'a, T> OptionDupedExt for Option<&'a T> {
31+
impl<T> OptionDupedExt for Option<&T> {
3232
type Item = T;
3333

3434
fn duped(self) -> Option<T>

gazebo/gazebo/src/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub unsafe fn ptr_mut<From, To>(x: &mut From) -> &mut To {
4545
}
4646

4747
#[inline(always)]
48-
pub unsafe fn ptr_lifetime<'a, 'b, T: ?Sized>(x: &'a T) -> &'b T {
48+
pub unsafe fn ptr_lifetime<'b, T: ?Sized>(x: &T) -> &'b T {
4949
unsafe { &*(x as *const T) }
5050
}
5151

starlark_derive/src/freeze.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ struct Input<'a> {
3535
input: &'a DeriveInput,
3636
}
3737

38-
impl<'a> Input<'a> {
38+
impl Input<'_> {
3939
fn angle_brankets(&self, tokens: &[TokenStream]) -> TokenStream {
4040
let span = self.input.span();
4141
if tokens.is_empty() {

starlark_derive/src/starlark_value.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ impl ImplStarlarkValue {
433433
lifetime: &'a syn::Lifetime,
434434
}
435435

436-
impl<'a> syn::visit_mut::VisitMut for PatchTypesVisitor<'a> {
436+
impl syn::visit_mut::VisitMut for PatchTypesVisitor<'_> {
437437
fn visit_type_mut(&mut self, i: &mut syn::Type) {
438438
let lifetime = self.lifetime;
439439
*i = syn::parse_quote_spanned! { i.span() =>

starlark_derive/src/util.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub(crate) struct FieldsUtil<'a> {
3434
pub(crate) fields: &'a Fields,
3535
}
3636

37-
impl<'a> Deref for FieldsUtil<'a> {
37+
impl Deref for FieldsUtil<'_> {
3838
type Target = Fields;
3939

4040
fn deref(&self) -> &Self::Target {
@@ -75,7 +75,7 @@ pub(crate) struct DataStructUtil<'a> {
7575
pub(crate) data: &'a DataStruct,
7676
}
7777

78-
impl<'a> Deref for DataStructUtil<'a> {
78+
impl Deref for DataStructUtil<'_> {
7979
type Target = DataStruct;
8080

8181
fn deref(&self) -> &Self::Target {
@@ -171,7 +171,7 @@ pub(crate) struct VariantUtil<'a> {
171171
pub(crate) enum_util: DataEnumUtil<'a>,
172172
}
173173

174-
impl<'a> Deref for VariantUtil<'a> {
174+
impl Deref for VariantUtil<'_> {
175175
type Target = syn::Variant;
176176

177177
fn deref(&self) -> &Self::Target {
@@ -244,7 +244,7 @@ pub(crate) struct DataEnumUtil<'a> {
244244
pub(crate) data: &'a DataEnum,
245245
}
246246

247-
impl<'a> Deref for DataEnumUtil<'a> {
247+
impl Deref for DataEnumUtil<'_> {
248248
type Target = DataEnum;
249249

250250
fn deref(&self) -> &Self::Target {
@@ -289,7 +289,7 @@ pub(crate) enum StructOrEnumVariant<'a> {
289289
EnumVariant(VariantUtil<'a>),
290290
}
291291

292-
impl<'a> StructOrEnumVariant<'a> {
292+
impl StructOrEnumVariant<'_> {
293293
pub(crate) fn span(self) -> Span {
294294
match self {
295295
StructOrEnumVariant::Struct(data) => data.span(),
@@ -311,7 +311,7 @@ pub(crate) enum DeriveInputUtil<'a> {
311311
Enum(DataEnumUtil<'a>),
312312
}
313313

314-
impl<'a> Deref for DeriveInputUtil<'a> {
314+
impl Deref for DeriveInputUtil<'_> {
315315
type Target = DeriveInput;
316316

317317
fn deref(&self) -> &Self::Target {
@@ -445,7 +445,7 @@ impl<'a> GenericsUtil<'a> {
445445
}
446446
}
447447

448-
impl<'a> Deref for GenericsUtil<'a> {
448+
impl Deref for GenericsUtil<'_> {
449449
type Target = syn::Generics;
450450

451451
fn deref(&self) -> &Self::Target {

starlark_lsp/src/definition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ impl LspModule {
275275

276276
/// Look at the given scope and child scopes to try to find where the identifier
277277
/// accessed at Pos is defined.
278-
fn find_definition_in_scope<'a>(scope: &'a Scope, pos: Pos) -> TempDefinition<'a> {
278+
fn find_definition_in_scope(scope: &Scope, pos: Pos) -> TempDefinition<'_> {
279279
/// Look for a name in the given scope, with a given source, and return the right
280280
/// type of [`TempIdentifierDefinition`] based on whether / how the variable is bound.
281281
fn resolve_get_in_scope<'a>(

0 commit comments

Comments
 (0)