about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-08-14 15:27:15 -0700
committerGitHub <noreply@github.com>2016-08-14 15:27:15 -0700
commit13ff307f07327843348c0fb7476c4de77f95f89f (patch)
tree714f14faa5bb09f1e0c072e1cbfa15740ee7cbf5 /src
parent1d5b758bab979b1db723bcc97ecd8398127bd8bc (diff)
parentbcee2edc54d04a2fcf5ba9e4a4a095bcf9be2bfc (diff)
downloadrust-13ff307f07327843348c0fb7476c4de77f95f89f.tar.gz
rust-13ff307f07327843348c0fb7476c4de77f95f89f.zip
Auto merge of #35666 - eddyb:rollup, r=eddyb
Rollup of 30 pull requests

- Successful merges: #34941, #35392, #35444, #35447, #35491, #35533, #35539, #35558, #35573, #35574, #35577, #35586, #35588, #35594, #35596, #35597, #35598, #35606, #35611, #35615, #35616, #35620, #35622, #35640, #35643, #35644, #35646, #35647, #35648, #35661
- Failed merges: #35395, #35415
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/lib.rs9
-rw-r--r--src/bootstrap/sanity.rs3
-rw-r--r--src/doc/book/error-handling.md6
-rw-r--r--src/doc/book/variable-bindings.md2
-rw-r--r--src/liballoc/raw_vec.rs6
-rw-r--r--src/libcollections/string.rs5
-rw-r--r--src/libcollections/vec.rs63
-rw-r--r--src/libcollectionstest/lib.rs1
-rw-r--r--src/libcollectionstest/vec.rs23
-rw-r--r--src/libcore/cell.rs22
-rw-r--r--src/libcore/convert.rs8
-rw-r--r--src/libcore/sync/atomic.rs2
-rw-r--r--src/librustc/middle/entry.rs9
-rw-r--r--src/librustc/ty/error.rs19
-rw-r--r--src/librustc_const_eval/check_match.rs8
-rw-r--r--src/librustc_passes/loops.rs8
-rw-r--r--src/librustc_resolve/lib.rs7
-rw-r--r--src/librustc_resolve/resolve_imports.rs4
-rw-r--r--src/librustc_typeck/check/intrinsic.rs6
-rw-r--r--src/librustc_typeck/check/mod.rs9
-rw-r--r--src/librustc_typeck/check/op.rs8
-rw-r--r--src/libstd/env.rs4
-rw-r--r--src/libstd/panicking.rs104
-rw-r--r--src/libstd/sys/unix/mod.rs4
-rw-r--r--src/libstd/sys/unix/os.rs6
-rw-r--r--src/libstd/sys/unix/thread.rs7
-rw-r--r--src/libsyntax/feature_gate.rs2
-rw-r--r--src/libsyntax/parse/parser.rs19
-rw-r--r--src/libsyntax/tokenstream.rs112
-rw-r--r--src/libunwind/libunwind.rs1
-rw-r--r--src/test/compile-fail/E0067.rs2
-rw-r--r--src/test/compile-fail/E0094.rs1
-rw-r--r--src/test/compile-fail/E0138.rs5
-rw-r--r--src/test/compile-fail/E0253.rs4
-rw-r--r--src/test/compile-fail/E0254.rs5
-rw-r--r--src/test/compile-fail/E0267.rs1
-rw-r--r--src/test/compile-fail/E0268.rs1
-rw-r--r--src/test/compile-fail/E0301.rs1
-rw-r--r--src/test/compile-fail/E0302.rs1
-rw-r--r--src/test/compile-fail/coercion-slice.rs2
-rw-r--r--src/test/compile-fail/cross-borrow-trait.rs2
-rw-r--r--src/test/compile-fail/destructure-trait-ref.rs4
-rw-r--r--src/test/compile-fail/dst-bad-coercions.rs4
-rw-r--r--src/test/compile-fail/issue-12997-2.rs2
-rw-r--r--src/test/compile-fail/issue-16338.rs2
-rw-r--r--src/test/compile-fail/issue-17033.rs2
-rw-r--r--src/test/compile-fail/issue-20225.rs6
-rw-r--r--src/test/compile-fail/issue-26093.rs1
-rw-r--r--src/test/compile-fail/issue-29084.rs2
-rw-r--r--src/test/compile-fail/issue-5100.rs2
-rw-r--r--src/test/compile-fail/issue-5500.rs2
-rw-r--r--src/test/compile-fail/issue-7061.rs2
-rw-r--r--src/test/compile-fail/issue-7867.rs4
-rw-r--r--src/test/compile-fail/method-self-arg-1.rs2
-rw-r--r--src/test/compile-fail/overloaded-calls-bad.rs2
-rw-r--r--src/test/compile-fail/pub-struct-field-span-26083.rs30
-rw-r--r--src/test/compile-fail/repeat_count.rs2
-rw-r--r--src/test/run-pass-fulldeps/linkage-visibility.rs1
-rw-r--r--src/test/run-pass-fulldeps/logging-enabled.rs1
-rw-r--r--src/test/run-pass-fulldeps/logging-separate-lines.rs1
-rw-r--r--src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs2
-rw-r--r--src/test/run-pass/backtrace-debuginfo.rs1
-rw-r--r--src/test/run-pass/backtrace.rs1
-rw-r--r--src/test/run-pass/command-before-exec.rs1
-rw-r--r--src/test/run-pass/command-exec.rs1
-rw-r--r--src/test/run-pass/drop-flag-sanity-check.rs1
-rw-r--r--src/test/run-pass/drop-trait-enum.rs2
-rw-r--r--src/test/run-pass/enum-variants.rs2
-rw-r--r--src/test/run-pass/env-args-reverse-iterator.rs2
-rw-r--r--src/test/run-pass/env-home-dir.rs1
-rw-r--r--src/test/run-pass/exec-env.rs2
-rw-r--r--src/test/run-pass/fn-type-infer.rs2
-rw-r--r--src/test/run-pass/generic-tag.rs2
-rw-r--r--src/test/run-pass/hashmap-memory.rs2
-rw-r--r--src/test/run-pass/intrinsic-alignment.rs3
-rw-r--r--src/test/run-pass/issue-10626.rs1
-rw-r--r--src/test/run-pass/issue-12133-3.rs1
-rw-r--r--src/test/run-pass/issue-12660.rs2
-rw-r--r--src/test/run-pass/issue-13304.rs1
-rw-r--r--src/test/run-pass/issue-14456.rs1
-rw-r--r--src/test/run-pass/issue-1451.rs2
-rw-r--r--src/test/run-pass/issue-14940.rs1
-rw-r--r--src/test/run-pass/issue-16272.rs1
-rw-r--r--src/test/run-pass/issue-20091.rs1
-rw-r--r--src/test/run-pass/issue-2190-1.rs1
-rw-r--r--src/test/run-pass/issue-22894.rs13
-rw-r--r--src/test/run-pass/issue-24313.rs2
-rw-r--r--src/test/run-pass/issue-28950.rs1
-rw-r--r--src/test/run-pass/issue-29485.rs1
-rw-r--r--src/test/run-pass/issue-30490.rs2
-rw-r--r--src/test/run-pass/issue-33770.rs2
-rw-r--r--src/test/run-pass/issue-3878.rs2
-rw-r--r--src/test/run-pass/issue-4734.rs2
-rw-r--r--src/test/run-pass/issue-7911.rs2
-rw-r--r--src/test/run-pass/linkage1.rs1
-rw-r--r--src/test/run-pass/liveness-assign-imm-local-after-loop.rs2
-rw-r--r--src/test/run-pass/long-while.rs2
-rw-r--r--src/test/run-pass/match-phi.rs2
-rw-r--r--src/test/run-pass/multi-panic.rs2
-rw-r--r--src/test/run-pass/no-stdio.rs2
-rw-r--r--src/test/run-pass/output-slot-variants.rs2
-rw-r--r--src/test/run-pass/panic-handler-chain.rs3
-rw-r--r--src/test/run-pass/process-exit.rs2
-rw-r--r--src/test/run-pass/process-remove-from-env.rs1
-rw-r--r--src/test/run-pass/process-spawn-with-unicode-params.rs1
-rw-r--r--src/test/run-pass/rec-align-u64.rs3
-rw-r--r--src/test/run-pass/regions-fn-subtyping.rs2
-rw-r--r--src/test/run-pass/running-with-no-runtime.rs2
-rw-r--r--src/test/run-pass/segfault-no-out-of-stack.rs2
-rw-r--r--src/test/run-pass/signal-exit-status.rs1
-rw-r--r--src/test/run-pass/sigpipe-should-be-ignored.rs1
-rw-r--r--src/test/run-pass/sleep.rs2
-rw-r--r--src/test/run-pass/traits-default-method-mut.rs2
-rw-r--r--src/test/run-pass/typestate-cfg-nesting.rs2
-rw-r--r--src/test/run-pass/unique-move-drop.rs2
-rw-r--r--src/test/run-pass/unit.rs2
-rw-r--r--src/test/run-pass/unreachable-code-1.rs2
-rw-r--r--src/test/run-pass/unreachable-code.rs4
-rw-r--r--src/test/run-pass/unused-move.rs2
-rw-r--r--src/test/run-pass/wait-forked-but-failed-child.rs1
-rw-r--r--src/test/run-pass/while-loop-constraints-2.rs2
-rw-r--r--src/test/ui/span/pub-struct-field.rs (renamed from src/test/run-pass/pred-not-bool.rs)16
-rw-r--r--src/test/ui/span/pub-struct-field.stderr19
-rw-r--r--src/tools/compiletest/src/runtest.rs4
124 files changed, 527 insertions, 212 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 3ef8cb74dfa..0af6082aee4 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -870,8 +870,13 @@ impl Build {
         // This is a hack, because newer binutils broke things on some vms/distros
         // (i.e., linking against unknown relocs disabled by the following flag)
         // See: https://github.com/rust-lang/rust/issues/34978
-        if target == "x86_64-unknown-linux-musl" {
-            base.push("-Wa,-mrelax-relocations=no".into());
+        match target {
+            "i586-unknown-linux-gnu" |
+            "i686-unknown-linux-musl" |
+            "x86_64-unknown-linux-musl" => {
+                base.push("-Wa,-mrelax-relocations=no".into());
+            },
+            _ => {},
         }
         return base
     }
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index 09f96782e71..d6ac3ef6c9c 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -98,7 +98,8 @@ pub fn check(build: &mut Build) {
         if target.contains("rumprun") ||
            target.contains("bitrig") ||
            target.contains("openbsd") ||
-           target.contains("msvc") {
+           target.contains("msvc") ||
+           target.contains("emscripten") {
             build.config.use_jemalloc = false;
         }
 
diff --git a/src/doc/book/error-handling.md b/src/doc/book/error-handling.md
index 544f837d69b..6e13b464e4c 100644
--- a/src/doc/book/error-handling.md
+++ b/src/doc/book/error-handling.md
@@ -166,7 +166,7 @@ story. The other half is *using* the `find` function we've written. Let's try
 to use it to find the extension in a file name.
 
 ```rust
-# fn find(_: &str, _: char) -> Option<usize> { None }
+# fn find(haystack: &str, needle: char) -> Option<usize> { haystack.find(needle) }
 fn main() {
     let file_name = "foobar.rs";
     match find(file_name, '.') {
@@ -223,7 +223,7 @@ Getting the extension of a file name is a pretty common operation, so it makes
 sense to put it into a function:
 
 ```rust
-# fn find(_: &str, _: char) -> Option<usize> { None }
+# fn find(haystack: &str, needle: char) -> Option<usize> { haystack.find(needle) }
 // Returns the extension of the given file name, where the extension is defined
 // as all characters following the first `.`.
 // If `file_name` has no `.`, then `None` is returned.
@@ -272,7 +272,7 @@ Armed with our new combinator, we can rewrite our `extension_explicit` method
 to get rid of the case analysis:
 
 ```rust
-# fn find(_: &str, _: char) -> Option<usize> { None }
+# fn find(haystack: &str, needle: char) -> Option<usize> { haystack.find(needle) }
 // Returns the extension of the given file name, where the extension is defined
 // as all characters following the first `.`.
 // If `file_name` has no `.`, then `None` is returned.
diff --git a/src/doc/book/variable-bindings.md b/src/doc/book/variable-bindings.md
index b6751f57a97..30e922d7f4d 100644
--- a/src/doc/book/variable-bindings.md
+++ b/src/doc/book/variable-bindings.md
@@ -125,7 +125,7 @@ warning, but it will still print "Hello, world!":
 
 ```text
    Compiling hello_world v0.0.1 (file:///home/you/projects/hello_world)
-src/main.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variable)]
+src/main.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variables)]
    on by default
 src/main.rs:2     let x: i32;
                       ^
diff --git a/src/liballoc/raw_vec.rs b/src/liballoc/raw_vec.rs
index 58c841151c0..cdb70ce5770 100644
--- a/src/liballoc/raw_vec.rs
+++ b/src/liballoc/raw_vec.rs
@@ -17,7 +17,7 @@ use super::boxed::Box;
 use core::ops::Drop;
 use core::cmp;
 
-/// A low-level utility for more ergonomically allocating, reallocating, and deallocating a
+/// A low-level utility for more ergonomically allocating, reallocating, and deallocating
 /// a buffer of memory on the heap without having to worry about all the corner cases
 /// involved. This type is excellent for building your own data structures like Vec and VecDeque.
 /// In particular:
@@ -534,8 +534,8 @@ impl<T> RawVec<T> {
     /// Converts the entire buffer into `Box<[T]>`.
     ///
     /// While it is not *strictly* Undefined Behavior to call
-    /// this procedure while some of the RawVec is unintialized,
-    /// it cetainly makes it trivial to trigger it.
+    /// this procedure while some of the RawVec is uninitialized,
+    /// it certainly makes it trivial to trigger it.
     ///
     /// Note that this will correctly reconstitute any `cap` changes
     /// that may have been performed. (see description of type for details)
diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs
index c06bde6222a..788c838cd3f 100644
--- a/src/libcollections/string.rs
+++ b/src/libcollections/string.rs
@@ -1152,7 +1152,7 @@ impl String {
         self.vec.set_len(len + amt);
     }
 
-    /// Inserts a string into this `String` at a byte position.
+    /// Inserts a string slice into this `String` at a byte position.
     ///
     /// This is an `O(n)` operation as it requires copying every element in the
     /// buffer.
@@ -1182,8 +1182,7 @@ impl String {
                reason = "recent addition",
                issue = "35553")]
     pub fn insert_str(&mut self, idx: usize, string: &str) {
-        let len = self.len();
-        assert!(idx <= len);
+        assert!(idx <= self.len());
         assert!(self.is_char_boundary(idx));
 
         unsafe {
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index 8b4fce158de..a6f817a8962 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -1446,13 +1446,12 @@ impl<T> IntoIterator for Vec<T> {
     #[inline]
     fn into_iter(mut self) -> IntoIter<T> {
         unsafe {
-            let ptr = self.as_mut_ptr();
-            assume(!ptr.is_null());
-            let begin = ptr as *const T;
+            let begin = self.as_mut_ptr();
+            assume(!begin.is_null());
             let end = if mem::size_of::<T>() == 0 {
-                arith_offset(ptr as *const i8, self.len() as isize) as *const T
+                arith_offset(begin as *const i8, self.len() as isize) as *const T
             } else {
-                ptr.offset(self.len() as isize) as *const T
+                begin.offset(self.len() as isize) as *const T
             };
             let buf = ptr::read(&self.buf);
             mem::forget(self);
@@ -1710,10 +1709,52 @@ impl<'a, T> FromIterator<T> for Cow<'a, [T]> where T: Clone {
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct IntoIter<T> {
     _buf: RawVec<T>,
-    ptr: *const T,
+    ptr: *mut T,
     end: *const T,
 }
 
+impl<T> IntoIter<T> {
+    /// Returns the remaining items of this iterator as a slice.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # #![feature(vec_into_iter_as_slice)]
+    /// let vec = vec!['a', 'b', 'c'];
+    /// let mut into_iter = vec.into_iter();
+    /// assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']);
+    /// let _ = into_iter.next().unwrap();
+    /// assert_eq!(into_iter.as_slice(), &['b', 'c']);
+    /// ```
+    #[unstable(feature = "vec_into_iter_as_slice", issue = "35601")]
+    pub fn as_slice(&self) -> &[T] {
+        unsafe {
+            slice::from_raw_parts(self.ptr, self.len())
+        }
+    }
+
+    /// Returns the remaining items of this iterator as a mutable slice.
+    ///
+    /// # Examples
+    ///
+    /// ```rust
+    /// # #![feature(vec_into_iter_as_slice)]
+    /// let vec = vec!['a', 'b', 'c'];
+    /// let mut into_iter = vec.into_iter();
+    /// assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']);
+    /// into_iter.as_mut_slice()[2] = 'z';
+    /// assert_eq!(into_iter.next().unwrap(), 'a');
+    /// assert_eq!(into_iter.next().unwrap(), 'b');
+    /// assert_eq!(into_iter.next().unwrap(), 'z');
+    /// ```
+    #[unstable(feature = "vec_into_iter_as_slice", issue = "35601")]
+    pub fn as_mut_slice(&self) -> &mut [T] {
+        unsafe {
+            slice::from_raw_parts_mut(self.ptr, self.len())
+        }
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 unsafe impl<T: Send> Send for IntoIter<T> {}
 #[stable(feature = "rust1", since = "1.0.0")]
@@ -1726,14 +1767,14 @@ impl<T> Iterator for IntoIter<T> {
     #[inline]
     fn next(&mut self) -> Option<T> {
         unsafe {
-            if self.ptr == self.end {
+            if self.ptr as *const _ == self.end {
                 None
             } else {
                 if mem::size_of::<T>() == 0 {
                     // purposefully don't use 'ptr.offset' because for
                     // vectors with 0-size elements this would return the
                     // same pointer.
-                    self.ptr = arith_offset(self.ptr as *const i8, 1) as *const T;
+                    self.ptr = arith_offset(self.ptr as *const i8, 1) as *mut T;
 
                     // Use a non-null pointer value
                     Some(ptr::read(EMPTY as *mut T))
@@ -1776,7 +1817,7 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
             } else {
                 if mem::size_of::<T>() == 0 {
                     // See above for why 'ptr.offset' isn't used
-                    self.end = arith_offset(self.end as *const i8, -1) as *const T;
+                    self.end = arith_offset(self.end as *const i8, -1) as *mut T;
 
                     // Use a non-null pointer value
                     Some(ptr::read(EMPTY as *mut T))
@@ -1796,9 +1837,7 @@ impl<T> ExactSizeIterator for IntoIter<T> {}
 #[stable(feature = "vec_into_iter_clone", since = "1.8.0")]
 impl<T: Clone> Clone for IntoIter<T> {
     fn clone(&self) -> IntoIter<T> {
-        unsafe {
-            slice::from_raw_parts(self.ptr, self.len()).to_owned().into_iter()
-        }
+        self.as_slice().to_owned().into_iter()
     }
 }
 
diff --git a/src/libcollectionstest/lib.rs b/src/libcollectionstest/lib.rs
index 8ae63808f27..ab3231b2b99 100644
--- a/src/libcollectionstest/lib.rs
+++ b/src/libcollectionstest/lib.rs
@@ -28,6 +28,7 @@
 #![feature(unboxed_closures)]
 #![feature(unicode)]
 #![feature(vec_deque_contains)]
+#![feature(vec_into_iter_as_slice)]
 
 extern crate collections;
 extern crate test;
diff --git a/src/libcollectionstest/vec.rs b/src/libcollectionstest/vec.rs
index 7a6bd958a5f..9556174bd22 100644
--- a/src/libcollectionstest/vec.rs
+++ b/src/libcollectionstest/vec.rs
@@ -479,6 +479,29 @@ fn test_split_off() {
 }
 
 #[test]
+fn test_into_iter_as_slice() {
+    let vec = vec!['a', 'b', 'c'];
+    let mut into_iter = vec.into_iter();
+    assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']);
+    let _ = into_iter.next().unwrap();
+    assert_eq!(into_iter.as_slice(), &['b', 'c']);
+    let _ = into_iter.next().unwrap();
+    let _ = into_iter.next().unwrap();
+    assert_eq!(into_iter.as_slice(), &[]);
+}
+
+#[test]
+fn test_into_iter_as_mut_slice() {
+    let vec = vec!['a', 'b', 'c'];
+    let mut into_iter = vec.into_iter();
+    assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']);
+    into_iter.as_mut_slice()[0] = 'x';
+    into_iter.as_mut_slice()[1] = 'y';
+    assert_eq!(into_iter.next().unwrap(), 'x');
+    assert_eq!(into_iter.as_slice(), &['y', 'c']);
+}
+
+#[test]
 fn test_into_iter_count() {
     assert_eq!(vec![1, 2, 3].into_iter().count(), 3);
 }
diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs
index 434084d3af8..17ec325e257 100644
--- a/src/libcore/cell.rs
+++ b/src/libcore/cell.rs
@@ -146,6 +146,7 @@
 
 use clone::Clone;
 use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
+use convert::From;
 use default::Default;
 use fmt::{self, Debug, Display};
 use marker::{Copy, PhantomData, Send, Sync, Sized, Unsize};
@@ -329,6 +330,13 @@ impl<T:Ord + Copy> Ord for Cell<T> {
     }
 }
 
+#[stable(feature = "cell_from", since = "1.12.0")]
+impl<T: Copy> From<T> for Cell<T> {
+    fn from(t: T) -> Cell<T> {
+        Cell::new(t)
+    }
+}
+
 /// A mutable memory location with dynamically checked borrow rules
 ///
 /// See the [module-level documentation](index.html) for more.
@@ -742,6 +750,13 @@ impl<T: ?Sized + Ord> Ord for RefCell<T> {
     }
 }
 
+#[stable(feature = "cell_from", since = "1.12.0")]
+impl<T> From<T> for RefCell<T> {
+    fn from(t: T) -> RefCell<T> {
+        RefCell::new(t)
+    }
+}
+
 struct BorrowRef<'b> {
     borrow: &'b Cell<BorrowFlag>,
 }
@@ -1064,3 +1079,10 @@ impl<T: Default> Default for UnsafeCell<T> {
         UnsafeCell::new(Default::default())
     }
 }
+
+#[stable(feature = "cell_from", since = "1.12.0")]
+impl<T> From<T> for UnsafeCell<T> {
+    fn from(t: T) -> UnsafeCell<T> {
+        UnsafeCell::new(t)
+    }
+}
diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs
index 48421abc7bb..e68f973d8d9 100644
--- a/src/libcore/convert.rs
+++ b/src/libcore/convert.rs
@@ -71,8 +71,8 @@ use result::Result;
 ///
 /// # Generic Impls
 ///
-/// - `AsRef` auto-dereference if the inner type is a reference or a mutable
-/// reference (eg: `foo.as_ref()` will work the same if `foo` has type `&mut Foo` or `&&mut Foo`)
+/// - `AsRef` auto-dereferences if the inner type is a reference or a mutable
+/// reference (e.g.: `foo.as_ref()` will work the same if `foo` has type `&mut Foo` or `&&mut Foo`)
 ///
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait AsRef<T: ?Sized> {
@@ -88,8 +88,8 @@ pub trait AsRef<T: ?Sized> {
 ///
 /// # Generic Impls
 ///
-/// - `AsMut` auto-dereference if the inner type is a reference or a mutable
-/// reference (eg: `foo.as_ref()` will work the same if `foo` has type `&mut Foo` or `&&mut Foo`)
+/// - `AsMut` auto-dereferences if the inner type is a reference or a mutable
+/// reference (e.g.: `foo.as_ref()` will work the same if `foo` has type `&mut Foo` or `&&mut Foo`)
 ///
 #[stable(feature = "rust1", since = "1.0.0")]
 pub trait AsMut<T: ?Sized> {
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
index 2a7a0b62329..5701a89d8bc 100644
--- a/src/libcore/sync/atomic.rs
+++ b/src/libcore/sync/atomic.rs
@@ -32,7 +32,7 @@
 //! atomically-reference-counted shared pointer).
 //!
 //! Most atomic types may be stored in static variables, initialized using
-//! the provided static initializers like `INIT_ATOMIC_BOOL`. Atomic statics
+//! the provided static initializers like `ATOMIC_BOOL_INIT`. Atomic statics
 //! are often used for lazy global initialization.
 //!
 //!
diff --git a/src/librustc/middle/entry.rs b/src/librustc/middle/entry.rs
index 0a363fddd53..11bde922f47 100644
--- a/src/librustc/middle/entry.rs
+++ b/src/librustc/middle/entry.rs
@@ -132,8 +132,13 @@ fn find_item(item: &Item, ctxt: &mut EntryContext, at_root: bool) {
             if ctxt.start_fn.is_none() {
                 ctxt.start_fn = Some((item.id, item.span));
             } else {
-                span_err!(ctxt.session, item.span, E0138,
-                          "multiple 'start' functions");
+                struct_span_err!(
+                    ctxt.session, item.span, E0138,
+                    "multiple 'start' functions")
+                    .span_label(ctxt.start_fn.unwrap().1,
+                                &format!("previous `start` function here"))
+                    .span_label(item.span, &format!("multiple `start` functions"))
+                    .emit();
             }
         },
         EntryPointType::None => ()
diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs
index 66165ec6ff7..6b34c0a2198 100644
--- a/src/librustc/ty/error.rs
+++ b/src/librustc/ty/error.rs
@@ -222,7 +222,24 @@ impl<'a, 'gcx, 'lcx, 'tcx> ty::TyS<'tcx> {
             ty::TyArray(_, n) => format!("array of {} elements", n),
             ty::TySlice(_) => "slice".to_string(),
             ty::TyRawPtr(_) => "*-ptr".to_string(),
-            ty::TyRef(_, _) => "&-ptr".to_string(),
+            ty::TyRef(region, tymut) => {
+                let tymut_string = tymut.to_string();
+                if tymut_string == "_" ||         //unknown type name,
+                   tymut_string.len() > 10 ||     //name longer than saying "reference",
+                   region.to_string() != ""       //... or a complex type
+                {
+                    match tymut {
+                        ty::TypeAndMut{mutbl, ..} => {
+                            format!("{}reference", match mutbl {
+                                hir::Mutability::MutMutable => "mutable ",
+                                _ => ""
+                            })
+                        }
+                    }
+                } else {
+                    format!("&{}", tymut_string)
+                }
+            }
             ty::TyFnDef(..) => format!("fn item"),
             ty::TyFnPtr(_) => "fn pointer".to_string(),
             ty::TyTrait(ref inner) => {
diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs
index 3e88dec8cb2..20673dc1e18 100644
--- a/src/librustc_const_eval/check_match.rs
+++ b/src/librustc_const_eval/check_match.rs
@@ -1175,8 +1175,10 @@ impl<'a, 'gcx, 'tcx> Delegate<'tcx> for MutationChecker<'a, 'gcx> {
               _: LoanCause) {
         match kind {
             MutBorrow => {
-                span_err!(self.cx.tcx.sess, span, E0301,
+                struct_span_err!(self.cx.tcx.sess, span, E0301,
                           "cannot mutably borrow in a pattern guard")
+                    .span_label(span, &format!("borrowed mutably in pattern guard"))
+                    .emit();
             }
             ImmBorrow | UniqueImmBorrow => {}
         }
@@ -1185,7 +1187,9 @@ impl<'a, 'gcx, 'tcx> Delegate<'tcx> for MutationChecker<'a, 'gcx> {
     fn mutate(&mut self, _: NodeId, span: Span, _: cmt, mode: MutateMode) {
         match mode {
             MutateMode::JustWrite | MutateMode::WriteAndRead => {
-                span_err!(self.cx.tcx.sess, span, E0302, "cannot assign in a pattern guard")
+                struct_span_err!(self.cx.tcx.sess, span, E0302, "cannot assign in a pattern guard")
+                    .span_label(span, &format!("assignment in pattern guard"))
+                    .emit();
             }
             MutateMode::Init => {}
         }
diff --git a/src/librustc_passes/loops.rs b/src/librustc_passes/loops.rs
index 4e251793f69..eab16bd5bd1 100644
--- a/src/librustc_passes/loops.rs
+++ b/src/librustc_passes/loops.rs
@@ -77,10 +77,14 @@ impl<'a> CheckLoopVisitor<'a> {
         match self.cx {
             Loop => {}
             Closure => {
-                span_err!(self.sess, span, E0267, "`{}` inside of a closure", name);
+                struct_span_err!(self.sess, span, E0267, "`{}` inside of a closure", name)
+                .span_label(span, &format!("cannot break inside of a closure"))
+                .emit();
             }
             Normal => {
-                span_err!(self.sess, span, E0268, "`{}` outside of loop", name);
+                struct_span_err!(self.sess, span, E0268, "`{}` outside of loop", name)
+                .span_label(span, &format!("cannot break outside of a loop"))
+                .emit();
             }
         }
     }
diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs
index bdbdb294954..962509be324 100644
--- a/src/librustc_resolve/lib.rs
+++ b/src/librustc_resolve/lib.rs
@@ -3374,8 +3374,11 @@ impl<'a> Resolver<'a> {
 
         let mut err = match (old_binding.is_extern_crate(), binding.is_extern_crate()) {
             (true, true) => struct_span_err!(self.session, span, E0259, "{}", msg),
-            (true, _) | (_, true) if binding.is_import() || old_binding.is_import() =>
-                struct_span_err!(self.session, span, E0254, "{}", msg),
+            (true, _) | (_, true) if binding.is_import() || old_binding.is_import() => {
+                let mut e = struct_span_err!(self.session, span, E0254, "{}", msg);
+                e.span_label(span, &"already imported");
+                e
+            },
             (true, _) | (_, true) => struct_span_err!(self.session, span, E0260, "{}", msg),
             _ => match (old_binding.is_import(), binding.is_import()) {
                 (false, false) => struct_span_err!(self.session, span, E0428, "{}", msg),
diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs
index 6986f99926e..1e40aa7d187 100644
--- a/src/librustc_resolve/resolve_imports.rs
+++ b/src/librustc_resolve/resolve_imports.rs
@@ -505,7 +505,9 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
                 }
                 Success(binding) if !binding.is_importable() => {
                     let msg = format!("`{}` is not directly importable", target);
-                    span_err!(self.session, directive.span, E0253, "{}", &msg);
+                    struct_span_err!(self.session, directive.span, E0253, "{}", &msg)
+                        .span_label(directive.span, &format!("cannot be imported directly"))
+                        .emit();
                     // Do not import this illegal binding. Import a dummy binding and pretend
                     // everything is fine
                     self.import_dummy_binding(module, directive);
diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs
index 9051b1c8069..084bbff3383 100644
--- a/src/librustc_typeck/check/intrinsic.rs
+++ b/src/librustc_typeck/check/intrinsic.rs
@@ -51,10 +51,12 @@ fn equate_intrinsic_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
     }));
     let i_n_tps = i_ty.generics.types.len(subst::FnSpace);
     if i_n_tps != n_tps {
-        span_err!(tcx.sess, it.span, E0094,
+        struct_span_err!(tcx.sess, it.span, E0094,
             "intrinsic has wrong number of type \
              parameters: found {}, expected {}",
-             i_n_tps, n_tps);
+             i_n_tps, n_tps)
+             .span_label(it.span, &format!("expected {} type parameter", n_tps))
+             .emit();
     } else {
         require_same_types(ccx,
                            TypeOrigin::IntrinsicType(it.span),
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index 0c8e6d990a6..e99a95e4135 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -3520,8 +3520,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
 
             let tcx = self.tcx;
             if !tcx.expr_is_lval(&lhs) {
-                span_err!(tcx.sess, expr.span, E0070,
-                    "invalid left-hand side expression");
+                struct_span_err!(
+                    tcx.sess, expr.span, E0070,
+                    "invalid left-hand side expression")
+                .span_label(
+                    expr.span,
+                    &format!("left-hand of expression not valid"))
+                .emit();
             }
 
             let lhs_ty = self.expr_ty(&lhs);
diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs
index 63487683ec3..cdca988084c 100644
--- a/src/librustc_typeck/check/op.rs
+++ b/src/librustc_typeck/check/op.rs
@@ -41,7 +41,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
 
         let tcx = self.tcx;
         if !tcx.expr_is_lval(lhs_expr) {
-            span_err!(tcx.sess, lhs_expr.span, E0067, "invalid left-hand side expression");
+            struct_span_err!(
+                tcx.sess, lhs_expr.span,
+                E0067, "invalid left-hand side expression")
+            .span_label(
+                lhs_expr.span,
+                &format!("invalid expression for left-hand side"))
+            .emit();
         }
     }
 
diff --git a/src/libstd/env.rs b/src/libstd/env.rs
index d6d62ce79d4..753411991ab 100644
--- a/src/libstd/env.rs
+++ b/src/libstd/env.rs
@@ -526,10 +526,10 @@ pub fn temp_dir() -> PathBuf {
 /// Ok("/home/alex/bar")
 /// ```
 ///
-/// This sort of behavior has been known to [lead to privledge escalation] when
+/// This sort of behavior has been known to [lead to privilege escalation] when
 /// used incorrectly, for example.
 ///
-/// [lead to privledge escalation]: http://securityvulns.com/Wdocument183.html
+/// [lead to privilege escalation]: http://securityvulns.com/Wdocument183.html
 ///
 /// # Examples
 ///
diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs
index 8c1567939fb..5961fd59699 100644
--- a/src/libstd/panicking.rs
+++ b/src/libstd/panicking.rs
@@ -25,9 +25,10 @@ use cell::RefCell;
 use fmt;
 use intrinsics;
 use mem;
+use ptr;
 use raw;
-use sys_common::rwlock::RWLock;
 use sys::stdio::Stderr;
+use sys_common::rwlock::RWLock;
 use sys_common::thread_info;
 use sys_common::util;
 use thread;
@@ -255,45 +256,76 @@ pub use realstd::rt::update_panic_count;
 
 /// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
 pub unsafe fn try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<Any + Send>> {
-    let mut slot = None;
-    let mut f = Some(f);
-    let ret;
-
-    {
-        let mut to_run = || {
-            slot = Some(f.take().unwrap()());
-        };
-        let fnptr = get_call(&mut to_run);
-        let dataptr = &mut to_run as *mut _ as *mut u8;
-        let mut any_data = 0;
-        let mut any_vtable = 0;
-        let fnptr = mem::transmute::<fn(&mut _), fn(*mut u8)>(fnptr);
-        let r = __rust_maybe_catch_panic(fnptr,
-                                         dataptr,
-                                         &mut any_data,
-                                         &mut any_vtable);
-        if r == 0 {
-            ret = Ok(());
-        } else {
-            update_panic_count(-1);
-            ret = Err(mem::transmute(raw::TraitObject {
-                data: any_data as *mut _,
-                vtable: any_vtable as *mut _,
-            }));
-        }
+    struct Data<F, R> {
+        f: F,
+        r: R,
     }
 
-    debug_assert!(update_panic_count(0) == 0);
-    return ret.map(|()| {
-        slot.take().unwrap()
-    });
+    // We do some sketchy operations with ownership here for the sake of
+    // performance. The `Data` structure is never actually fully valid, but
+    // instead it always contains at least one uninitialized field. We can only
+    // pass pointers down to `__rust_maybe_catch_panic` (can't pass objects by
+    // value), so we do all the ownership tracking here manully.
+    //
+    // Note that this is all invalid if any of these functions unwind, but the
+    // whole point of this function is to prevent that! As a result we go
+    // through a transition where:
+    //
+    // * First, only the closure we're going to call is initialized. The return
+    //   value is uninitialized.
+    // * When we make the function call, the `do_call` function below, we take
+    //   ownership of the function pointer, replacing it with uninitialized
+    //   data. At this point the `Data` structure is entirely uninitialized, but
+    //   it won't drop due to an unwind because it's owned on the other side of
+    //   the catch panic.
+    // * If the closure successfully returns, we write the return value into the
+    //   data's return slot. Note that `ptr::write` is used as it's overwriting
+    //   uninitialized data.
+    // * Finally, when we come back out of the `__rust_maybe_catch_panic` we're
+    //   in one of two states:
+    //
+    //      1. The closure didn't panic, in which case the return value was
+    //         filled in. We have to be careful to `forget` the closure,
+    //         however, as ownership was passed to the `do_call` function.
+    //      2. The closure panicked, in which case the return value wasn't
+    //         filled in. In this case the entire `data` structure is invalid,
+    //         so we forget the entire thing.
+    //
+    // Once we stack all that together we should have the "most efficient'
+    // method of calling a catch panic whilst juggling ownership.
+    let mut any_data = 0;
+    let mut any_vtable = 0;
+    let mut data = Data {
+        f: f,
+        r: mem::uninitialized(),
+    };
 
-    fn get_call<F: FnMut()>(_: &mut F) -> fn(&mut F) {
-        call
-    }
+    let r = __rust_maybe_catch_panic(do_call::<F, R>,
+                                     &mut data as *mut _ as *mut u8,
+                                     &mut any_data,
+                                     &mut any_vtable);
+
+    return if r == 0 {
+        let Data { f, r } = data;
+        mem::forget(f);
+        debug_assert!(update_panic_count(0) == 0);
+        Ok(r)
+    } else {
+        mem::forget(data);
+        update_panic_count(-1);
+        debug_assert!(update_panic_count(0) == 0);
+        Err(mem::transmute(raw::TraitObject {
+            data: any_data as *mut _,
+            vtable: any_vtable as *mut _,
+        }))
+    };
 
-    fn call<F: FnMut()>(f: &mut F) {
-        f()
+    fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
+        unsafe {
+            let data = data as *mut Data<F, R>;
+            let f = ptr::read(&mut (*data).f);
+            ptr::write(&mut (*data).r, f());
+        }
     }
 }
 
diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs
index 1c25c8f77c1..23687e10e47 100644
--- a/src/libstd/sys/unix/mod.rs
+++ b/src/libstd/sys/unix/mod.rs
@@ -83,11 +83,11 @@ pub fn init() {
         }
     }
 
-    #[cfg(not(target_os = "nacl"))]
+    #[cfg(not(any(target_os = "nacl", target_os = "emscripten")))]
     unsafe fn reset_sigpipe() {
         assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != !0);
     }
-    #[cfg(target_os = "nacl")]
+    #[cfg(any(target_os = "nacl", target_os = "emscripten"))]
     unsafe fn reset_sigpipe() {}
 }
 
diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs
index 9c57f25dfcc..c29e87f91c9 100644
--- a/src/libstd/sys/unix/os.rs
+++ b/src/libstd/sys/unix/os.rs
@@ -551,11 +551,13 @@ pub fn home_dir() -> Option<PathBuf> {
 
     #[cfg(any(target_os = "android",
               target_os = "ios",
-              target_os = "nacl"))]
+              target_os = "nacl",
+              target_os = "emscripten"))]
     unsafe fn fallback() -> Option<OsString> { None }
     #[cfg(not(any(target_os = "android",
                   target_os = "ios",
-                  target_os = "nacl")))]
+                  target_os = "nacl",
+                  target_os = "emscripten")))]
     unsafe fn fallback() -> Option<OsString> {
         #[cfg(not(target_os = "solaris"))]
         unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs
index 1061ca87f64..75e10d25853 100644
--- a/src/libstd/sys/unix/thread.rs
+++ b/src/libstd/sys/unix/thread.rs
@@ -81,8 +81,7 @@ impl Thread {
     }
 
     #[cfg(any(target_os = "linux",
-              target_os = "android",
-              target_os = "emscripten"))]
+              target_os = "android"))]
     pub fn set_name(name: &CStr) {
         const PR_SET_NAME: libc::c_int = 15;
         // pthread wrapper only appeared in glibc 2.12, so we use syscall
@@ -118,9 +117,9 @@ impl Thread {
                                      name.as_ptr() as *mut libc::c_void);
         }
     }
-    #[cfg(any(target_env = "newlib", target_os = "solaris"))]
+    #[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))]
     pub fn set_name(_name: &CStr) {
-        // Newlib and Illumos has no way to set a thread name.
+        // Newlib, Illumos and Emscripten have no way to set a thread name.
     }
 
     pub fn sleep(dur: Duration) {
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index ad52184a6dc..afda59c61ff 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -314,7 +314,7 @@ declare_features! (
     (accepted, issue_5723_bootstrap, "1.0.0", None),
     (accepted, macro_rules, "1.0.0", None),
     // Allows using #![no_std]
-    (accepted, no_std, "1.0.0", None),
+    (accepted, no_std, "1.6.0", None),
     (accepted, slicing_syntax, "1.0.0", None),
     (accepted, struct_variant, "1.0.0", None),
     // These are used to test this portion of the compiler, they don't actually
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 4c279b2fe48..e174f3ad08d 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3788,19 +3788,18 @@ impl<'a> Parser<'a> {
     }
 
     /// Parse a structure field
-    fn parse_name_and_ty(&mut self, pr: Visibility,
-                         attrs: Vec<Attribute> ) -> PResult<'a, StructField> {
-        let lo = match pr {
-            Visibility::Inherited => self.span.lo,
-            _ => self.last_span.lo,
-        };
+    fn parse_name_and_ty(&mut self,
+                         lo: BytePos,
+                         vis: Visibility,
+                         attrs: Vec<Attribute>)
+                         -> PResult<'a, StructField> {
         let name = self.parse_ident()?;
         self.expect(&token::Colon)?;
         let ty = self.parse_ty_sum()?;
         Ok(StructField {
             span: mk_sp(lo, self.last_span.hi),
             ident: Some(name),
-            vis: pr,
+            vis: vis,
             id: ast::DUMMY_NODE_ID,
             ty: ty,
             attrs: attrs,
@@ -5120,10 +5119,11 @@ impl<'a> Parser<'a> {
 
     /// Parse a structure field declaration
     pub fn parse_single_struct_field(&mut self,
+                                     lo: BytePos,
                                      vis: Visibility,
                                      attrs: Vec<Attribute> )
                                      -> PResult<'a, StructField> {
-        let a_var = self.parse_name_and_ty(vis, attrs)?;
+        let a_var = self.parse_name_and_ty(lo, vis, attrs)?;
         match self.token {
             token::Comma => {
                 self.bump();
@@ -5144,8 +5144,9 @@ impl<'a> Parser<'a> {
     /// Parse an element of a struct definition
     fn parse_struct_decl_field(&mut self) -> PResult<'a, StructField> {
         let attrs = self.parse_outer_attributes()?;
+        let lo = self.span.lo;
         let vis = self.parse_visibility(true)?;
-        self.parse_single_struct_field(vis, attrs)
+        self.parse_single_struct_field(lo, vis, attrs)
     }
 
     // If `allow_path` is false, just parse the `pub` in `pub(path)` (but still parse `pub(crate)`)
diff --git a/src/libsyntax/tokenstream.rs b/src/libsyntax/tokenstream.rs
index 89ead21cc10..0171f24101a 100644
--- a/src/libsyntax/tokenstream.rs
+++ b/src/libsyntax/tokenstream.rs
@@ -340,6 +340,11 @@ pub struct TokenStream {
     ts: InternalTS,
 }
 
+// This indicates the maximum size for a leaf in the concatenation algorithm.
+// If two leafs will be collectively smaller than this, they will be merged.
+// If a leaf is larger than this, it will be concatenated at the top.
+const LEAF_SIZE : usize = 32;
+
 // NB If Leaf access proves to be slow, inroducing a secondary Leaf without the bounds
 // for unsliced Leafs may lead to some performance improvemenet.
 #[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
@@ -483,6 +488,37 @@ impl InternalTS {
             }
         }
     }
+
+    fn to_vec(&self) -> Vec<&TokenTree> {
+        let mut res = Vec::with_capacity(self.len());
+        fn traverse_and_append<'a>(res: &mut Vec<&'a TokenTree>, ts: &'a InternalTS) {
+            match *ts {
+                InternalTS::Empty(..) => {},
+                InternalTS::Leaf { ref tts, offset, len, .. } => {
+                    let mut to_app = tts[offset..offset + len].iter().collect();
+                    res.append(&mut to_app);
+                }
+                InternalTS::Node { ref left, ref right, .. } => {
+                    traverse_and_append(res, left);
+                    traverse_and_append(res, right);
+                }
+            }
+        }
+        traverse_and_append(&mut res, self);
+        res
+    }
+
+    fn to_tts(&self) -> Vec<TokenTree> {
+        self.to_vec().into_iter().cloned().collect::<Vec<TokenTree>>()
+    }
+
+    // Returns an internal node's children.
+    fn children(&self) -> Option<(Rc<InternalTS>, Rc<InternalTS>)> {
+        match *self {
+            InternalTS::Node { ref left, ref right, .. } => Some((left.clone(), right.clone())),
+            _ => None,
+        }
+    }
 }
 
 /// TokenStream operators include basic destructuring, boolean operations, `maybe_...`
@@ -496,14 +532,17 @@ impl InternalTS {
 ///
 ///    `maybe_path_prefix("a::b::c(a,b,c).foo()") -> (a::b::c, "(a,b,c).foo()")`
 impl TokenStream {
+    // Construct an empty node with a dummy span.
     pub fn mk_empty() -> TokenStream {
         TokenStream { ts: InternalTS::Empty(DUMMY_SP) }
     }
 
+    // Construct an empty node with the provided span.
     fn mk_spanned_empty(sp: Span) -> TokenStream {
         TokenStream { ts: InternalTS::Empty(sp) }
     }
 
+    // Construct a leaf node with a 0 offset and length equivalent to the input.
     fn mk_leaf(tts: Rc<Vec<TokenTree>>, sp: Span) -> TokenStream {
         let len = tts.len();
         TokenStream {
@@ -516,6 +555,7 @@ impl TokenStream {
         }
     }
 
+    // Construct a leaf node with the provided values.
     fn mk_sub_leaf(tts: Rc<Vec<TokenTree>>, offset: usize, len: usize, sp: Span) -> TokenStream {
         TokenStream {
             ts: InternalTS::Leaf {
@@ -527,6 +567,7 @@ impl TokenStream {
         }
     }
 
+    // Construct an internal node with the provided values.
     fn mk_int_node(left: Rc<InternalTS>,
                    right: Rc<InternalTS>,
                    len: usize,
@@ -561,11 +602,56 @@ impl TokenStream {
         }
     }
 
-    /// Concatenates two TokenStreams into a new TokenStream
+    /// Concatenates two TokenStreams into a new TokenStream.
     pub fn concat(left: TokenStream, right: TokenStream) -> TokenStream {
-        let new_len = left.len() + right.len();
-        let new_span = combine_spans(left.span(), right.span());
-        TokenStream::mk_int_node(Rc::new(left.ts), Rc::new(right.ts), new_len, new_span)
+        // This internal procedure performs 'aggressive compacting' during concatenation as
+        // follows:
+        // - If the nodes' combined total total length is less than 32, we copy both of
+        //   them into a new vector and build a new leaf node.
+        // - If one node is an internal node and the other is a 'small' leaf (length<32),
+        //   we recur down the internal node on the appropriate side.
+        // - Otherwise, we construct a new internal node that points to them as left and
+        // right.
+        fn concat_internal(left: Rc<InternalTS>, right: Rc<InternalTS>) -> TokenStream {
+            let llen = left.len();
+            let rlen = right.len();
+            let len = llen + rlen;
+            let span = combine_spans(left.span(), right.span());
+            if len <= LEAF_SIZE {
+                let mut new_vec = left.to_tts();
+                let mut rvec = right.to_tts();
+                new_vec.append(&mut rvec);
+                return TokenStream::mk_leaf(Rc::new(new_vec), span);
+            }
+
+            match (left.children(), right.children()) {
+                (Some((lleft, lright)), None) => {
+                    if rlen <= LEAF_SIZE  {
+                        let new_right = concat_internal(lright, right);
+                        TokenStream::mk_int_node(lleft, Rc::new(new_right.ts), len, span)
+                    } else {
+                       TokenStream::mk_int_node(left, right, len, span)
+                    }
+                }
+                (None, Some((rleft, rright))) => {
+                    if rlen <= LEAF_SIZE  {
+                        let new_left = concat_internal(left, rleft);
+                        TokenStream::mk_int_node(Rc::new(new_left.ts), rright, len, span)
+                    } else {
+                       TokenStream::mk_int_node(left, right, len, span)
+                    }
+                }
+                (_, _) => TokenStream::mk_int_node(left, right, len, span),
+            }
+        }
+
+        if left.is_empty() {
+            right
+        } else if right.is_empty() {
+            left
+        } else {
+            concat_internal(Rc::new(left.ts), Rc::new(right.ts))
+        }
     }
 
     /// Indicate if the TokenStream is empty.
@@ -580,27 +666,13 @@ impl TokenStream {
 
     /// Convert a TokenStream into a vector of borrowed TokenTrees.
     pub fn to_vec(&self) -> Vec<&TokenTree> {
-        fn internal_to_vec(ts: &InternalTS) -> Vec<&TokenTree> {
-            match *ts {
-                InternalTS::Empty(..) => Vec::new(),
-                InternalTS::Leaf { ref tts, offset, len, .. } => {
-                    tts[offset..offset + len].iter().collect()
-                }
-                InternalTS::Node { ref left, ref right, .. } => {
-                    let mut v1 = internal_to_vec(left);
-                    let mut v2 = internal_to_vec(right);
-                    v1.append(&mut v2);
-                    v1
-                }
-            }
-        }
-        internal_to_vec(&self.ts)
+        self.ts.to_vec()
     }
 
     /// Convert a TokenStream into a vector of TokenTrees (by cloning the TokenTrees).
     /// (This operation is an O(n) deep copy of the underlying structure.)
     pub fn to_tts(&self) -> Vec<TokenTree> {
-        self.to_vec().into_iter().cloned().collect::<Vec<TokenTree>>()
+        self.ts.to_tts()
     }
 
     /// Return the TokenStream's span.
diff --git a/src/libunwind/libunwind.rs b/src/libunwind/libunwind.rs
index 5e242db0a88..680ad3ecd64 100644
--- a/src/libunwind/libunwind.rs
+++ b/src/libunwind/libunwind.rs
@@ -60,7 +60,6 @@ pub const unwinder_private_data_size: usize = 2;
 pub const unwinder_private_data_size: usize = 2;
 
 #[cfg(target_arch = "asmjs")]
-// FIXME: Copied from arm. Need to confirm.
 pub const unwinder_private_data_size: usize = 20;
 
 #[repr(C)]
diff --git a/src/test/compile-fail/E0067.rs b/src/test/compile-fail/E0067.rs
index a3fc30ee1c7..56d2e828062 100644
--- a/src/test/compile-fail/E0067.rs
+++ b/src/test/compile-fail/E0067.rs
@@ -13,4 +13,6 @@ use std::collections::LinkedList;
 fn main() {
     LinkedList::new() += 1; //~ ERROR E0368
                             //~^ ERROR E0067
+                            //~^^ NOTE invalid expression for left-hand side
+                            //~| NOTE cannot use `+=` on type `std::collections::LinkedList<_>`
 }
diff --git a/src/test/compile-fail/E0094.rs b/src/test/compile-fail/E0094.rs
index 3a31874b244..d09353a2038 100644
--- a/src/test/compile-fail/E0094.rs
+++ b/src/test/compile-fail/E0094.rs
@@ -11,6 +11,7 @@
 #![feature(intrinsics)]
 extern "rust-intrinsic" {
     fn size_of<T, U>() -> usize; //~ ERROR E0094
+                                 //~| NOTE expected 1 type parameter
 }
 
 fn main() {
diff --git a/src/test/compile-fail/E0138.rs b/src/test/compile-fail/E0138.rs
index 97d85e5e71e..d4630d7c2ef 100644
--- a/src/test/compile-fail/E0138.rs
+++ b/src/test/compile-fail/E0138.rs
@@ -12,6 +12,9 @@
 
 #[start]
 fn foo(argc: isize, argv: *const *const u8) -> isize {}
+//~^ NOTE previous `start` function here
 
 #[start]
-fn f(argc: isize, argv: *const *const u8) -> isize {} //~ ERROR E0138
+fn f(argc: isize, argv: *const *const u8) -> isize {}
+//~^ ERROR E0138
+//~| NOTE multiple `start` functions
diff --git a/src/test/compile-fail/E0253.rs b/src/test/compile-fail/E0253.rs
index 28fcf4452b3..5a06c01241b 100644
--- a/src/test/compile-fail/E0253.rs
+++ b/src/test/compile-fail/E0253.rs
@@ -14,6 +14,8 @@ mod foo {
     }
 }
 
-use foo::MyTrait::do_something; //~ ERROR E0253
+use foo::MyTrait::do_something;
+    //~^ ERROR E0253
+    //~|NOTE cannot be imported directly
 
 fn main() {}
diff --git a/src/test/compile-fail/E0254.rs b/src/test/compile-fail/E0254.rs
index 28f9aea9657..3e4b7b9cad2 100644
--- a/src/test/compile-fail/E0254.rs
+++ b/src/test/compile-fail/E0254.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 extern crate collections;
+//~^ NOTE previous import of `collections` here
 
 mod foo {
     pub trait collections {
@@ -16,6 +17,8 @@ mod foo {
     }
 }
 
-use foo::collections; //~ ERROR E0254
+use foo::collections;
+//~^ ERROR E0254
+//~| NOTE already imported
 
 fn main() {}
diff --git a/src/test/compile-fail/E0267.rs b/src/test/compile-fail/E0267.rs
index 6287256e866..b58fbce8bc6 100644
--- a/src/test/compile-fail/E0267.rs
+++ b/src/test/compile-fail/E0267.rs
@@ -10,4 +10,5 @@
 
 fn main() {
     let w = || { break; }; //~ ERROR E0267
+            //~| NOTE cannot break inside of a closure
 }
diff --git a/src/test/compile-fail/E0268.rs b/src/test/compile-fail/E0268.rs
index 41e88e2f492..3313e07667a 100644
--- a/src/test/compile-fail/E0268.rs
+++ b/src/test/compile-fail/E0268.rs
@@ -10,4 +10,5 @@
 
 fn main() {
     break; //~ ERROR E0268
+    //~| NOTE cannot break outside of a loop
 }
diff --git a/src/test/compile-fail/E0301.rs b/src/test/compile-fail/E0301.rs
index 06e98289b0d..b7872509f54 100644
--- a/src/test/compile-fail/E0301.rs
+++ b/src/test/compile-fail/E0301.rs
@@ -12,6 +12,7 @@ fn main() {
     match Some(()) {
         None => { },
         option if option.take().is_none() => {}, //~ ERROR E0301
+        //~| NOTE borrowed mutably in pattern guard
         Some(_) => { }
     }
 }
diff --git a/src/test/compile-fail/E0302.rs b/src/test/compile-fail/E0302.rs
index 6a5ad40b109..5ad74fd6cab 100644
--- a/src/test/compile-fail/E0302.rs
+++ b/src/test/compile-fail/E0302.rs
@@ -12,6 +12,7 @@ fn main() {
     match Some(()) {
         None => { },
         option if { option = None; false } => { }, //~ ERROR E0302
+        //~| NOTE assignment in pattern guard
         Some(_) => { }
     }
 }
diff --git a/src/test/compile-fail/coercion-slice.rs b/src/test/compile-fail/coercion-slice.rs
index a619f33468f..6b468ff9662 100644
--- a/src/test/compile-fail/coercion-slice.rs
+++ b/src/test/compile-fail/coercion-slice.rs
@@ -15,5 +15,5 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected type `&[i32]`
     //~| found type `[{integer}; 1]`
-    //~| expected &-ptr, found array of 1 elements
+    //~| expected &[i32], found array of 1 elements
 }
diff --git a/src/test/compile-fail/cross-borrow-trait.rs b/src/test/compile-fail/cross-borrow-trait.rs
index ea9a29c0e2a..672ff464718 100644
--- a/src/test/compile-fail/cross-borrow-trait.rs
+++ b/src/test/compile-fail/cross-borrow-trait.rs
@@ -21,5 +21,5 @@ pub fn main() {
     let _y: &Trait = x; //~  ERROR mismatched types
                         //~| expected type `&Trait`
                         //~| found type `Box<Trait>`
-                        //~| expected &-ptr, found box
+                        //~| expected &Trait, found box
 }
diff --git a/src/test/compile-fail/destructure-trait-ref.rs b/src/test/compile-fail/destructure-trait-ref.rs
index d0a31fbce91..89fb1e10590 100644
--- a/src/test/compile-fail/destructure-trait-ref.rs
+++ b/src/test/compile-fail/destructure-trait-ref.rs
@@ -42,12 +42,12 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected type `T`
     //~| found type `&_`
-    //~| expected trait T, found &-ptr
+    //~| expected trait T, found reference
     let &&&x = &(&1isize as &T);
     //~^ ERROR mismatched types
     //~| expected type `T`
     //~| found type `&_`
-    //~| expected trait T, found &-ptr
+    //~| expected trait T, found reference
     let box box x = box 1isize as Box<T>;
     //~^ ERROR mismatched types
     //~| expected type `T`
diff --git a/src/test/compile-fail/dst-bad-coercions.rs b/src/test/compile-fail/dst-bad-coercions.rs
index b7a07e48799..883c16b0895 100644
--- a/src/test/compile-fail/dst-bad-coercions.rs
+++ b/src/test/compile-fail/dst-bad-coercions.rs
@@ -19,12 +19,12 @@ struct Foo<T: ?Sized> {
 }
 
 pub fn main() {
-    // Test that we cannot convert from *-ptr to &-ptr
+    // Test that we cannot convert from *-ptr to &S and &T
     let x: *const S = &S;
     let y: &S = x; //~ ERROR mismatched types
     let y: &T = x; //~ ERROR mismatched types
 
-    // Test that we cannot convert from *-ptr to &-ptr (mut version)
+    // Test that we cannot convert from *-ptr to &S and &T (mut version)
     let x: *mut S = &mut S;
     let y: &S = x; //~ ERROR mismatched types
     let y: &T = x; //~ ERROR mismatched types
diff --git a/src/test/compile-fail/issue-12997-2.rs b/src/test/compile-fail/issue-12997-2.rs
index 436d9e91dc7..276d7f7c9ed 100644
--- a/src/test/compile-fail/issue-12997-2.rs
+++ b/src/test/compile-fail/issue-12997-2.rs
@@ -17,4 +17,4 @@ fn bar(x: isize) { }
 //~^ ERROR mismatched types
 //~| expected type `fn(&mut __test::test::Bencher)`
 //~| found type `fn(isize) {bar}`
-//~| expected &-ptr, found isize
+//~| expected mutable reference, found isize
diff --git a/src/test/compile-fail/issue-16338.rs b/src/test/compile-fail/issue-16338.rs
index c6ce0c4c95b..a4517e60d66 100644
--- a/src/test/compile-fail/issue-16338.rs
+++ b/src/test/compile-fail/issue-16338.rs
@@ -18,5 +18,5 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected type `&str`
     //~| found type `Slice<_>`
-    //~| expected &-ptr, found struct `Slice`
+    //~| expected &str, found struct `Slice`
 }
diff --git a/src/test/compile-fail/issue-17033.rs b/src/test/compile-fail/issue-17033.rs
index 0ec05b941a9..1cd43cbb0f8 100644
--- a/src/test/compile-fail/issue-17033.rs
+++ b/src/test/compile-fail/issue-17033.rs
@@ -12,7 +12,7 @@ fn f<'r>(p: &'r mut fn(p: &mut ())) {
     (*p)(()) //~  ERROR mismatched types
              //~| expected type `&mut ()`
              //~| found type `()`
-             //~| expected &-ptr, found ()
+             //~| expected &mut (), found ()
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/issue-20225.rs b/src/test/compile-fail/issue-20225.rs
index b7845f1f116..f38961c427a 100644
--- a/src/test/compile-fail/issue-20225.rs
+++ b/src/test/compile-fail/issue-20225.rs
@@ -15,13 +15,13 @@ struct Foo;
 impl<'a, T> Fn<(&'a T,)> for Foo {
   extern "rust-call" fn call(&self, (_,): (T,)) {}
   //~^ ERROR: has an incompatible type for trait
-  //~| expected &-ptr
+  //~| expected reference
 }
 
 impl<'a, T> FnMut<(&'a T,)> for Foo {
   extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
   //~^ ERROR: has an incompatible type for trait
-  //~| expected &-ptr
+  //~| expected reference
 }
 
 impl<'a, T> FnOnce<(&'a T,)> for Foo {
@@ -29,7 +29,7 @@ impl<'a, T> FnOnce<(&'a T,)> for Foo {
 
   extern "rust-call" fn call_once(self, (_,): (T,)) {}
   //~^ ERROR: has an incompatible type for trait
-  //~| expected &-ptr
+  //~| expected reference
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/issue-26093.rs b/src/test/compile-fail/issue-26093.rs
index 2f43388b7af..39a53648ccf 100644
--- a/src/test/compile-fail/issue-26093.rs
+++ b/src/test/compile-fail/issue-26093.rs
@@ -12,6 +12,7 @@ macro_rules! not_an_lvalue {
     ($thing:expr) => {
         $thing = 42;
         //~^ ERROR invalid left-hand side expression
+        //~^^ NOTE left-hand of expression not valid
     }
 }
 
diff --git a/src/test/compile-fail/issue-29084.rs b/src/test/compile-fail/issue-29084.rs
index 00d2969a0f6..6cb6bbf1893 100644
--- a/src/test/compile-fail/issue-29084.rs
+++ b/src/test/compile-fail/issue-29084.rs
@@ -13,7 +13,7 @@ macro_rules! foo {
         fn bar(d: u8) { }
         bar(&mut $d);
         //~^ ERROR mismatched types
-        //~| expected u8, found &-ptr
+        //~| expected u8, found &mut u8
         //~| expected type `u8`
         //~| found type `&mut u8`
     }}
diff --git a/src/test/compile-fail/issue-5100.rs b/src/test/compile-fail/issue-5100.rs
index 9e78b7b947f..a1f5d74b30e 100644
--- a/src/test/compile-fail/issue-5100.rs
+++ b/src/test/compile-fail/issue-5100.rs
@@ -52,7 +52,7 @@ fn main() {
 //~^ ERROR mismatched types
 //~| expected type `(bool, bool)`
 //~| found type `&_`
-//~| expected tuple, found &-ptr
+//~| expected tuple, found reference
     }
 
 
diff --git a/src/test/compile-fail/issue-5500.rs b/src/test/compile-fail/issue-5500.rs
index cacbf7656de..1cbb7588e17 100644
--- a/src/test/compile-fail/issue-5500.rs
+++ b/src/test/compile-fail/issue-5500.rs
@@ -13,5 +13,5 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected type `()`
     //~| found type `&_`
-    //~| expected (), found &-ptr
+    //~| expected (), found reference
 }
diff --git a/src/test/compile-fail/issue-7061.rs b/src/test/compile-fail/issue-7061.rs
index 1519d71dd3b..da6f49f3efe 100644
--- a/src/test/compile-fail/issue-7061.rs
+++ b/src/test/compile-fail/issue-7061.rs
@@ -15,7 +15,7 @@ impl<'a> BarStruct {
     //~^ ERROR mismatched types
     //~| expected type `Box<BarStruct>`
     //~| found type `&'a mut BarStruct`
-    //~| expected box, found &-ptr
+    //~| expected box, found mutable reference
 }
 
 fn main() {}
diff --git a/src/test/compile-fail/issue-7867.rs b/src/test/compile-fail/issue-7867.rs
index ed465117344..7d9f8e90585 100644
--- a/src/test/compile-fail/issue-7867.rs
+++ b/src/test/compile-fail/issue-7867.rs
@@ -27,11 +27,11 @@ fn main() {
         //~^ ERROR mismatched types
         //~| expected type `&std::option::Option<{integer}>`
         //~| found type `std::option::Option<_>`
-        //~| expected &-ptr, found enum `std::option::Option`
+        //~| expected reference, found enum `std::option::Option`
         None => ()
         //~^ ERROR mismatched types
         //~| expected type `&std::option::Option<{integer}>`
         //~| found type `std::option::Option<_>`
-        //~| expected &-ptr, found enum `std::option::Option`
+        //~| expected reference, found enum `std::option::Option`
     }
 }
diff --git a/src/test/compile-fail/method-self-arg-1.rs b/src/test/compile-fail/method-self-arg-1.rs
index 03816362d46..4c8800878f0 100644
--- a/src/test/compile-fail/method-self-arg-1.rs
+++ b/src/test/compile-fail/method-self-arg-1.rs
@@ -21,7 +21,7 @@ fn main() {
     Foo::bar(x); //~  ERROR mismatched types
                  //~| expected type `&Foo`
                  //~| found type `Foo`
-                 //~| expected &-ptr, found struct `Foo`
+                 //~| expected &Foo, found struct `Foo`
     Foo::bar(&42); //~  ERROR mismatched types
                       //~| expected type `&Foo`
                       //~| found type `&{integer}`
diff --git a/src/test/compile-fail/overloaded-calls-bad.rs b/src/test/compile-fail/overloaded-calls-bad.rs
index 5865d93e128..1825ec61f1e 100644
--- a/src/test/compile-fail/overloaded-calls-bad.rs
+++ b/src/test/compile-fail/overloaded-calls-bad.rs
@@ -36,7 +36,7 @@ fn main() {
         y: 3,
     };
     let ans = s("what");    //~ ERROR mismatched types
-    //~^ NOTE expected isize, found &-ptr
+    //~^ NOTE expected isize, found reference
     //~| NOTE expected type
     //~| NOTE found type
     let ans = s();
diff --git a/src/test/compile-fail/pub-struct-field-span-26083.rs b/src/test/compile-fail/pub-struct-field-span-26083.rs
deleted file mode 100644
index 0dc7e09f0e4..00000000000
--- a/src/test/compile-fail/pub-struct-field-span-26083.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2015 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.
-
-// Regression test for issue #26083
-// Test that span for public struct fields start at `pub` instead of the identifier
-
-struct Foo {
-    pub bar: u8,
-
-    pub
-    //~^ error: field `bar` is already declared [E0124]
-    bar: u8,
-
-    pub bar:
-    //~^ error: field `bar` is already declared [E0124]
-    u8,
-
-    bar:
-    //~^ error: field `bar` is already declared [E0124]
-    u8,
-}
-
-fn main() { }
diff --git a/src/test/compile-fail/repeat_count.rs b/src/test/compile-fail/repeat_count.rs
index 555dd0f0c39..5d5113ce07c 100644
--- a/src/test/compile-fail/repeat_count.rs
+++ b/src/test/compile-fail/repeat_count.rs
@@ -38,7 +38,7 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected type `usize`
     //~| found type `&'static str`
-    //~| expected usize, found &-ptr
+    //~| expected usize, found reference
     //~| ERROR expected `usize` for repeat count, found string literal [E0306]
     //~| expected `usize`
     let f = [0; -4_isize];
diff --git a/src/test/run-pass-fulldeps/linkage-visibility.rs b/src/test/run-pass-fulldeps/linkage-visibility.rs
index e6eaefb0490..f884bb2098e 100644
--- a/src/test/run-pass-fulldeps/linkage-visibility.rs
+++ b/src/test/run-pass-fulldeps/linkage-visibility.rs
@@ -12,6 +12,7 @@
 // ignore-android: FIXME(#10356)
 // ignore-windows: std::dynamic_lib does not work on Windows well
 // ignore-musl
+// ignore-emscripten no dynamic linking
 
 extern crate linkage_visibility as foo;
 
diff --git a/src/test/run-pass-fulldeps/logging-enabled.rs b/src/test/run-pass-fulldeps/logging-enabled.rs
index 2975835a271..26261348020 100644
--- a/src/test/run-pass-fulldeps/logging-enabled.rs
+++ b/src/test/run-pass-fulldeps/logging-enabled.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // exec-env:RUST_LOG=logging_enabled=info
+// ignore-emscripten: FIXME(#31622)
 
 
 #![feature(rustc_private)]
diff --git a/src/test/run-pass-fulldeps/logging-separate-lines.rs b/src/test/run-pass-fulldeps/logging-separate-lines.rs
index 09759326afd..183a522bba7 100644
--- a/src/test/run-pass-fulldeps/logging-separate-lines.rs
+++ b/src/test/run-pass-fulldeps/logging-separate-lines.rs
@@ -11,6 +11,7 @@
 // ignore-windows
 // exec-env:RUST_LOG=debug
 // compile-flags:-C debug-assertions=y
+// ignore-emscripten: FIXME(#31622)
 
 #![feature(rustc_private)]
 
diff --git a/src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs b/src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs
index e9de95b95e5..460eab998c6 100644
--- a/src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs
+++ b/src/test/run-pass-fulldeps/quote-unused-sp-no-warning.rs
@@ -12,7 +12,7 @@
 // ignore-pretty: does not work well with `--test`
 
 #![feature(quote, rustc_private)]
-#![deny(unused_variable)]
+#![deny(unused_variables)]
 
 extern crate syntax;
 
diff --git a/src/test/run-pass/backtrace-debuginfo.rs b/src/test/run-pass/backtrace-debuginfo.rs
index f42a6ab162b..838005cbc91 100644
--- a/src/test/run-pass/backtrace-debuginfo.rs
+++ b/src/test/run-pass/backtrace-debuginfo.rs
@@ -17,6 +17,7 @@
 
 // compile-flags:-g -Cllvm-args=-enable-tail-merge=0
 // ignore-pretty as this critically relies on line numbers
+// ignore-emscripten spawning processes is not supported
 
 use std::io;
 use std::io::prelude::*;
diff --git a/src/test/run-pass/backtrace.rs b/src/test/run-pass/backtrace.rs
index f1ce17c0736..f26706d1754 100644
--- a/src/test/run-pass/backtrace.rs
+++ b/src/test/run-pass/backtrace.rs
@@ -10,6 +10,7 @@
 
 // no-pretty-expanded FIXME #15189
 // ignore-android FIXME #17520
+// ignore-emscripten spawning processes is not supported
 // compile-flags:-g
 
 use std::env;
diff --git a/src/test/run-pass/command-before-exec.rs b/src/test/run-pass/command-before-exec.rs
index 72f952fb6c0..5b83ce48e5d 100644
--- a/src/test/run-pass/command-before-exec.rs
+++ b/src/test/run-pass/command-before-exec.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-windows - this is a unix-specific test
+// ignore-emscripten
 
 #![feature(process_exec, libc)]
 
diff --git a/src/test/run-pass/command-exec.rs b/src/test/run-pass/command-exec.rs
index 039245bfd08..130526e72b1 100644
--- a/src/test/run-pass/command-exec.rs
+++ b/src/test/run-pass/command-exec.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-windows - this is a unix-specific test
+// ignore-emscripten
 // ignore-pretty
 
 #![feature(process_exec)]
diff --git a/src/test/run-pass/drop-flag-sanity-check.rs b/src/test/run-pass/drop-flag-sanity-check.rs
index f9e1b651a49..a8014768d78 100644
--- a/src/test/run-pass/drop-flag-sanity-check.rs
+++ b/src/test/run-pass/drop-flag-sanity-check.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // compile-flags: -Z force-dropflag-checks=on
+// ignore-emscripten
 
 // Quick-and-dirty test to ensure -Z force-dropflag-checks=on works as
 // expected. Note that the inlined drop-flag is slated for removal
diff --git a/src/test/run-pass/drop-trait-enum.rs b/src/test/run-pass/drop-trait-enum.rs
index ce675547a68..912cb4c5e87 100644
--- a/src/test/run-pass/drop-trait-enum.rs
+++ b/src/test/run-pass/drop-trait-enum.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
diff --git a/src/test/run-pass/enum-variants.rs b/src/test/run-pass/enum-variants.rs
index 77e6141d559..5eb7a243acf 100644
--- a/src/test/run-pass/enum-variants.rs
+++ b/src/test/run-pass/enum-variants.rs
@@ -11,7 +11,7 @@
 // pretty-expanded FIXME #23616
 
 #![allow(dead_assignment)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 enum Animal {
     Dog (String, f64),
diff --git a/src/test/run-pass/env-args-reverse-iterator.rs b/src/test/run-pass/env-args-reverse-iterator.rs
index d22fa6494f0..89af1db7c78 100644
--- a/src/test/run-pass/env-args-reverse-iterator.rs
+++ b/src/test/run-pass/env-args-reverse-iterator.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
+
 use std::env::args;
 use std::process::Command;
 
diff --git a/src/test/run-pass/env-home-dir.rs b/src/test/run-pass/env-home-dir.rs
index 2110f0b3bf9..bcb0c62d9fe 100644
--- a/src/test/run-pass/env-home-dir.rs
+++ b/src/test/run-pass/env-home-dir.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
 
 #![feature(path)]
 
diff --git a/src/test/run-pass/exec-env.rs b/src/test/run-pass/exec-env.rs
index d17056e6d79..a96d189afaa 100644
--- a/src/test/run-pass/exec-env.rs
+++ b/src/test/run-pass/exec-env.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // exec-env:TEST_EXEC_ENV=22
-
+// ignore-emscripten FIXME: issue #31622
 
 use std::env;
 
diff --git a/src/test/run-pass/fn-type-infer.rs b/src/test/run-pass/fn-type-infer.rs
index 3e1674a97e0..ad6c10611aa 100644
--- a/src/test/run-pass/fn-type-infer.rs
+++ b/src/test/run-pass/fn-type-infer.rs
@@ -10,7 +10,7 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 pub fn main() {
     // We should be able to type infer inside of ||s.
diff --git a/src/test/run-pass/generic-tag.rs b/src/test/run-pass/generic-tag.rs
index 942bdb97ba2..75fd9fcb7b6 100644
--- a/src/test/run-pass/generic-tag.rs
+++ b/src/test/run-pass/generic-tag.rs
@@ -11,7 +11,7 @@
 // pretty-expanded FIXME #23616
 
 #![allow(dead_assignment)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs
index 3f6f1aa6b5f..8efc4cb1b17 100644
--- a/src/test/run-pass/hashmap-memory.rs
+++ b/src/test/run-pass/hashmap-memory.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten No support for threads
+
 #![allow(unknown_features)]
 #![feature(std_misc)]
 
diff --git a/src/test/run-pass/intrinsic-alignment.rs b/src/test/run-pass/intrinsic-alignment.rs
index f1e4f8dfa8c..cfae9903a95 100644
--- a/src/test/run-pass/intrinsic-alignment.rs
+++ b/src/test/run-pass/intrinsic-alignment.rs
@@ -24,7 +24,8 @@ mod rusti {
           target_os = "dragonfly",
           target_os = "netbsd",
           target_os = "openbsd",
-          target_os = "solaris"))]
+          target_os = "solaris",
+          target_os = "emscripten"))]
 mod m {
     #[main]
     #[cfg(target_arch = "x86")]
diff --git a/src/test/run-pass/issue-10626.rs b/src/test/run-pass/issue-10626.rs
index c81e16ebb7c..b350bd1a4cc 100644
--- a/src/test/run-pass/issue-10626.rs
+++ b/src/test/run-pass/issue-10626.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
 
 // Make sure that if a process doesn't have its stdio/stderr descriptors set up
 // that we don't die in a large ball of fire
diff --git a/src/test/run-pass/issue-12133-3.rs b/src/test/run-pass/issue-12133-3.rs
index 66201ff901f..8f455c2fe4e 100644
--- a/src/test/run-pass/issue-12133-3.rs
+++ b/src/test/run-pass/issue-12133-3.rs
@@ -12,6 +12,7 @@
 // aux-build:issue-12133-dylib.rs
 // aux-build:issue-12133-dylib2.rs
 // ignore-musl
+// ignore-emscripten no dylib support
 
 // pretty-expanded FIXME #23616
 
diff --git a/src/test/run-pass/issue-12660.rs b/src/test/run-pass/issue-12660.rs
index 331f9d991d6..ebf390cfe4f 100644
--- a/src/test/run-pass/issue-12660.rs
+++ b/src/test/run-pass/issue-12660.rs
@@ -16,7 +16,7 @@ extern crate issue12660aux;
 
 use issue12660aux::{my_fn, MyStruct};
 
-#[allow(path_statement)]
+#[allow(path_statements)]
 fn main() {
     my_fn(MyStruct);
     MyStruct;
diff --git a/src/test/run-pass/issue-13304.rs b/src/test/run-pass/issue-13304.rs
index c260aa95b57..e1c2c5684fb 100644
--- a/src/test/run-pass/issue-13304.rs
+++ b/src/test/run-pass/issue-13304.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-aarch64
+// ignore-emscripten
 #![feature(io, process_capture)]
 
 use std::env;
diff --git a/src/test/run-pass/issue-14456.rs b/src/test/run-pass/issue-14456.rs
index 7e24c8f73ab..513ab91489c 100644
--- a/src/test/run-pass/issue-14456.rs
+++ b/src/test/run-pass/issue-14456.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
 
 #![feature(io, process_capture)]
 
diff --git a/src/test/run-pass/issue-1451.rs b/src/test/run-pass/issue-1451.rs
index 1cbe986e88a..b65a3a9ab70 100644
--- a/src/test/run-pass/issue-1451.rs
+++ b/src/test/run-pass/issue-1451.rs
@@ -10,7 +10,7 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 struct T { f: extern "Rust" fn() }
 struct S { f: extern "Rust" fn() }
diff --git a/src/test/run-pass/issue-14940.rs b/src/test/run-pass/issue-14940.rs
index ba6815d5b7c..ffe6b646794 100644
--- a/src/test/run-pass/issue-14940.rs
+++ b/src/test/run-pass/issue-14940.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
 
 use std::env;
 use std::process::Command;
diff --git a/src/test/run-pass/issue-16272.rs b/src/test/run-pass/issue-16272.rs
index 9562d113ada..d4f3d15b320 100644
--- a/src/test/run-pass/issue-16272.rs
+++ b/src/test/run-pass/issue-16272.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-aarch64
+// ignore-emscripten
 
 use std::process::Command;
 use std::env;
diff --git a/src/test/run-pass/issue-20091.rs b/src/test/run-pass/issue-20091.rs
index 1fe44348466..52c7911075a 100644
--- a/src/test/run-pass/issue-20091.rs
+++ b/src/test/run-pass/issue-20091.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-aarch64
+// ignore-emscripten
 #![feature(std_misc, os)]
 
 #[cfg(unix)]
diff --git a/src/test/run-pass/issue-2190-1.rs b/src/test/run-pass/issue-2190-1.rs
index 844826c45db..39375703514 100644
--- a/src/test/run-pass/issue-2190-1.rs
+++ b/src/test/run-pass/issue-2190-1.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // pretty-expanded FIXME #23616
+// ignore-emscripten
 
 use std::thread::Builder;
 
diff --git a/src/test/run-pass/issue-22894.rs b/src/test/run-pass/issue-22894.rs
new file mode 100644
index 00000000000..8acd88deef2
--- /dev/null
+++ b/src/test/run-pass/issue-22894.rs
@@ -0,0 +1,13 @@
+// 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.
+
+#[allow(dead_code)]
+static X: &'static str = &*"";
+fn main() {}
diff --git a/src/test/run-pass/issue-24313.rs b/src/test/run-pass/issue-24313.rs
index 9acfb04d781..9b2b474351d 100644
--- a/src/test/run-pass/issue-24313.rs
+++ b/src/test/run-pass/issue-24313.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
+
 use std::thread;
 use std::env;
 use std::process::Command;
diff --git a/src/test/run-pass/issue-28950.rs b/src/test/run-pass/issue-28950.rs
index efce148ea51..a905727afff 100644
--- a/src/test/run-pass/issue-28950.rs
+++ b/src/test/run-pass/issue-28950.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
 // compile-flags: -Z orbit=off
 // (blows the stack with MIR trans and no optimizations)
 
diff --git a/src/test/run-pass/issue-29485.rs b/src/test/run-pass/issue-29485.rs
index 9e8f5869437..9252762d1bd 100644
--- a/src/test/run-pass/issue-29485.rs
+++ b/src/test/run-pass/issue-29485.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // aux-build:issue-29485.rs
+// ignore-emscripten
 
 #[feature(recover)]
 
diff --git a/src/test/run-pass/issue-30490.rs b/src/test/run-pass/issue-30490.rs
index ea603fc665d..035911302cf 100644
--- a/src/test/run-pass/issue-30490.rs
+++ b/src/test/run-pass/issue-30490.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
+
 // Previously libstd would set stdio descriptors of a child process
 // by `dup`ing the requested descriptors to inherit directly into the
 // stdio descriptors. This, however, would incorrectly handle cases
diff --git a/src/test/run-pass/issue-33770.rs b/src/test/run-pass/issue-33770.rs
index f5635fddaf9..76728a0d354 100644
--- a/src/test/run-pass/issue-33770.rs
+++ b/src/test/run-pass/issue-33770.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
+
 use std::process::{Command, Stdio};
 use std::env;
 use std::sync::{Mutex, RwLock};
diff --git a/src/test/run-pass/issue-3878.rs b/src/test/run-pass/issue-3878.rs
index c98110b9054..5d094af2149 100644
--- a/src/test/run-pass/issue-3878.rs
+++ b/src/test/run-pass/issue-3878.rs
@@ -10,7 +10,7 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(path_statement)]
+#![allow(path_statements)]
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
diff --git a/src/test/run-pass/issue-4734.rs b/src/test/run-pass/issue-4734.rs
index 88a3b24d14f..9fb826712ad 100644
--- a/src/test/run-pass/issue-4734.rs
+++ b/src/test/run-pass/issue-4734.rs
@@ -12,7 +12,7 @@
 // `e` is a type which requires a destructor.
 
 
-#![allow(path_statement)]
+#![allow(path_statements)]
 
 struct A { n: isize }
 struct B;
diff --git a/src/test/run-pass/issue-7911.rs b/src/test/run-pass/issue-7911.rs
index 3eb593708be..5324ddb49e7 100644
--- a/src/test/run-pass/issue-7911.rs
+++ b/src/test/run-pass/issue-7911.rs
@@ -13,7 +13,7 @@
 // (Closes #7911) Test that we can use the same self expression
 // with different mutability in macro in two methods
 
-#![allow(unused_variable)] // unused foobar_immut + foobar_mut
+#![allow(unused_variables)] // unused foobar_immut + foobar_mut
 trait FooBar {
     fn dummy(&self) { }
 }
diff --git a/src/test/run-pass/linkage1.rs b/src/test/run-pass/linkage1.rs
index 0794a5e0daf..17abf9cb1f2 100644
--- a/src/test/run-pass/linkage1.rs
+++ b/src/test/run-pass/linkage1.rs
@@ -10,6 +10,7 @@
 
 // ignore-windows
 // ignore-macos
+// ignore-emscripten
 // aux-build:linkage1.rs
 
 #![feature(linkage)]
diff --git a/src/test/run-pass/liveness-assign-imm-local-after-loop.rs b/src/test/run-pass/liveness-assign-imm-local-after-loop.rs
index df89809ef1f..dfa08055046 100644
--- a/src/test/run-pass/liveness-assign-imm-local-after-loop.rs
+++ b/src/test/run-pass/liveness-assign-imm-local-after-loop.rs
@@ -12,7 +12,7 @@
 
 #![allow(dead_assignment)]
 #![allow(unreachable_code)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 fn test(_cond: bool) {
     let v: isize;
diff --git a/src/test/run-pass/long-while.rs b/src/test/run-pass/long-while.rs
index 6e0f1bb87a5..ce55c761202 100644
--- a/src/test/run-pass/long-while.rs
+++ b/src/test/run-pass/long-while.rs
@@ -10,7 +10,7 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 pub fn main() {
     let mut i: isize = 0;
diff --git a/src/test/run-pass/match-phi.rs b/src/test/run-pass/match-phi.rs
index ac070cb1f25..24185ffa412 100644
--- a/src/test/run-pass/match-phi.rs
+++ b/src/test/run-pass/match-phi.rs
@@ -11,7 +11,7 @@
 // pretty-expanded FIXME #23616
 
 #![allow(dead_assignment)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 enum thing { a, b, c, }
 
diff --git a/src/test/run-pass/multi-panic.rs b/src/test/run-pass/multi-panic.rs
index 93e2a854ccb..86fe06b1765 100644
--- a/src/test/run-pass/multi-panic.rs
+++ b/src/test/run-pass/multi-panic.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
+
 fn check_for_no_backtrace(test: std::process::Output) {
     assert!(!test.status.success());
     let err = String::from_utf8_lossy(&test.stderr);
diff --git a/src/test/run-pass/no-stdio.rs b/src/test/run-pass/no-stdio.rs
index 3658b6a508a..ad4d56ec50a 100644
--- a/src/test/run-pass/no-stdio.rs
+++ b/src/test/run-pass/no-stdio.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
+
 #![feature(libc)]
 
 extern crate libc;
diff --git a/src/test/run-pass/output-slot-variants.rs b/src/test/run-pass/output-slot-variants.rs
index 33489688d4a..4c3017c066e 100644
--- a/src/test/run-pass/output-slot-variants.rs
+++ b/src/test/run-pass/output-slot-variants.rs
@@ -11,7 +11,7 @@
 // pretty-expanded FIXME #23616
 
 #![allow(dead_assignment)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
diff --git a/src/test/run-pass/panic-handler-chain.rs b/src/test/run-pass/panic-handler-chain.rs
index 7c2e3f0c91b..1ad43f5f17f 100644
--- a/src/test/run-pass/panic-handler-chain.rs
+++ b/src/test/run-pass/panic-handler-chain.rs
@@ -7,6 +7,9 @@
 // <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.
+
+// ignore-emscripten no threads support
+
 #![feature(panic_handler, const_fn, std_panic)]
 
 use std::sync::atomic::{AtomicUsize, Ordering};
diff --git a/src/test/run-pass/process-exit.rs b/src/test/run-pass/process-exit.rs
index 9ef66ff2d71..a5d408448a0 100644
--- a/src/test/run-pass/process-exit.rs
+++ b/src/test/run-pass/process-exit.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
+
 use std::env;
 use std::process::{self, Command, Stdio};
 
diff --git a/src/test/run-pass/process-remove-from-env.rs b/src/test/run-pass/process-remove-from-env.rs
index 3096fe4a266..cce5ef4fe17 100644
--- a/src/test/run-pass/process-remove-from-env.rs
+++ b/src/test/run-pass/process-remove-from-env.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
 
 use std::process::Command;
 use std::env;
diff --git a/src/test/run-pass/process-spawn-with-unicode-params.rs b/src/test/run-pass/process-spawn-with-unicode-params.rs
index a155ee396b6..d3d847127ee 100644
--- a/src/test/run-pass/process-spawn-with-unicode-params.rs
+++ b/src/test/run-pass/process-spawn-with-unicode-params.rs
@@ -17,6 +17,7 @@
 // intact.
 
 // ignore-aarch64
+// ignore-emscripten
 
 use std::io::prelude::*;
 use std::io;
diff --git a/src/test/run-pass/rec-align-u64.rs b/src/test/run-pass/rec-align-u64.rs
index 2161864f0b6..4863979b3f6 100644
--- a/src/test/run-pass/rec-align-u64.rs
+++ b/src/test/run-pass/rec-align-u64.rs
@@ -42,7 +42,8 @@ struct Outer {
           target_os = "dragonfly",
           target_os = "netbsd",
           target_os = "openbsd",
-          target_os = "solaris"))]
+          target_os = "solaris",
+          target_os = "emscripten"))]
 mod m {
     #[cfg(target_arch = "x86")]
     pub mod m {
diff --git a/src/test/run-pass/regions-fn-subtyping.rs b/src/test/run-pass/regions-fn-subtyping.rs
index e5b652c306f..fc42fbc714c 100644
--- a/src/test/run-pass/regions-fn-subtyping.rs
+++ b/src/test/run-pass/regions-fn-subtyping.rs
@@ -13,7 +13,7 @@
 // pretty-expanded FIXME #23616
 
 #![allow(dead_assignment)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 #![allow(unknown_features)]
 
 // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
diff --git a/src/test/run-pass/running-with-no-runtime.rs b/src/test/run-pass/running-with-no-runtime.rs
index 23d5a08e216..f81c3f2e99d 100644
--- a/src/test/run-pass/running-with-no-runtime.rs
+++ b/src/test/run-pass/running-with-no-runtime.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
+
 #![feature(start)]
 
 use std::ffi::CStr;
diff --git a/src/test/run-pass/segfault-no-out-of-stack.rs b/src/test/run-pass/segfault-no-out-of-stack.rs
index 0158c4282da..df64d7140b4 100644
--- a/src/test/run-pass/segfault-no-out-of-stack.rs
+++ b/src/test/run-pass/segfault-no-out-of-stack.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten can't run commands
+
 #![feature(libc)]
 
 extern crate libc;
diff --git a/src/test/run-pass/signal-exit-status.rs b/src/test/run-pass/signal-exit-status.rs
index 51b369092f0..c7759ca743b 100644
--- a/src/test/run-pass/signal-exit-status.rs
+++ b/src/test/run-pass/signal-exit-status.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // ignore-windows
+// ignore-emscripten
 
 use std::env;
 use std::process::Command;
diff --git a/src/test/run-pass/sigpipe-should-be-ignored.rs b/src/test/run-pass/sigpipe-should-be-ignored.rs
index 7734a2e80c3..4eb4720e8d7 100644
--- a/src/test/run-pass/sigpipe-should-be-ignored.rs
+++ b/src/test/run-pass/sigpipe-should-be-ignored.rs
@@ -12,6 +12,7 @@
 // doesn't die in a ball of fire, but rather it's gracefully handled.
 
 // ignore-aarch64
+// ignore-emscripten
 
 use std::env;
 use std::io::prelude::*;
diff --git a/src/test/run-pass/sleep.rs b/src/test/run-pass/sleep.rs
index 8b06b02f3cb..9acc6ff8cf0 100644
--- a/src/test/run-pass/sleep.rs
+++ b/src/test/run-pass/sleep.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten no threads support
+
 use std::thread::{self, sleep};
 use std::time::Duration;
 use std::sync::{Arc, Mutex};
diff --git a/src/test/run-pass/traits-default-method-mut.rs b/src/test/run-pass/traits-default-method-mut.rs
index 3f61eb47233..bcdadb1d90d 100644
--- a/src/test/run-pass/traits-default-method-mut.rs
+++ b/src/test/run-pass/traits-default-method-mut.rs
@@ -11,7 +11,7 @@
 // pretty-expanded FIXME #23616
 
 #![allow(dead_assignment)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 trait Foo {
     fn foo(&self, mut v: isize) { v = 1; }
diff --git a/src/test/run-pass/typestate-cfg-nesting.rs b/src/test/run-pass/typestate-cfg-nesting.rs
index 86184f6cf0f..2acaff26269 100644
--- a/src/test/run-pass/typestate-cfg-nesting.rs
+++ b/src/test/run-pass/typestate-cfg-nesting.rs
@@ -11,7 +11,7 @@
 // pretty-expanded FIXME #23616
 
 #![allow(dead_assignment)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 fn f() {
     let x = 10; let mut y = 11;
diff --git a/src/test/run-pass/unique-move-drop.rs b/src/test/run-pass/unique-move-drop.rs
index 530ba478910..c2813771b7c 100644
--- a/src/test/run-pass/unique-move-drop.rs
+++ b/src/test/run-pass/unique-move-drop.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
diff --git a/src/test/run-pass/unit.rs b/src/test/run-pass/unit.rs
index 2679c4c0331..67eceba020c 100644
--- a/src/test/run-pass/unit.rs
+++ b/src/test/run-pass/unit.rs
@@ -10,7 +10,7 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 #![allow(dead_assignment)]
 
 fn f(u: ()) { return u; }
diff --git a/src/test/run-pass/unreachable-code-1.rs b/src/test/run-pass/unreachable-code-1.rs
index c1c069236c8..189c5cdb9b7 100644
--- a/src/test/run-pass/unreachable-code-1.rs
+++ b/src/test/run-pass/unreachable-code-1.rs
@@ -10,7 +10,7 @@
 
 
 #![allow(unreachable_code)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 fn id(x: bool) -> bool { x }
 
diff --git a/src/test/run-pass/unreachable-code.rs b/src/test/run-pass/unreachable-code.rs
index e19fda5f872..5cb5e8c4f99 100644
--- a/src/test/run-pass/unreachable-code.rs
+++ b/src/test/run-pass/unreachable-code.rs
@@ -9,9 +9,9 @@
 // except according to those terms.
 
 
-#![allow(path_statement)]
+#![allow(path_statements)]
 #![allow(unreachable_code)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 fn id(x: bool) -> bool { x }
 
diff --git a/src/test/run-pass/unused-move.rs b/src/test/run-pass/unused-move.rs
index 015b6f80946..e4b9d14fb4b 100644
--- a/src/test/run-pass/unused-move.rs
+++ b/src/test/run-pass/unused-move.rs
@@ -14,7 +14,7 @@
 
 // pretty-expanded FIXME #23616
 
-#![allow(path_statement)]
+#![allow(path_statements)]
 #![allow(unknown_features)]
 #![feature(box_syntax)]
 
diff --git a/src/test/run-pass/wait-forked-but-failed-child.rs b/src/test/run-pass/wait-forked-but-failed-child.rs
index 795c3f46f75..1d1c83cf12a 100644
--- a/src/test/run-pass/wait-forked-but-failed-child.rs
+++ b/src/test/run-pass/wait-forked-but-failed-child.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+// ignore-emscripten
 
 #![feature(libc)]
 
diff --git a/src/test/run-pass/while-loop-constraints-2.rs b/src/test/run-pass/while-loop-constraints-2.rs
index 6e339232475..6e9e7bc24d6 100644
--- a/src/test/run-pass/while-loop-constraints-2.rs
+++ b/src/test/run-pass/while-loop-constraints-2.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 #![allow(dead_assignment)]
-#![allow(unused_variable)]
+#![allow(unused_variables)]
 
 pub fn main() {
     let mut y: isize = 42;
diff --git a/src/test/run-pass/pred-not-bool.rs b/src/test/ui/span/pub-struct-field.rs
index f0f3d3d7bd8..9f8f871200c 100644
--- a/src/test/run-pass/pred-not-bool.rs
+++ b/src/test/ui/span/pub-struct-field.rs
@@ -1,4 +1,4 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// 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.
 //
@@ -8,11 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// this checks that a pred with a non-bool return
-// type is rejected, even if the pred is never used
+// Regression test for issue #26083 and #35435
+// Test that span for public struct fields start at `pub`
 
-// pretty-expanded FIXME #23616
+#![feature(pub_restricted)]
 
-fn bad(_a: isize) -> isize { return 37; } //~ ERROR Non-boolean return type
+struct Foo {
+    bar: u8,
+    pub bar: u8,
+    pub(crate) bar: u8,
+}
 
-pub fn main() { }
+fn main() {}
diff --git a/src/test/ui/span/pub-struct-field.stderr b/src/test/ui/span/pub-struct-field.stderr
new file mode 100644
index 00000000000..2c002c34736
--- /dev/null
+++ b/src/test/ui/span/pub-struct-field.stderr
@@ -0,0 +1,19 @@
+error[E0124]: field `bar` is already declared
+  --> $DIR/pub-struct-field.rs:18:5
+   |
+17 |     bar: u8,
+   |     ------- `bar` first declared here
+18 |     pub bar: u8,
+   |     ^^^^^^^^^^^ field already declared
+
+error[E0124]: field `bar` is already declared
+  --> $DIR/pub-struct-field.rs:19:5
+   |
+17 |     bar: u8,
+   |     ------- `bar` first declared here
+18 |     pub bar: u8,
+19 |     pub(crate) bar: u8,
+   |     ^^^^^^^^^^^^^^^^^^ field already declared
+
+error: aborting due to 2 previous errors
+
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index ae8e82e4e2f..e9ccc029bc3 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -137,10 +137,6 @@ impl<'test> TestCx<'test> {
 
         self.check_correct_failure_status(&proc_res);
 
-        if proc_res.status.success() {
-            self.fatal("process did not return an error status");
-        }
-
         let output_to_check = self.get_output(&proc_res);
         let expected_errors = errors::load_errors(&self.testpaths.file, self.revision);
         if !expected_errors.is_empty() {