]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/clean/mod.rs
Merge branch 'refactor-select' of https://github.com/aravind-pg/rust into update...
[rust.git] / src / librustdoc / clean / mod.rs
index 4543b246b83ad19ac5ae456fe23d39107e42be62..d0230a69374d48167f11aa87f5c97d7aa82f2efe 100644 (file)
@@ -55,6 +55,7 @@
 use std::default::Default;
 use std::{mem, slice, vec};
 use std::iter::{FromIterator, once};
+use rustc_data_structures::sync::Lrc;
 use std::rc::Rc;
 use std::cell::RefCell;
 use std::sync::Arc;
@@ -1534,7 +1535,6 @@ fn clean(&self, cx: &DocContext) -> WherePredicate {
 
         match *self {
             Predicate::Trait(ref pred) => pred.clean(cx),
-            Predicate::Equate(ref pred) => pred.clean(cx),
             Predicate::Subtype(ref pred) => pred.clean(cx),
             Predicate::RegionOutlives(ref pred) => pred.clean(cx),
             Predicate::TypeOutlives(ref pred) => pred.clean(cx),
@@ -1556,16 +1556,6 @@ fn clean(&self, cx: &DocContext) -> WherePredicate {
     }
 }
 
-impl<'tcx> Clean<WherePredicate> for ty::EquatePredicate<'tcx> {
-    fn clean(&self, cx: &DocContext) -> WherePredicate {
-        let ty::EquatePredicate(ref lhs, ref rhs) = *self;
-        WherePredicate::EqPredicate {
-            lhs: lhs.clean(cx),
-            rhs: rhs.clean(cx)
-        }
-    }
-}
-
 impl<'tcx> Clean<WherePredicate> for ty::SubtypePredicate<'tcx> {
     fn clean(&self, _cx: &DocContext) -> WherePredicate {
         panic!("subtype predicates are an internal rustc artifact \
@@ -3428,7 +3418,11 @@ fn build_deref_target_impls(cx: &DocContext,
         let primitive = match *target {
             ResolvedPath { did, .. } if did.is_local() => continue,
             ResolvedPath { did, .. } => {
-                ret.extend(inline::build_impls(cx, did, true));
+                // We set the last parameter to false to avoid looking for auto-impls for traits
+                // and therefore avoid an ICE.
+                // The reason behind this is that auto-traits don't propagate through Deref so
+                // we're not supposed to synthesise impls for them.
+                ret.extend(inline::build_impls(cx, did, false));
                 continue
             }
             _ => match target.primitive_type() {
@@ -3895,7 +3889,7 @@ pub fn path_to_def(tcx: &TyCtxt, path: &[&str]) -> Option<DefId> {
                 None => return None,
             };
 
-            for item in mem::replace(&mut items, Rc::new(vec![])).iter() {
+            for item in mem::replace(&mut items, Lrc::new(vec![])).iter() {
                 if item.ident.name == *segment {
                     if path_it.peek().is_none() {
                         return match item.def {