about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-10-01 10:17:20 -0700
committerGitHub <noreply@github.com>2016-10-01 10:17:20 -0700
commitab38d52df75f4fefbecb1156ff96d7c0728cced8 (patch)
tree8aeb0aa2dfd84b33bf7cbad2b9e60a57c7f99ebd
parentdf9fa1a51e9e9570c30b98be2409964313f5d607 (diff)
parent8457ab61f67a463366c3de0e2de177ed5b306434 (diff)
downloadrust-ab38d52df75f4fefbecb1156ff96d7c0728cced8.tar.gz
rust-ab38d52df75f4fefbecb1156ff96d7c0728cced8.zip
Auto merge of #36885 - Manishearth:rollup, r=Manishearth
Rollup of 6 pull requests

- Successful merges: #36865, #36872, #36873, #36877, #36880, #36882
- Failed merges:
-rw-r--r--src/libcore/fmt/mod.rs4
-rw-r--r--src/librustc_back/target/mod.rs4
-rw-r--r--src/librustc_metadata/encoder.rs2
-rw-r--r--src/librustc_metadata/loader.rs9
-rw-r--r--src/librustc_metadata/schema.rs8
-rw-r--r--src/librustc_resolve/lib.rs2
-rw-r--r--src/librustc_typeck/check/method/confirm.rs20
-rw-r--r--src/librustc_typeck/collect.rs10
-rw-r--r--src/librustdoc/clean/mod.rs25
-rw-r--r--src/librustdoc/html/render.rs71
-rw-r--r--src/test/compile-fail/E0035.rs1
-rw-r--r--src/test/compile-fail/E0036.rs1
-rw-r--r--src/test/compile-fail/discrim-overflow-2.rs32
-rw-r--r--src/test/compile-fail/discrim-overflow.rs32
-rw-r--r--src/test/compile-fail/issue-36881.rs14
-rw-r--r--src/test/run-pass/deriving-show.rs3
16 files changed, 150 insertions, 88 deletions
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index a9f53d3abb8..9aba6703386 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -1566,11 +1566,11 @@ floating! { f64 }
 // Implementation of Display/Debug for various core types
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T> Debug for *const T {
+impl<T: ?Sized> Debug for *const T {
     fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
 }
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<T> Debug for *mut T {
+impl<T: ?Sized> Debug for *mut T {
     fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
 }
 
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
index 6e2f7b1bf53..4404af1970e 100644
--- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs
@@ -168,8 +168,8 @@ supported_targets! {
     ("x86_64-unknown-netbsd", x86_64_unknown_netbsd),
     ("x86_64-rumprun-netbsd", x86_64_rumprun_netbsd),
 
-    ("i686_unknown_haiku", i686_unknown_haiku),
-    ("x86_64_unknown_haiku", x86_64_unknown_haiku),
+    ("i686-unknown-haiku", i686_unknown_haiku),
+    ("x86_64-unknown-haiku", x86_64_unknown_haiku),
 
     ("x86_64-apple-darwin", x86_64_apple_darwin),
     ("i686-apple-darwin", i686_apple_darwin),
diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs
index ca4fb77d95a..4d18462848e 100644
--- a/src/librustc_metadata/encoder.rs
+++ b/src/librustc_metadata/encoder.rs
@@ -1288,7 +1288,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
         let link_meta = self.link_meta;
         let is_rustc_macro = tcx.sess.crate_types.borrow().contains(&CrateTypeRustcMacro);
         let root = self.lazy(&CrateRoot {
-            rustc_version: RUSTC_VERSION.to_string(),
+            rustc_version: rustc_version(),
             name: link_meta.crate_name.clone(),
             triple: tcx.sess.opts.target_triple.clone(),
             hash: link_meta.crate_hash,
diff --git a/src/librustc_metadata/loader.rs b/src/librustc_metadata/loader.rs
index fc94cec916a..75242fc36db 100644
--- a/src/librustc_metadata/loader.rs
+++ b/src/librustc_metadata/loader.rs
@@ -213,7 +213,7 @@
 //! metadata::loader or metadata::creader for all the juicy details!
 
 use cstore::MetadataBlob;
-use schema::{METADATA_HEADER, RUSTC_VERSION};
+use schema::{METADATA_HEADER, rustc_version};
 
 use rustc::hir::svh::Svh;
 use rustc::session::Session;
@@ -382,7 +382,7 @@ impl<'a> Context<'a> {
         }
         if !self.rejected_via_version.is_empty() {
             err.help(&format!("please recompile that crate using this compiler ({})",
-                              RUSTC_VERSION));
+                              rustc_version()));
             let mismatches = self.rejected_via_version.iter();
             for (i, &CrateMismatch { ref path, ref got }) in mismatches.enumerate() {
                 err.note(&format!("crate `{}` path #{}: {} compiled by {:?}",
@@ -597,9 +597,10 @@ impl<'a> Context<'a> {
 
     fn crate_matches(&mut self, metadata: &MetadataBlob, libpath: &Path) -> Option<Svh> {
         let root = metadata.get_root();
-        if root.rustc_version != RUSTC_VERSION {
+        let rustc_version = rustc_version();
+        if root.rustc_version != rustc_version {
             info!("Rejecting via version: expected {} got {}",
-                  RUSTC_VERSION, root.rustc_version);
+                  rustc_version, root.rustc_version);
             self.rejected_via_version.push(CrateMismatch {
                 path: libpath.to_path_buf(),
                 got: root.rustc_version
diff --git a/src/librustc_metadata/schema.rs b/src/librustc_metadata/schema.rs
index 58e18bc709e..1a46315e9cd 100644
--- a/src/librustc_metadata/schema.rs
+++ b/src/librustc_metadata/schema.rs
@@ -26,11 +26,9 @@ use syntax_pos::{self, Span};
 
 use std::marker::PhantomData;
 
-#[cfg(not(test))]
-pub const RUSTC_VERSION: &'static str = concat!("rustc ", env!("CFG_VERSION"));
-
-#[cfg(test)]
-pub const RUSTC_VERSION: &'static str = "rustc 0.0.0-unit-test";
+pub fn rustc_version() -> String {
+    format!("rustc {}", option_env!("CFG_VERSION").unwrap_or("unknown version"))
+}
 
 /// Metadata encoding version.
 /// NB: increment this if you change the format of metadata such that
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index 0694edd2357..d1bfb7d786e 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -3534,7 +3534,7 @@ fn module_to_string(module: Module) -> String {
         } else {
             // danger, shouldn't be ident?
             names.push(token::intern("<opaque>"));
-            collect_mod(names, module);
+            collect_mod(names, module.parent.unwrap());
         }
     }
     collect_mod(&mut names, module);
diff --git a/src/librustc_typeck/check/method/confirm.rs b/src/librustc_typeck/check/method/confirm.rs
index ab59fafb652..e81bca3c171 100644
--- a/src/librustc_typeck/check/method/confirm.rs
+++ b/src/librustc_typeck/check/method/confirm.rs
@@ -312,13 +312,25 @@ impl<'a, 'gcx, 'tcx> ConfirmContext<'a, 'gcx, 'tcx> {
 
         if num_supplied_types > 0 && num_supplied_types != num_method_types {
             if num_method_types == 0 {
-                span_err!(self.tcx.sess, self.span, E0035,
-                    "does not take type parameters");
+                struct_span_err!(self.tcx.sess, self.span, E0035,
+                                 "does not take type parameters")
+                    .span_label(self.span, &"called with unneeded type parameters")
+                    .emit();
             } else {
-                span_err!(self.tcx.sess, self.span, E0036,
+                struct_span_err!(self.tcx.sess, self.span, E0036,
                     "incorrect number of type parameters given for this method: \
                      expected {}, found {}",
-                    num_method_types, num_supplied_types);
+                    num_method_types, num_supplied_types)
+                    .span_label(self.span,
+                                &format!("Passed {} type argument{}, expected {}",
+                                         num_supplied_types,
+                                         if num_supplied_types != 1 {
+                                            "s"
+                                         } else {
+                                            ""
+                                         },
+                                         num_method_types))
+                    .emit();
             }
             supplied_method_types = vec![self.tcx.types.err; num_method_types];
         }
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index e5d4d4a9dae..cdd7bef2c7f 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -1164,10 +1164,12 @@ fn convert_enum_def<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
         } else if let Some(disr) = repr_type.disr_incr(tcx, prev_disr) {
             Some(disr)
         } else {
-            span_err!(tcx.sess, v.span, E0370,
-                      "enum discriminant overflowed on value after {}; \
-                       set explicitly via {} = {} if that is desired outcome",
-                      prev_disr.unwrap(), v.node.name, wrapped_disr);
+            struct_span_err!(tcx.sess, v.span, E0370,
+                             "enum discriminant overflowed")
+                .span_label(v.span, &format!("overflowed on value after {}", prev_disr.unwrap()))
+                .note(&format!("explicitly set `{} = {}` if that is desired outcome",
+                               v.node.name, wrapped_disr))
+                .emit();
             None
         }.unwrap_or(wrapped_disr);
         prev_disr = Some(disr);
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index af482a940bc..c1ee4e61c5c 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -283,34 +283,34 @@ impl Item {
         }
     }
     pub fn is_mod(&self) -> bool {
-        ItemType::from(self) == ItemType::Module
+        self.type_() == ItemType::Module
     }
     pub fn is_trait(&self) -> bool {
-        ItemType::from(self) == ItemType::Trait
+        self.type_() == ItemType::Trait
     }
     pub fn is_struct(&self) -> bool {
-        ItemType::from(self) == ItemType::Struct
+        self.type_() == ItemType::Struct
     }
     pub fn is_enum(&self) -> bool {
-        ItemType::from(self) == ItemType::Module
+        self.type_() == ItemType::Module
     }
     pub fn is_fn(&self) -> bool {
-        ItemType::from(self) == ItemType::Function
+        self.type_() == ItemType::Function
     }
     pub fn is_associated_type(&self) -> bool {
-        ItemType::from(self) == ItemType::AssociatedType
+        self.type_() == ItemType::AssociatedType
     }
     pub fn is_associated_const(&self) -> bool {
-        ItemType::from(self) == ItemType::AssociatedConst
+        self.type_() == ItemType::AssociatedConst
     }
     pub fn is_method(&self) -> bool {
-        ItemType::from(self) == ItemType::Method
+        self.type_() == ItemType::Method
     }
     pub fn is_ty_method(&self) -> bool {
-        ItemType::from(self) == ItemType::TyMethod
+        self.type_() == ItemType::TyMethod
     }
     pub fn is_primitive(&self) -> bool {
-        ItemType::from(self) == ItemType::Primitive
+        self.type_() == ItemType::Primitive
     }
     pub fn is_stripped(&self) -> bool {
         match self.inner { StrippedItem(..) => true, _ => false }
@@ -342,6 +342,11 @@ impl Item {
     pub fn stable_since(&self) -> Option<&str> {
         self.stability.as_ref().map(|s| &s.since[..])
     }
+
+    /// Returns a documentation-level item type from the item.
+    pub fn type_(&self) -> ItemType {
+        ItemType::from(self)
+    }
 }
 
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 9c80f6e98c3..46461226381 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -89,9 +89,6 @@ pub struct Context {
     /// Current hierarchy of components leading down to what's currently being
     /// rendered
     pub current: Vec<String>,
-    /// String representation of how to get back to the root path of the 'doc/'
-    /// folder in terms of a relative URL.
-    pub root_path: String,
     /// The current destination folder of where HTML artifacts should be placed.
     /// This changes as the context descends into the module hierarchy.
     pub dst: PathBuf,
@@ -496,7 +493,6 @@ pub fn run(mut krate: clean::Crate,
     krate = render_sources(&dst, &mut scx, krate)?;
     let cx = Context {
         current: Vec::new(),
-        root_path: String::new(),
         dst: dst,
         render_redirect_pages: false,
         shared: Arc::new(scx),
@@ -591,7 +587,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
     for &(did, ref item) in orphan_impl_items {
         if let Some(&(ref fqp, _)) = paths.get(&did) {
             search_index.push(IndexItem {
-                ty: item_type(item),
+                ty: item.type_(),
                 name: item.name.clone().unwrap(),
                 path: fqp[..fqp.len() - 1].join("::"),
                 desc: Escape(&shorter(item.doc_value())).to_string(),
@@ -835,11 +831,6 @@ fn mkdir(path: &Path) -> io::Result<()> {
     }
 }
 
-/// Returns a documentation-level item type from the item.
-fn item_type(item: &clean::Item) -> ItemType {
-    ItemType::from(item)
-}
-
 /// Takes a path to a source file and cleans the path to it. This canonicalizes
 /// things like ".." to components which preserve the "top down" hierarchy of a
 /// static HTML tree. Each component in the cleaned path will be passed as an
@@ -1075,7 +1066,7 @@ impl DocFolder for Cache {
                     // inserted later on when serializing the search-index.
                     if item.def_id.index != CRATE_DEF_INDEX {
                         self.search_index.push(IndexItem {
-                            ty: item_type(&item),
+                            ty: item.type_(),
                             name: s.to_string(),
                             path: path.join("::").to_string(),
                             desc: Escape(&shorter(item.doc_value())).to_string(),
@@ -1122,7 +1113,7 @@ impl DocFolder for Cache {
                     self.access_levels.is_public(item.def_id)
                 {
                     self.paths.insert(item.def_id,
-                                      (self.stack.clone(), item_type(&item)));
+                                      (self.stack.clone(), item.type_()));
                 }
             }
             // link variants to their parent enum because pages aren't emitted
@@ -1135,7 +1126,7 @@ impl DocFolder for Cache {
 
             clean::PrimitiveItem(..) if item.visibility.is_some() => {
                 self.paths.insert(item.def_id, (self.stack.clone(),
-                                                item_type(&item)));
+                                                item.type_()));
             }
 
             _ => {}
@@ -1230,6 +1221,12 @@ impl<'a> Cache {
 }
 
 impl Context {
+    /// String representation of how to get back to the root path of the 'doc/'
+    /// folder in terms of a relative URL.
+    fn root_path(&self) -> String {
+        repeat("../").take(self.current.len()).collect::<String>()
+    }
+
     /// Recurse in the directory structure and change the "root path" to make
     /// sure it always points to the top (relatively)
     fn recurse<T, F>(&mut self, s: String, f: F) -> T where
@@ -1240,7 +1237,6 @@ impl Context {
         }
         let prev = self.dst.clone();
         self.dst.push(&s);
-        self.root_path.push_str("../");
         self.current.push(s);
 
         info!("Recursing into {}", self.dst.display());
@@ -1251,8 +1247,6 @@ impl Context {
 
         // Go back to where we were at
         self.dst = prev;
-        let len = self.root_path.len();
-        self.root_path.truncate(len - 3);
         self.current.pop().unwrap();
 
         return ret;
@@ -1304,7 +1298,7 @@ impl Context {
             title.push_str(it.name.as_ref().unwrap());
         }
         title.push_str(" - Rust");
-        let tyname = item_type(it).css_class();
+        let tyname = it.type_().css_class();
         let desc = if it.is_crate() {
             format!("API documentation for the Rust `{}` crate.",
                     self.shared.layout.krate)
@@ -1315,7 +1309,7 @@ impl Context {
         let keywords = make_item_keywords(it);
         let page = layout::Page {
             css_class: tyname,
-            root_path: &self.root_path,
+            root_path: &self.root_path(),
             title: &title,
             description: &desc,
             keywords: &keywords,
@@ -1329,8 +1323,7 @@ impl Context {
                            &Item{ cx: self, item: it },
                            self.shared.css_file_extension.is_some())?;
         } else {
-            let mut url = repeat("../").take(self.current.len())
-                                       .collect::<String>();
+            let mut url = self.root_path();
             if let Some(&(ref names, ty)) = cache().paths.get(&it.def_id) {
                 for name in &names[..names.len() - 1] {
                     url.push_str(name);
@@ -1407,7 +1400,7 @@ impl Context {
             // buf will be empty if the item is stripped and there is no redirect for it
             if !buf.is_empty() {
                 let name = item.name.as_ref().unwrap();
-                let item_type = item_type(&item);
+                let item_type = item.type_();
                 let file_name = &item_path(item_type, name);
                 let joint_dst = self.dst.join(file_name);
                 try_err!(fs::create_dir_all(&self.dst), &self.dst);
@@ -1444,7 +1437,7 @@ impl Context {
         for item in &m.items {
             if maybe_ignore_item(item) { continue }
 
-            let short = item_type(item).css_class();
+            let short = item.type_().css_class();
             let myname = match item.name {
                 None => continue,
                 Some(ref s) => s.to_string(),
@@ -1492,7 +1485,7 @@ impl<'a> Item<'a> {
             }).map(|l| &l.1);
             let root = match root {
                 Some(&Remote(ref s)) => s.to_string(),
-                Some(&Local) => self.cx.root_path.clone(),
+                Some(&Local) => self.cx.root_path(),
                 None | Some(&Unknown) => return None,
             };
             Some(format!("{root}/{krate}/macro.{name}.html?gotomacrosrc=1",
@@ -1507,7 +1500,7 @@ impl<'a> Item<'a> {
             let path = PathBuf::from(&self.item.source.filename);
             self.cx.shared.local_sources.get(&path).map(|path| {
                 format!("{root}src/{krate}/{path}#{href}",
-                        root = self.cx.root_path,
+                        root = self.cx.root_path(),
                         krate = self.cx.shared.layout.krate,
                         path = path,
                         href = href)
@@ -1531,7 +1524,7 @@ impl<'a> Item<'a> {
             };
             let mut path = match cache.extern_locations.get(&self.item.def_id.krate) {
                 Some(&(_, Remote(ref s))) => s.to_string(),
-                Some(&(_, Local)) => self.cx.root_path.clone(),
+                Some(&(_, Local)) => self.cx.root_path(),
                 Some(&(_, Unknown)) => return None,
                 None => return None,
             };
@@ -1541,7 +1534,7 @@ impl<'a> Item<'a> {
             }
             Some(format!("{path}{file}?gotosrc={goto}",
                          path = path,
-                         file = item_path(item_type(self.item), external_path.last().unwrap()),
+                         file = item_path(self.item.type_(), external_path.last().unwrap()),
                          goto = self.item.def_id.index.as_usize()))
         }
     }
@@ -1586,7 +1579,7 @@ impl<'a> fmt::Display for Item<'a> {
             }
         }
         write!(fmt, "<a class='{}' href=''>{}</a>",
-               item_type(self.item), self.item.name.as_ref().unwrap())?;
+               self.item.type_(), self.item.name.as_ref().unwrap())?;
 
         write!(fmt, "</span>")?; // in-band
         write!(fmt, "<span class='out-of-band'>")?;
@@ -1739,8 +1732,8 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
     }
 
     fn cmp(i1: &clean::Item, i2: &clean::Item, idx1: usize, idx2: usize) -> Ordering {
-        let ty1 = item_type(i1);
-        let ty2 = item_type(i2);
+        let ty1 = i1.type_();
+        let ty2 = i2.type_();
         if ty1 != ty2 {
             return (reorder(ty1), idx1).cmp(&(reorder(ty2), idx2))
         }
@@ -1764,7 +1757,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
             continue;
         }
 
-        let myty = Some(item_type(myitem));
+        let myty = Some(myitem.type_());
         if curty == Some(ItemType::ExternCrate) && myty == Some(ItemType::Import) {
             // Put `extern crate` and `use` re-exports in the same section.
             curty = myty;
@@ -1851,9 +1844,9 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
                        name = *myitem.name.as_ref().unwrap(),
                        stab_docs = stab_docs,
                        docs = shorter(Some(&Markdown(doc_value).to_string())),
-                       class = item_type(myitem),
+                       class = myitem.type_(),
                        stab = myitem.stability_class(),
-                       href = item_path(item_type(myitem), myitem.name.as_ref().unwrap()),
+                       href = item_path(myitem.type_(), myitem.name.as_ref().unwrap()),
                        title = full_path(cx, myitem))?;
             }
         }
@@ -2059,7 +2052,7 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
     fn trait_item(w: &mut fmt::Formatter, cx: &Context, m: &clean::Item, t: &clean::Item)
                   -> fmt::Result {
         let name = m.name.as_ref().unwrap();
-        let item_type = item_type(m);
+        let item_type = m.type_();
         let id = derive_id(format!("{}.{}", item_type, name));
         let ns_id = derive_id(format!("{}.{}", name, item_type.name_space()));
         write!(w, "<h3 id='{id}' class='method stab {stab}'>\
@@ -2145,7 +2138,7 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
                let (ref path, _) = cache.external_paths[&it.def_id];
                path[..path.len() - 1].join("/")
            },
-           ty = item_type(it).css_class(),
+           ty = it.type_().css_class(),
            name = *it.name.as_ref().unwrap())?;
     Ok(())
 }
@@ -2154,7 +2147,7 @@ fn naive_assoc_href(it: &clean::Item, link: AssocItemLink) -> String {
     use html::item_type::ItemType::*;
 
     let name = it.name.as_ref().unwrap();
-    let ty = match item_type(it) {
+    let ty = match it.type_() {
         Typedef | AssociatedType => AssociatedType,
         s@_ => s,
     };
@@ -2232,7 +2225,7 @@ fn render_assoc_item(w: &mut fmt::Formatter,
               link: AssocItemLink)
               -> fmt::Result {
         let name = meth.name.as_ref().unwrap();
-        let anchor = format!("#{}.{}", item_type(meth), name);
+        let anchor = format!("#{}.{}", meth.type_(), name);
         let href = match link {
             AssocItemLink::Anchor(Some(ref id)) => format!("#{}", id),
             AssocItemLink::Anchor(None) => anchor,
@@ -2740,7 +2733,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
                      link: AssocItemLink, render_mode: RenderMode,
                      is_default_item: bool, outer_version: Option<&str>,
                      trait_: Option<&clean::Trait>) -> fmt::Result {
-        let item_type = item_type(item);
+        let item_type = item.type_();
         let name = item.name.as_ref().unwrap();
 
         let render_method_item: bool = match render_mode {
@@ -2918,7 +2911,7 @@ impl<'a> fmt::Display for Sidebar<'a> {
                 write!(fmt, "::<wbr>")?;
             }
             write!(fmt, "<a href='{}index.html'>{}</a>",
-                   &cx.root_path[..(cx.current.len() - i - 1) * 3],
+                   &cx.root_path()[..(cx.current.len() - i - 1) * 3],
                    *name)?;
         }
         write!(fmt, "</p>")?;
@@ -2932,7 +2925,7 @@ impl<'a> fmt::Display for Sidebar<'a> {
                    relpath: '{path}'\
                 }};</script>",
                name = it.name.as_ref().map(|x| &x[..]).unwrap_or(""),
-               ty = item_type(it).css_class(),
+               ty = it.type_().css_class(),
                path = relpath)?;
         if parentlen == 0 {
             // there is no sidebar-items.js beyond the crate root path
diff --git a/src/test/compile-fail/E0035.rs b/src/test/compile-fail/E0035.rs
index 43f46e3578c..9322d21d2a8 100644
--- a/src/test/compile-fail/E0035.rs
+++ b/src/test/compile-fail/E0035.rs
@@ -17,4 +17,5 @@ impl Test {
 fn main() {
     let x = Test;
     x.method::<i32>(); //~ ERROR E0035
+                       //~| NOTE called with unneeded type parameters
 }
diff --git a/src/test/compile-fail/E0036.rs b/src/test/compile-fail/E0036.rs
index 35fd6e8942f..ecb6dac66f2 100644
--- a/src/test/compile-fail/E0036.rs
+++ b/src/test/compile-fail/E0036.rs
@@ -20,4 +20,5 @@ fn main() {
     let x = Test;
     let v = &[0];
     x.method::<i32, i32>(v); //~ ERROR E0036
+                             //~| NOTE Passed 2 type arguments, expected 1
 }
diff --git a/src/test/compile-fail/discrim-overflow-2.rs b/src/test/compile-fail/discrim-overflow-2.rs
index 0ff740212e8..213683b5808 100644
--- a/src/test/compile-fail/discrim-overflow-2.rs
+++ b/src/test/compile-fail/discrim-overflow-2.rs
@@ -24,7 +24,9 @@ fn f_i8() {
     enum A {
         Ok = i8::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed on value after 127i8; set explicitly via OhNo = -128i8 if that is desired outcome
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 127i8
+              //~| NOTE explicitly set `OhNo = -128i8` if that is desired outcome
     }
 }
 
@@ -33,7 +35,9 @@ fn f_u8() {
     enum A {
         Ok = u8::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed on value after 255u8; set explicitly via OhNo = 0u8 if that is desired outcome
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 255u8
+              //~| NOTE explicitly set `OhNo = 0u8` if that is desired outcome
     }
 }
 
@@ -42,7 +46,9 @@ fn f_i16() {
     enum A {
         Ok = i16::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 32767i16
+              //~| NOTE explicitly set `OhNo = -32768i16` if that is desired outcome
     }
 }
 
@@ -51,7 +57,9 @@ fn f_u16() {
     enum A {
         Ok = u16::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 65535u16
+              //~| NOTE explicitly set `OhNo = 0u16` if that is desired outcome
     }
 }
 
@@ -60,7 +68,9 @@ fn f_i32() {
     enum A {
         Ok = i32::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 2147483647i32
+              //~| NOTE explicitly set `OhNo = -2147483648i32` if that is desired outcome
     }
 }
 
@@ -69,7 +79,9 @@ fn f_u32() {
     enum A {
         Ok = u32::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 4294967295u32
+              //~| NOTE explicitly set `OhNo = 0u32` if that is desired outcome
     }
 }
 
@@ -78,7 +90,9 @@ fn f_i64() {
     enum A {
         Ok = i64::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 9223372036854775807i64
+              //~| NOTE explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
     }
 }
 
@@ -87,7 +101,9 @@ fn f_u64() {
     enum A {
         Ok = u64::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 18446744073709551615u64
+              //~| NOTE explicitly set `OhNo = 0u64` if that is desired outcome
     }
 }
 
diff --git a/src/test/compile-fail/discrim-overflow.rs b/src/test/compile-fail/discrim-overflow.rs
index 7316e737b6d..a3039b8d957 100644
--- a/src/test/compile-fail/discrim-overflow.rs
+++ b/src/test/compile-fail/discrim-overflow.rs
@@ -22,7 +22,9 @@ fn f_i8() {
     enum A {
         Ok = i8::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed on value after 127i8; set explicitly via OhNo = -128i8 if that is desired outcome
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 127i8
+              //~| NOTE explicitly set `OhNo = -128i8` if that is desired outcome
     }
 
     let x = A::Ok;
@@ -33,7 +35,9 @@ fn f_u8() {
     enum A {
         Ok = u8::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed on value after 255u8; set explicitly via OhNo = 0u8 if that is desired outcome
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 255u8
+              //~| NOTE explicitly set `OhNo = 0u8` if that is desired outcome
     }
 
     let x = A::Ok;
@@ -44,7 +48,9 @@ fn f_i16() {
     enum A {
         Ok = i16::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| NOTE overflowed on value after 32767i16
+              //~| NOTE explicitly set `OhNo = -32768i16` if that is desired outcome
     }
 
     let x = A::Ok;
@@ -55,7 +61,9 @@ fn f_u16() {
     enum A {
         Ok = u16::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| overflowed on value after 65535u16
+              //~| NOTE explicitly set `OhNo = 0u16` if that is desired outcome
     }
 
     let x = A::Ok;
@@ -66,7 +74,9 @@ fn f_i32() {
     enum A {
         Ok = i32::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| overflowed on value after 2147483647i32
+              //~| NOTE explicitly set `OhNo = -2147483648i32` if that is desired outcome
     }
 
     let x = A::Ok;
@@ -77,7 +87,9 @@ fn f_u32() {
     enum A {
         Ok = u32::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| overflowed on value after 4294967295u32
+              //~| NOTE explicitly set `OhNo = 0u32` if that is desired outcome
     }
 
     let x = A::Ok;
@@ -88,7 +100,9 @@ fn f_i64() {
     enum A {
         Ok = i64::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| overflowed on value after 9223372036854775807i64
+              //~| NOTE explicitly set `OhNo = -9223372036854775808i64` if that is desired outcome
     }
 
     let x = A::Ok;
@@ -99,7 +113,9 @@ fn f_u64() {
     enum A {
         Ok = u64::MAX - 1,
         Ok2,
-        OhNo, //~ ERROR enum discriminant overflowed
+        OhNo, //~ ERROR enum discriminant overflowed [E0370]
+              //~| overflowed on value after 18446744073709551615u64
+              //~| NOTE explicitly set `OhNo = 0u64` if that is desired outcome
     }
 
     let x = A::Ok;
diff --git a/src/test/compile-fail/issue-36881.rs b/src/test/compile-fail/issue-36881.rs
new file mode 100644
index 00000000000..cca20e968e0
--- /dev/null
+++ b/src/test/compile-fail/issue-36881.rs
@@ -0,0 +1,14 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    extern crate rand;
+    use rand::Rng; //~ ERROR unresolved import
+}
diff --git a/src/test/run-pass/deriving-show.rs b/src/test/run-pass/deriving-show.rs
index 1f30f3ecedc..e858ba8c823 100644
--- a/src/test/run-pass/deriving-show.rs
+++ b/src/test/run-pass/deriving-show.rs
@@ -24,6 +24,9 @@ enum Enum {
     StructVariant { x: isize, y : usize }
 }
 
+#[derive(Debug)]
+struct Pointers(*const Send, *mut Sync);
+
 macro_rules! t {
     ($x:expr, $expected:expr) => {
         assert_eq!(format!("{:?}", $x), $expected.to_string())