]> git.lizzy.rs Git - rust.git/blobdiff - src/librustdoc/html/render.rs
rollup merge of #21438: taralx/kill-racycell
[rust.git] / src / librustdoc / html / render.rs
index 839dfa339b328763237add6af32db3fb238a98db..c60b20dda5deceac60fe990575c7df01cb06a509 100644 (file)
@@ -313,7 +313,7 @@ pub fn run(mut krate: clean::Crate,
     let analysis = ::ANALYSISKEY.with(|a| a.clone());
     let analysis = analysis.borrow();
     let public_items = analysis.as_ref().map(|a| a.public_items.clone());
-    let public_items = public_items.unwrap_or(NodeSet::new());
+    let public_items = public_items.unwrap_or(NodeSet());
     let paths: HashMap<ast::DefId, (Vec<String>, ItemType)> =
       analysis.as_ref().map(|a| {
         let paths = a.external_paths.borrow_mut().take().unwrap();
@@ -404,7 +404,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> io::IoResult<String>
                     search_index.push(IndexItem {
                         ty: shortty(item),
                         name: item.name.clone().unwrap(),
-                        path: fqp[..(fqp.len() - 1)].connect("::"),
+                        path: fqp[..fqp.len() - 1].connect("::"),
                         desc: shorter(item.doc_value()).to_string(),
                         parent: Some(did),
                     });
@@ -559,7 +559,7 @@ fn collect(path: &Path, krate: &str,
         };
 
         let mut mydst = dst.clone();
-        for part in remote_path[..(remote_path.len() - 1)].iter() {
+        for part in remote_path[..remote_path.len() - 1].iter() {
             mydst.push(part.as_slice());
             try!(mkdir(&mydst));
         }
@@ -842,7 +842,7 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
                 clean::StructFieldItem(..) |
                 clean::VariantItem(..) => {
                     ((Some(*self.parent_stack.last().unwrap()),
-                      Some(&self.stack[..(self.stack.len() - 1)])),
+                      Some(&self.stack[..self.stack.len() - 1])),
                      false)
                 }
                 clean::MethodItem(..) => {
@@ -853,13 +853,13 @@ fn fold_item(&mut self, item: clean::Item) -> Option<clean::Item> {
                         let did = *last;
                         let path = match self.paths.get(&did) {
                             Some(&(_, ItemType::Trait)) =>
-                                Some(&self.stack[..(self.stack.len() - 1)]),
+                                Some(&self.stack[..self.stack.len() - 1]),
                             // The current stack not necessarily has correlation for
                             // where the type was defined. On the other hand,
                             // `paths` always has the right information if present.
                             Some(&(ref fqp, ItemType::Struct)) |
                             Some(&(ref fqp, ItemType::Enum)) =>
-                                Some(&fqp[..(fqp.len() - 1)]),
+                                Some(&fqp[..fqp.len() - 1]),
                             Some(..) => Some(self.stack.as_slice()),
                             None => None
                         };
@@ -1185,7 +1185,7 @@ fn render(w: io::File, cx: &Context, it: &clean::Item,
                                            .collect::<String>();
                 match cache().paths.get(&it.def_id) {
                     Some(&(ref names, _)) => {
-                        for name in (&names[..(names.len() - 1)]).iter() {
+                        for name in (&names[..names.len() - 1]).iter() {
                             url.push_str(name.as_slice());
                             url.push_str("/");
                         }
@@ -2085,6 +2085,10 @@ fn render_impl(w: &mut fmt::Formatter, i: &Impl) -> fmt::Result {
     try!(write!(w, "<h3 class='impl'>{}<code>impl{} ",
                 ConciseStability(&i.stability),
                 i.impl_.generics));
+    match i.impl_.polarity {
+        Some(clean::ImplPolarity::Negative) => try!(write!(w, "!")),
+        _ => {}
+    }
     match i.impl_.trait_ {
         Some(ref ty) => try!(write!(w, "{} for ", *ty)),
         None => {}