Fix breakage due to rust-lang/rust#61968
This commit is contained in:
@@ -315,14 +315,14 @@ pub fn implements_trait<'a, 'tcx>(
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
pub fn trait_ref_of_method(cx: &LateContext<'_, '_>, hir_id: HirId) -> Option<TraitRef> {
|
||||
pub fn trait_ref_of_method<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, hir_id: HirId) -> Option<&'a TraitRef> {
|
||||
// Get the implemented trait for the current function
|
||||
let parent_impl = cx.tcx.hir().get_parent_item(hir_id);
|
||||
if_chain! {
|
||||
if parent_impl != hir::CRATE_HIR_ID;
|
||||
if let hir::Node::Item(item) = cx.tcx.hir().get_by_hir_id(parent_impl);
|
||||
if let hir::ItemKind::Impl(_, _, _, _, trait_ref, _, _) = &item.node;
|
||||
then { return trait_ref.clone(); }
|
||||
then { return trait_ref.as_ref(); }
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user