Skip to content

Commit

Permalink
Auto merge of #13629 - samueltardieu:push-nwukowumrvsn, r=flip1995
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Nov 3, 2024
2 parents ddd1a86 + 540e116 commit 040129b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

Expand Down

0 comments on commit 040129b

Please sign in to comment.