diff --git a/mk/ctags.mk b/mk/ctags.mk
index a116f2aba6437..1fcb0bb4debbc 100644
--- a/mk/ctags.mk
+++ b/mk/ctags.mk
@@ -15,14 +15,21 @@
 
 .PHONY: TAGS.emacs TAGS.vi
 
-CTAGS_LOCATIONS=$(wildcard ${CFG_SRC_DIR}src/lib*)
+CTAGS_RUSTC_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/lib%test,, \
+				$(wildcard ${CFG_SRC_DIR}src/lib*)) ${CFG_SRC_DIR}src/libtest
 CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/librust%,, \
                 $(patsubst ${CFG_SRC_DIR}src/lib%test,, \
 				$(wildcard ${CFG_SRC_DIR}src/lib*))) ${CFG_SRC_DIR}src/libtest
-CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=Rust --recurse ${CTAGS_LOCATIONS}
+CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=Rust --recurse
+
+TAGS.rustc.emacs:
+	ctags -e -f $@ ${CTAGS_OPTS} ${CTAGS_RUSTC_LOCATIONS}
 
 TAGS.emacs:
-	ctags -e -f $@ ${CTAGS_OPTS}
+	ctags -e -f $@ ${CTAGS_OPTS} ${CTAGS_LOCATIONS}
+
+TAGS.rustc.vi:
+	ctags -f $@ ${CTAGS_OPTS} ${CTAGS_RUSTC_LOCATIONS}
 
 TAGS.vi:
-	ctags -f $@ ${CTAGS_OPTS}
+	ctags -f $@ ${CTAGS_OPTS} ${CTAGS_LOCATIONS}
diff --git a/mk/platform.mk b/mk/platform.mk
index 59c8f7726c92f..c2644621c571a 100644
--- a/mk/platform.mk
+++ b/mk/platform.mk
@@ -169,7 +169,7 @@ ifdef CFG_CCACHE_BASEDIR
   export CCACHE_BASEDIR
 endif
 
-FIND_COMPILER = $(word 1,$(1:ccache=))
+FIND_COMPILER = $(strip $(1:ccache=))
 
 define CFG_MAKE_TOOLCHAIN
   # Prepend the tools with their prefix if cross compiling
@@ -187,7 +187,7 @@ define CFG_MAKE_TOOLCHAIN
     endif
   endif
 
-  CFG_COMPILE_C_$(1) = '$$(CC_$(1))' \
+  CFG_COMPILE_C_$(1) = '$$(call FIND_COMPILER,$$(CC_$(1)))' \
         $$(CFLAGS) \
         $$(CFG_GCCISH_CFLAGS) \
         $$(CFG_GCCISH_CFLAGS_$(1)) \
@@ -198,7 +198,7 @@ define CFG_MAKE_TOOLCHAIN
         $$(CFG_GCCISH_LINK_FLAGS_$(1)) \
         $$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
         $$(call CFG_INSTALL_NAME_$(1),$$(4))
-  CFG_COMPILE_CXX_$(1) = '$$(CXX_$(1))' \
+  CFG_COMPILE_CXX_$(1) = '$$(call FIND_COMPILER,$$(CXX_$(1)))' \
         $$(CXXFLAGS) \
         $$(CFG_GCCISH_CFLAGS) \
         $$(CFG_GCCISH_CXXFLAGS) \
diff --git a/mk/tests.mk b/mk/tests.mk
index 90a7888af09c7..f2f3290ba6825 100644
--- a/mk/tests.mk
+++ b/mk/tests.mk
@@ -636,8 +636,8 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
         --host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
         --lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
         --target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
-	--cc '$$(CC_$(2))' \
-	--cxx '$$(CXX_$(2))' \
+	--cc '$$(call FIND_COMPILER,$$(CC_$(2)))' \
+	--cxx '$$(call FIND_COMPILER,$$(CXX_$(2)))' \
 	--cflags "$$(CFG_GCCISH_CFLAGS_$(2))" \
 	--llvm-components "$$(LLVM_ALL_COMPONENTS_$(2))" \
 	--llvm-cxxflags "$$(LLVM_CXXFLAGS_$(2))" \
diff --git a/src/bootstrap/build/job.rs b/src/bootstrap/build/job.rs
index a4e53bc45fcfb..4558e6f049432 100644
--- a/src/bootstrap/build/job.rs
+++ b/src/bootstrap/build/job.rs
@@ -54,7 +54,7 @@ pub unsafe fn setup() {
 
     // Indicate that when all handles to the job object are gone that all
     // process in the object should be killed. Note that this includes our
-    // entire process tree by default because we've added ourselves and and our
+    // entire process tree by default because we've added ourselves and our
     // children will reside in the job by default.
     let mut info = mem::zeroed::<JOBOBJECT_EXTENDED_LIMIT_INFORMATION>();
     info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
diff --git a/src/doc/reference.md b/src/doc/reference.md
index fcf9aefaba847..397abfe563c1f 100644
--- a/src/doc/reference.md
+++ b/src/doc/reference.md
@@ -2063,33 +2063,41 @@ arbitrarily complex configurations through nesting.
 
 The following configurations must be defined by the implementation:
 
-* `debug_assertions` - Enabled by default when compiling without optimizations.
-  This can be used to enable extra debugging code in development but not in
-  production.  For example, it controls the behavior of the standard library's
-  `debug_assert!` macro.
-* `target_arch = "..."` - Target CPU architecture, such as `"x86"`, `"x86_64"`
-  `"mips"`, `"powerpc"`, `"powerpc64"`, `"arm"`, or `"aarch64"`.
-* `target_endian = "..."` - Endianness of the target CPU, either `"little"` or
-  `"big"`.
-* `target_env = ".."` - An option provided by the compiler by default
-  describing the runtime environment of the target platform. Some examples of
-  this are `musl` for builds targeting the MUSL libc implementation, `msvc` for
-  Windows builds targeting MSVC, and `gnu` frequently the rest of the time. This
-  option may also be blank on some platforms.
+* `target_arch = "..."` - Target CPU architecture, such as `"x86"`,
+  `"x86_64"` `"mips"`, `"powerpc"`, `"powerpc64"`, `"arm"`, or
+  `"aarch64"`. This value is closely related to the first element of
+  the platform target triple, though it is not identical.
+* `target_os = "..."` - Operating system of the target, examples
+  include `"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`,
+  `"freebsd"`, `"dragonfly"`, `"bitrig"` , `"openbsd"` or
+  `"netbsd"`. This value is closely related to the second and third
+  element of the platform target triple, though it is not identical.
 * `target_family = "..."` - Operating system family of the target, e. g.
   `"unix"` or `"windows"`. The value of this configuration option is defined
   as a configuration itself, like `unix` or `windows`.
-* `target_os = "..."` - Operating system of the target, examples include
-  `"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"`,
-  `"bitrig"` , `"openbsd"` or `"netbsd"`.
+* `unix` - See `target_family`.
+* `windows` - See `target_family`.
+* `target_env = ".."` - Further disambiguates the target platform with
+  information about the ABI/libc. Presently this value is either
+  `"gnu"`, `"msvc"`, `"musl"`, or the empty string. For historical
+  reasons this value has only been defined as non-empty when needed
+  for disambiguation. Thus on many GNU platforms this value will be
+  empty. This value is closely related to the fourth element of the
+  platform target triple, though it is not identical. For example,
+  embedded ABIs such as `gnueabihf` will simply define `target_env` as
+  `"gnu"`.
+* `target_endian = "..."` - Endianness of the target CPU, either `"little"` or
+  `"big"`.
 * `target_pointer_width = "..."` - Target pointer width in bits. This is set
   to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
   64-bit pointers.
 * `target_vendor = "..."` - Vendor of the target, for example `apple`, `pc`, or
   simply `"unknown"`.
 * `test` - Enabled when compiling the test harness (using the `--test` flag).
-* `unix` - See `target_family`.
-* `windows` - See `target_family`.
+* `debug_assertions` - Enabled by default when compiling without optimizations.
+  This can be used to enable extra debugging code in development but not in
+  production.  For example, it controls the behavior of the standard library's
+  `debug_assert!` macro.
 
 You can also set another attribute based on a `cfg` variable with `cfg_attr`:
 
diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs
index 588ad7a319ac3..0f77ebb3c5745 100644
--- a/src/libcollections/slice.rs
+++ b/src/libcollections/slice.rs
@@ -419,8 +419,8 @@ impl<T> [T] {
     ///
     /// ```rust
     /// let v = &[1, 2, 3, 4, 5];
-    /// for win in v.chunks(2) {
-    ///     println!("{:?}", win);
+    /// for chunk in v.chunks(2) {
+    ///     println!("{:?}", chunk);
     /// }
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs
index 2033ae58d3804..b80f77c0d25a9 100644
--- a/src/libcore/iter/iterator.rs
+++ b/src/libcore/iter/iterator.rs
@@ -214,7 +214,7 @@ pub trait Iterator {
     /// Like most indexing operations, the count starts from zero, so `nth(0)`
     /// returns the first value, `nth(1)` the second, and so on.
     ///
-    /// `nth()` will return `None` if `n` is larger than the length of the
+    /// `nth()` will return `None` if `n` is greater than or equal to the length of the
     /// iterator.
     ///
     /// # Examples
@@ -237,7 +237,7 @@ pub trait Iterator {
     /// assert_eq!(iter.nth(1), None);
     /// ```
     ///
-    /// Returning `None` if there are less than `n` elements:
+    /// Returning `None` if there are less than `n + 1` elements:
     ///
     /// ```
     /// let a = [1, 2, 3];
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index 589ac90b308ad..af4ac482cf7d0 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -37,6 +37,17 @@ use slice::SliceExt;
 /// `wrapping_add`, or through the `Wrapping<T>` type, which says that
 /// all standard arithmetic operations on the underlying value are
 /// intended to have wrapping semantics.
+///
+/// # Examples
+///
+/// ```
+/// use std::num::Wrapping;
+///
+/// let zero = Wrapping(0u32);
+/// let one = Wrapping(1u32);
+///
+/// assert_eq!(std::u32::MAX, (zero - one).0);
+/// ```
 #[stable(feature = "rust1", since = "1.0.0")]
 #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Default, Hash)]
 pub struct Wrapping<T>(#[stable(feature = "rust1", since = "1.0.0")] pub T);
diff --git a/src/librustc/dep_graph/thread.rs b/src/librustc/dep_graph/thread.rs
index 5b0e4a909c8d3..b15e0e33b8402 100644
--- a/src/librustc/dep_graph/thread.rs
+++ b/src/librustc/dep_graph/thread.rs
@@ -176,6 +176,9 @@ pub fn main(swap_in: Receiver<Vec<DepMessage>>,
                 DepMessage::Query => query_out.send(edges.query()).unwrap(),
             }
         }
-        swap_out.send(messages).unwrap();
+        if let Err(_) = swap_out.send(messages) {
+            // the receiver must have been dropped already
+            break;
+        }
     }
 }
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs
index b8dd750d3f1c2..1a2c1b9a09528 100644
--- a/src/librustc/session/config.rs
+++ b/src/librustc/session/config.rs
@@ -1355,7 +1355,7 @@ pub mod nightly_options {
                     early_error(ErrorOutputType::default(), &msg);
                 }
                 OptionStability::UnstableButNotReally => {
-                    let msg = format!("the option `{}` is is unstable and should \
+                    let msg = format!("the option `{}` is unstable and should \
                                        only be used on the nightly compiler, but \
                                        it is currently accepted for backwards \
                                        compatibility; this will soon change, \
diff --git a/src/librustc/traits/project.rs b/src/librustc/traits/project.rs
index a0d6f5f912b2c..7fb13f49cb4a5 100644
--- a/src/librustc/traits/project.rs
+++ b/src/librustc/traits/project.rs
@@ -40,7 +40,7 @@ use std::rc::Rc;
 pub enum ProjectionMode {
     /// FIXME (#32205)
     /// At coherence-checking time, we're still constructing the
-    /// specialization graph, and thus we only project project
+    /// specialization graph, and thus we only project
     /// non-`default` associated types that are defined directly in
     /// the applicable impl. (This behavior should be improved over
     /// time, to allow for successful projections modulo cycles
diff --git a/src/librustc/ty/trait_def.rs b/src/librustc/ty/trait_def.rs
index faae95e711699..f194afaa81762 100644
--- a/src/librustc/ty/trait_def.rs
+++ b/src/librustc/ty/trait_def.rs
@@ -176,7 +176,7 @@ impl<'tcx> TraitDef<'tcx> {
     /// Records a trait-to-implementation mapping for a non-local impl.
     ///
     /// The `parent_impl` is the immediately-less-specialized impl, or the
-    /// trait's def ID if the impl is is not a specialization -- information that
+    /// trait's def ID if the impl is not a specialization -- information that
     /// should be pulled from the metadata.
     pub fn record_remote_impl(&self,
                               tcx: &TyCtxt<'tcx>,
diff --git a/src/librustc/ty/wf.rs b/src/librustc/ty/wf.rs
index f93332e07737d..7de83ef5cc920 100644
--- a/src/librustc/ty/wf.rs
+++ b/src/librustc/ty/wf.rs
@@ -268,7 +268,7 @@ impl<'a,'tcx> WfPredicates<'a,'tcx> {
     /// into `self.out`.
     fn compute_projection(&mut self, data: ty::ProjectionTy<'tcx>) {
         // A projection is well-formed if (a) the trait ref itself is
-        // WF WF and (b) the trait-ref holds.  (It may also be
+        // WF and (b) the trait-ref holds.  (It may also be
         // normalizable and be WF that way.)
 
         self.compute_trait_ref(&data.trait_ref);
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
index 3f75201aad2cc..0f40de56e0279 100644
--- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs
@@ -201,7 +201,7 @@ pub struct TargetOptions {
     pub post_link_args: Vec<String>,
 
     /// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults
-    /// to "default".
+    /// to "generic".
     pub cpu: String,
     /// Default target features to pass to LLVM. These features will *always* be
     /// passed, and cannot be disabled even via `-C`. Corresponds to `llc
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index 4aaeeed343016..3b25104437aee 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -352,7 +352,13 @@ fn handle_explain(code: &str,
     match descriptions.find_description(&normalised) {
         Some(ref description) => {
             // Slice off the leading newline and print.
-            print!("{}", &description[1..]);
+            print!("{}", &(&description[1..]).split("\n").map(|x| {
+                format!("{}\n", if x.starts_with("```") {
+                    "```"
+                } else {
+                    x
+                })
+            }).collect::<String>());
         }
         None => {
             early_error(output, &format!("no extended information for {}", code));
diff --git a/src/librustc_trans/intrinsic.rs b/src/librustc_trans/intrinsic.rs
index 1220fbafa29c9..7c5ce371ee919 100644
--- a/src/librustc_trans/intrinsic.rs
+++ b/src/librustc_trans/intrinsic.rs
@@ -1327,7 +1327,7 @@ fn generate_filter_fn<'a, 'tcx>(fcx: &FunctionContext<'a, 'tcx>,
     //          %ret = call i32 @the_real_filter_function(%ehptrs, %arg)
     //          ret i32 %ret
     //
-    // The recoverfp intrinsic is used to recover the frame frame pointer of the
+    // The recoverfp intrinsic is used to recover the frame pointer of the
     // `rust_try_fn` function, which is then in turn passed to the
     // `localrecover` intrinsic (pairing with the `localescape` intrinsic
     // mentioned above). Putting all this together means that we now have a
diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs
index 31d95af4fbb9c..b9f36a252c612 100644
--- a/src/librustc_typeck/check/method/mod.rs
+++ b/src/librustc_typeck/check/method/mod.rs
@@ -84,7 +84,8 @@ pub fn exists<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
                         span: Span,
                         method_name: ast::Name,
                         self_ty: ty::Ty<'tcx>,
-                        call_expr_id: ast::NodeId)
+                        call_expr_id: ast::NodeId,
+                        allow_private: bool)
                         -> bool
 {
     let mode = probe::Mode::MethodCall;
@@ -93,7 +94,7 @@ pub fn exists<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
         Err(NoMatch(..)) => false,
         Err(Ambiguity(..)) => true,
         Err(ClosureAmbiguity(..)) => true,
-        Err(PrivateMatch(..)) => true,
+        Err(PrivateMatch(..)) => allow_private,
     }
 }
 
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index 385f04b8564f5..68e65ac8b955a 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -2943,12 +2943,19 @@ fn check_expr_with_expectation_and_lvalue_pref<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
 
         if let Some((did, field_ty)) = private_candidate {
             let struct_path = fcx.tcx().item_path_str(did);
-            let msg = format!("field `{}` of struct `{}` is private", field.node, struct_path);
-            fcx.tcx().sess.span_err(expr.span, &msg);
             fcx.write_ty(expr.id, field_ty);
+            let msg = format!("field `{}` of struct `{}` is private", field.node, struct_path);
+            let mut err = fcx.tcx().sess.struct_span_err(expr.span, &msg);
+            // Also check if an accessible method exists, which is often what is meant.
+            if method::exists(fcx, field.span, field.node, expr_t, expr.id, false) {
+                err.fileline_note(field.span, &format!("a method called `{}` also exists, \
+                                                        maybe a `()` to call it is missing?",
+                                                       field.node));
+            }
+            err.emit();
         } else if field.node == keywords::Invalid.name() {
             fcx.write_error(expr.id);
-        } else if method::exists(fcx, field.span, field.node, expr_t, expr.id) {
+        } else if method::exists(fcx, field.span, field.node, expr_t, expr.id, true) {
             fcx.type_error_struct(field.span,
                                   |actual| {
                                        format!("attempted to take value of method `{}` on type \
diff --git a/src/libstd/net/ip.rs b/src/libstd/net/ip.rs
index adceee6d73ec5..019241982502e 100644
--- a/src/libstd/net/ip.rs
+++ b/src/libstd/net/ip.rs
@@ -371,7 +371,7 @@ impl Ipv6Addr {
     }
 
     /// Returns true if this is an address reserved for documentation
-    /// This is defined to be 2001:db8::/32 in RFC RFC 3849
+    /// This is defined to be 2001:db8::/32 in RFC 3849.
     pub fn is_documentation(&self) -> bool {
         (self.segments()[0] == 0x2001) && (self.segments()[1] == 0xdb8)
     }
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index 1d2516a4c4099..7a86e726b3a6a 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -215,12 +215,38 @@ impl Command {
     ///
     /// Builder methods are provided to change these defaults and
     /// otherwise configure the process.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// Command::new("sh")
+    ///         .spawn()
+    ///         .expect("sh command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn new<S: AsRef<OsStr>>(program: S) -> Command {
         Command { inner: imp::Command::new(program.as_ref()) }
     }
 
     /// Add an argument to pass to the program.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// Command::new("ls")
+    ///         .arg("-l")
+    ///         .arg("-a")
+    ///         .spawn()
+    ///         .expect("ls command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Command {
         self.inner.arg(arg.as_ref());
@@ -228,6 +254,19 @@ impl Command {
     }
 
     /// Add multiple arguments to pass to the program.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// Command::new("ls")
+    ///         .args(&["-l", "-a"])
+    ///         .spawn()
+    ///         .expect("ls command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn args<S: AsRef<OsStr>>(&mut self, args: &[S]) -> &mut Command {
         for arg in args {
@@ -240,6 +279,19 @@ impl Command {
     ///
     /// Note that environment variable names are case-insensitive (but case-preserving) on Windows,
     /// and case-sensitive on all other platforms.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// Command::new("ls")
+    ///         .env("PATH", "/bin")
+    ///         .spawn()
+    ///         .expect("ls command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn env<K, V>(&mut self, key: K, val: V) -> &mut Command
         where K: AsRef<OsStr>, V: AsRef<OsStr>
@@ -249,6 +301,19 @@ impl Command {
     }
 
     /// Removes an environment variable mapping.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// Command::new("ls")
+    ///         .env_remove("PATH")
+    ///         .spawn()
+    ///         .expect("ls command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn env_remove<K: AsRef<OsStr>>(&mut self, key: K) -> &mut Command {
         self.inner.env_remove(key.as_ref());
@@ -256,6 +321,19 @@ impl Command {
     }
 
     /// Clears the entire environment map for the child process.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// Command::new("ls")
+    ///         .env_clear()
+    ///         .spawn()
+    ///         .expect("ls command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn env_clear(&mut self) -> &mut Command {
         self.inner.env_clear();
@@ -263,6 +341,19 @@ impl Command {
     }
 
     /// Sets the working directory for the child process.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// Command::new("ls")
+    ///         .current_dir("/bin")
+    ///         .spawn()
+    ///         .expect("ls command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Command {
         self.inner.cwd(dir.as_ref().as_ref());
@@ -270,6 +361,19 @@ impl Command {
     }
 
     /// Configuration for the child process's stdin handle (file descriptor 0).
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::{Command, Stdio};
+    ///
+    /// Command::new("ls")
+    ///         .stdin(Stdio::null())
+    ///         .spawn()
+    ///         .expect("ls command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn stdin(&mut self, cfg: Stdio) -> &mut Command {
         self.inner.stdin(cfg.0);
@@ -277,6 +381,19 @@ impl Command {
     }
 
     /// Configuration for the child process's stdout handle (file descriptor 1).
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::{Command, Stdio};
+    ///
+    /// Command::new("ls")
+    ///         .stdout(Stdio::null())
+    ///         .spawn()
+    ///         .expect("ls command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn stdout(&mut self, cfg: Stdio) -> &mut Command {
         self.inner.stdout(cfg.0);
@@ -284,6 +401,19 @@ impl Command {
     }
 
     /// Configuration for the child process's stderr handle (file descriptor 2).
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::{Command, Stdio};
+    ///
+    /// Command::new("ls")
+    ///         .stderr(Stdio::null())
+    ///         .spawn()
+    ///         .expect("ls command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn stderr(&mut self, cfg: Stdio) -> &mut Command {
         self.inner.stderr(cfg.0);
@@ -293,6 +423,18 @@ impl Command {
     /// Executes the command as a child process, returning a handle to it.
     ///
     /// By default, stdin, stdout and stderr are inherited from the parent.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// Command::new("ls")
+    ///         .spawn()
+    ///         .expect("ls command failed to start");
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn spawn(&mut self) -> io::Result<Child> {
         self.inner.spawn(imp::Stdio::Inherit, true).map(Child::from_inner)
@@ -308,8 +450,10 @@ impl Command {
     ///
     /// ```should_panic
     /// use std::process::Command;
-    /// let output = Command::new("/bin/cat").arg("file.txt").output()
-    ///     .expect("failed to execute process");
+    /// let output = Command::new("/bin/cat")
+    ///                      .arg("file.txt")
+    ///                      .output()
+    ///                      .expect("failed to execute process");
     ///
     /// println!("status: {}", output.status);
     /// println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
@@ -333,8 +477,10 @@ impl Command {
     /// ```should_panic
     /// use std::process::Command;
     ///
-    /// let status = Command::new("/bin/cat").arg("file.txt").status()
-    ///     .expect("failed to execute process");
+    /// let status = Command::new("/bin/cat")
+    ///                      .arg("file.txt")
+    ///                      .status()
+    ///                      .expect("failed to execute process");
     ///
     /// println!("process exited with: {}", status);
     ///
@@ -469,12 +615,42 @@ impl fmt::Display for ExitStatus {
 impl Child {
     /// Forces the child to exit. This is equivalent to sending a
     /// SIGKILL on unix platforms.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// let mut command = Command::new("yes");
+    /// if let Ok(mut child) = command.spawn() {
+    ///     child.kill().expect("command wasn't running");
+    /// } else {
+    ///     println!("yes command didn't start");
+    /// }
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn kill(&mut self) -> io::Result<()> {
         self.handle.kill()
     }
 
     /// Returns the OS-assigned process identifier associated with this child.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// let mut command = Command::new("ls");
+    /// if let Ok(child) = command.spawn() {
+    ///     println!("Child's id is {}", child.id());
+    /// } else {
+    ///     println!("ls command didn't start");
+    /// }
+    /// ```
     #[stable(feature = "process_id", since = "1.3.0")]
     pub fn id(&self) -> u32 {
         self.handle.id()
@@ -488,6 +664,22 @@ impl Child {
     /// before waiting. This helps avoid deadlock: it ensures that the
     /// child does not block waiting for input from the parent, while
     /// the parent waits for the child to exit.
+    ///
+    /// # Examples
+    ///
+    /// Basic usage:
+    ///
+    /// ```no_run
+    /// use std::process::Command;
+    ///
+    /// let mut command = Command::new("ls");
+    /// if let Ok(mut child) = command.spawn() {
+    ///     child.wait().expect("command wasn't running");
+    ///     println!("Child has finished its execution!");
+    /// } else {
+    ///     println!("ls command didn't start");
+    /// }
+    /// ```
     #[stable(feature = "process", since = "1.0.0")]
     pub fn wait(&mut self) -> io::Result<ExitStatus> {
         drop(self.stdin.take());
diff --git a/src/libstd/sys/unix/process.rs b/src/libstd/sys/unix/process.rs
index 270c2096b2c3b..0500480add22f 100644
--- a/src/libstd/sys/unix/process.rs
+++ b/src/libstd/sys/unix/process.rs
@@ -147,7 +147,7 @@ impl Command {
         let new_key = pair_to_key(key, val, &mut self.saw_nul);
         let (map, envp) = self.init_env_map();
 
-        // If `key` is already present then we we just update `envp` in place
+        // If `key` is already present then we just update `envp` in place
         // (and store the owned value), but if it's not there we override the
         // trailing NULL pointer, add a new NULL pointer, and store where we
         // were located.
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs
index b3549dc12645a..2f0dec759b3d5 100644
--- a/src/libstd/thread/mod.rs
+++ b/src/libstd/thread/mod.rs
@@ -13,7 +13,8 @@
 //! ## The threading model
 //!
 //! An executing Rust program consists of a collection of native OS threads,
-//! each with their own stack and local state.
+//! each with their own stack and local state. Threads can be named, and
+//! provide some built-in support for low-level synchronization.
 //!
 //! Communication between threads can be done through
 //! [channels](../../std/sync/mpsc/index.html), Rust's message-passing
@@ -37,20 +38,6 @@
 //! convenient facilities for automatically waiting for the termination of a
 //! child thread (i.e., join).
 //!
-//! ## The `Thread` type
-//!
-//! Threads are represented via the `Thread` type, which you can
-//! get in one of two ways:
-//!
-//! * By spawning a new thread, e.g. using the `thread::spawn` function.
-//! * By requesting the current thread, using the `thread::current` function.
-//!
-//! Threads can be named, and provide some built-in support for low-level
-//! synchronization (described below).
-//!
-//! The `thread::current()` function is available even for threads not spawned
-//! by the APIs of this module.
-//!
 //! ## Spawning a thread
 //!
 //! A new thread can be spawned using the `thread::spawn` function:
@@ -99,6 +86,18 @@
 //! });
 //! ```
 //!
+//! ## The `Thread` type
+//!
+//! Threads are represented via the `Thread` type, which you can get in one of
+//! two ways:
+//!
+//! * By spawning a new thread, e.g. using the `thread::spawn` function, and
+//!   calling `thread()` on the `JoinHandle`.
+//! * By requesting the current thread, using the `thread::current` function.
+//!
+//! The `thread::current()` function is available even for threads not spawned
+//! by the APIs of this module.
+//!
 //! ## Blocking support: park and unpark
 //!
 //! Every thread is equipped with some basic low-level blocking support, via the
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 9cd2e6ef7d695..512b05582b481 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -6020,7 +6020,7 @@ impl<'a> Parser<'a> {
             // FOREIGN STATIC ITEM
             return Ok(Some(self.parse_item_foreign_static(visibility, lo, attrs)?));
         }
-        if self.check_keyword(keywords::Fn) || self.check_keyword(keywords::Unsafe) {
+        if self.check_keyword(keywords::Fn) {
             // FOREIGN FUNCTION ITEM
             return Ok(Some(self.parse_item_foreign_fn(visibility, lo, attrs)?));
         }
diff --git a/src/test/codegen-units/item-collection/cross-crate-closures.rs b/src/test/codegen-units/item-collection/cross-crate-closures.rs
index 30f3ef12d0743..546bb235a5f50 100644
--- a/src/test/codegen-units/item-collection/cross-crate-closures.rs
+++ b/src/test/codegen-units/item-collection/cross-crate-closures.rs
@@ -27,7 +27,7 @@ fn main() {
     //~ TRANS_ITEM fn cgu_extern_closures::inlined_fn_generic[0]::{{closure}}[0]<i32>
     let _ = cgu_extern_closures::inlined_fn_generic(3, 4, 5i32);
 
-    // Nothing should be generated for this call, we just link to the instance instance
+    // Nothing should be generated for this call, we just link to the instance
     // in the extern crate.
     let _ = cgu_extern_closures::non_inlined_fn(6, 7);
 }
diff --git a/src/test/compile-fail/issue-26472.rs b/src/test/compile-fail/issue-26472.rs
new file mode 100644
index 0000000000000..2ee6f1cdead8c
--- /dev/null
+++ b/src/test/compile-fail/issue-26472.rs
@@ -0,0 +1,24 @@
+// 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.
+
+mod sub {
+    pub struct S { len: usize }
+    impl S {
+        pub fn new() -> S { S { len: 0 } }
+        pub fn len(&self) -> usize { self.len }
+    }
+}
+
+fn main() {
+    let s = sub::S::new();
+    let v = s.len;
+    //~^ ERROR field `len` of struct `sub::S` is private
+    //~| NOTE a method called `len` also exists, maybe a `()` to call it is missing
+}
diff --git a/src/test/parse-fail/extern-no-fn.rs b/src/test/parse-fail/extern-no-fn.rs
index bf5cbe0c4592a..acf7187cf436f 100644
--- a/src/test/parse-fail/extern-no-fn.rs
+++ b/src/test/parse-fail/extern-no-fn.rs
@@ -11,7 +11,7 @@
 // compile-flags: -Z parse-only
 
 extern {
-    f(); //~ ERROR expected one of `fn`, `pub`, `static`, `unsafe`, or `}`, found `f`
+    f(); //~ ERROR expected one of `fn`, `pub`, `static`, or `}`, found `f`
 }
 
 fn main() {
diff --git a/src/test/parse-fail/removed-syntax-extern-const.rs b/src/test/parse-fail/removed-syntax-extern-const.rs
index c42fae71237da..e632af6c83b1d 100644
--- a/src/test/parse-fail/removed-syntax-extern-const.rs
+++ b/src/test/parse-fail/removed-syntax-extern-const.rs
@@ -12,5 +12,5 @@
 
 extern {
     const i: isize;
-    //~^ ERROR expected one of `fn`, `pub`, `static`, `unsafe`, or `}`, found `const`
+    //~^ ERROR expected one of `fn`, `pub`, `static`, or `}`, found `const`
 }
diff --git a/src/test/run-pass/regions-lub-ref-ref-rc.rs b/src/test/run-pass/regions-lub-ref-ref-rc.rs
index 41c64197acbe8..ade742863a9da 100644
--- a/src/test/run-pass/regions-lub-ref-ref-rc.rs
+++ b/src/test/run-pass/regions-lub-ref-ref-rc.rs
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // Test a corner case of LUB coercion. In this case, one arm of the
-// match requires a deref coercion and other other doesn't, and there
+// match requires a deref coercion and the other doesn't, and there
 // is an extra `&` on the `rc`. We want to be sure that the lifetime
 // assigned to this `&rc` value is not `'a` but something smaller.  In
 // other words, the type from `rc` is `&'a Rc<String>` and the type
diff --git a/src/tools/linkchecker/main.rs b/src/tools/linkchecker/main.rs
index 12419d4f7e5f7..a7c8c01fab850 100644
--- a/src/tools/linkchecker/main.rs
+++ b/src/tools/linkchecker/main.rs
@@ -110,7 +110,7 @@ fn walk(cache: &mut Cache,
             if let Some(pretty_path) = pretty_path {
                 let entry = cache.get_mut(&pretty_path).unwrap();
                 // we don't need the source anymore,
-                // so drop to to reduce memory-usage
+                // so drop to reduce memory-usage
                 entry.source = String::new();
             }
         }