From 1fcd04ed49f2591e8667694bc623fde0ff6e42bc Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 1 Feb 2024 08:35:37 +0000 Subject: [PATCH] inline a function that is only used in clippy --- compiler/rustc_hir/src/hir.rs | 4 ---- src/tools/clippy/clippy_lints/src/lifetimes.rs | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index ff50086ff8f..c89ad079448 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -163,10 +163,6 @@ impl Lifetime { (LifetimeSuggestionPosition::Normal, self.ident.span) } } - - pub fn is_static(&self) -> bool { - self.res == LifetimeName::Static - } } /// A `Path` is essentially Rust's notion of a name; for instance, diff --git a/src/tools/clippy/clippy_lints/src/lifetimes.rs b/src/tools/clippy/clippy_lints/src/lifetimes.rs index ffef84d1fad..f5636945f20 100644 --- a/src/tools/clippy/clippy_lints/src/lifetimes.rs +++ b/src/tools/clippy/clippy_lints/src/lifetimes.rs @@ -176,7 +176,7 @@ fn check_fn_inner<'tcx>( _ => None, }); for bound in lifetimes { - if !bound.is_static() && !bound.is_elided() { + if bound.res != LifetimeName::Static && !bound.is_elided() { return; } }