We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e6455ea + 9163ac9 commit 6da1461Copy full SHA for 6da1461
clippy_utils/src/lib.rs
@@ -520,7 +520,7 @@ pub fn path_to_res(cx: &LateContext<'_>, path: &[&str]) -> Res {
520
}
521
};
522
523
- fn item_child_by_name<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, name: &str) -> Option<&'tcx Export<HirId>> {
+ fn item_child_by_name<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, name: &str) -> Option<&'tcx Export> {
524
tcx.item_children(def_id)
525
.iter()
526
.find(|item| item.ident.name.as_str() == name)
@@ -557,7 +557,7 @@ pub fn path_to_res(cx: &LateContext<'_>, path: &[&str]) -> Res {
557
None
558
559
});
560
- try_res!(last).res
+ try_res!(last).res.expect_non_local()
561
562
563
/// Convenience function to get the `DefId` of a trait by path.
0 commit comments