about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2018-07-21 23:14:37 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2018-07-22 21:03:21 +0200
commitbcb5c6fe5fed032fd8ef6b2308a7ff61b1eeca71 (patch)
tree36f11bdd570ef85a8875d4be620501e83b5c3387 /src
parent8fa6e3fa761ef9092ab5faf3e0ff1650798e2e53 (diff)
downloadrust-bcb5c6fe5fed032fd8ef6b2308a7ff61b1eeca71.tar.gz
rust-bcb5c6fe5fed032fd8ef6b2308a7ff61b1eeca71.zip
Fix urls
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/clean/auto_trait.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs
index 1fcedb3b5d2..4246c8b555a 100644
--- a/src/librustdoc/clean/auto_trait.rs
+++ b/src/librustdoc/clean/auto_trait.rs
@@ -114,8 +114,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
         name: Option<String>,
     ) -> Vec<Item>
     where F: Fn(DefId) -> Def {
-        if !self.cx.access_levels.borrow().is_doc_reachable(def_id) ||
-           self.cx
+        if self.cx
             .tcx
             .get_attrs(def_id)
             .lists("doc")
@@ -134,7 +133,8 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
 
         let ty = self.cx.tcx.type_of(def_id);
         let mut traits = Vec::new();
-        if self.cx.crate_name != Some("core".to_string()) {
+        if self.cx.crate_name != Some("core".to_string()) &&
+           self.cx.access_levels.borrow().is_doc_reachable(def_id) {
             if let ty::TyAdt(_adt, _) = ty.sty {
                 let real_name = name.clone().map(|name| Ident::from_str(&name));
                 let param_env = self.cx.tcx.param_env(def_id);
@@ -191,7 +191,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
                                     ref_id: ast::DUMMY_NODE_ID,
                                 };
                                 let provided_trait_methods =
-                                    infcx.tcx.provided_trait_methods(impl_def_id)
+                                    infcx.tcx.provided_trait_methods(trait_def_id)
                                              .into_iter()
                                              .map(|meth| meth.ident.to_string())
                                              .collect();