about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-11-03 15:50:48 +0000
committerbors <bors@rust-lang.org>2024-11-03 15:50:48 +0000
commit040129b7745fdf661a395d7de13b4ef7944cd1e0 (patch)
tree0ce2e438b9dbec625933637f8033ca96ffe7ed91
parentddd1a86c662bc507ed0797e05354bc6e1272ba58 (diff)
parent540e116a38cefcb4eb50d190304fd67ddc9882cd (diff)
downloadrust-040129b7745fdf661a395d7de13b4ef7944cd1e0.tar.gz
rust-040129b7745fdf661a395d7de13b4ef7944cd1e0.zip
Auto merge of #13629 - samueltardieu:push-nwukowumrvsn, r=flip1995
Return iterator must not capture lifetimes in Rust 2024

In Rust 2024, by default lifetimes will be captured which does not reflect the reality since we return an iterator of `DefId` which do not capture the input parameters.

changelog: none
-rw-r--r--clippy_utils/src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs
index 18d8ea50957..a9bc20a5d41 100644
--- a/clippy_utils/src/lib.rs
+++ b/clippy_utils/src/lib.rs
@@ -745,7 +745,7 @@ pub fn def_path_res_with_base(tcx: TyCtxt<'_>, mut base: Vec<Res>, mut path: &[&
 }
 
 /// Resolves a def path like `std::vec::Vec` to its [`DefId`]s, see [`def_path_res`].
-pub fn def_path_def_ids(tcx: TyCtxt<'_>, path: &[&str]) -> impl Iterator<Item = DefId> {
+pub fn def_path_def_ids(tcx: TyCtxt<'_>, path: &[&str]) -> impl Iterator<Item = DefId> + use<> {
     def_path_res(tcx, path).into_iter().filter_map(|res| res.opt_def_id())
 }