Skip to content

Commit d123731

Browse files
samueltardieuKither12
authored andcommitted
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.
1 parent c7ad6d5 commit d123731

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ pub fn def_path_res_with_base(tcx: TyCtxt<'_>, mut base: Vec<Res>, mut path: &[&
745745
}
746746

747747
/// Resolves a def path like `std::vec::Vec` to its [`DefId`]s, see [`def_path_res`].
748-
pub fn def_path_def_ids(tcx: TyCtxt<'_>, path: &[&str]) -> impl Iterator<Item = DefId> {
748+
pub fn def_path_def_ids(tcx: TyCtxt<'_>, path: &[&str]) -> impl Iterator<Item = DefId> + use<> {
749749
def_path_res(tcx, path).into_iter().filter_map(|res| res.opt_def_id())
750750
}
751751

0 commit comments

Comments
 (0)