From d561d4c9eb808cbca28fd641934825fdf96fb762 Mon Sep 17 00:00:00 2001 From: achernyak Date: Fri, 5 May 2017 14:40:26 -0500 Subject: [PATCH] propper trait of item impl --- src/librustc/ty/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 1c3e74d4fb9..9f43ed9bf5b 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -2682,7 +2682,7 @@ fn def_span<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Span { /// Otherwise, return `None`. fn trait_of_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Option { if def_id.krate != LOCAL_CRATE { - return None + return tcx.trait_of_item(def_id) } tcx.opt_associated_item(def_id) .and_then(|associated_item| { -- 2.44.0