]> git.lizzy.rs Git - rust.git/commitdiff
propper trait of item impl
authorachernyak <artemchernyak@gmail.com>
Fri, 5 May 2017 19:40:26 +0000 (14:40 -0500)
committerachernyak <artemchernyak@gmail.com>
Fri, 5 May 2017 19:40:26 +0000 (14:40 -0500)
src/librustc/ty/mod.rs

index 1c3e74d4fb965e564d5d7df3f80beaefbc2ab1b5..9f43ed9bf5bb5afb4d7eda9d560a601fb4f808f3 100644 (file)
@@ -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<DefId> {
     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| {