about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-07 09:30:10 +0000
committerbors <bors@rust-lang.org>2018-04-07 09:30:10 +0000
commit04fef17143daad88bdc4314561e9c2eb5a364805 (patch)
treeb0bb324507ef843489202811b72d01947bd68c78 /src
parente0a9bd0f3cfd20694ff62ac8b74747adcdbbfa99 (diff)
parent24b3a979860efad7a69a432c0f1bcbf35b8bbab7 (diff)
downloadrust-04fef17143daad88bdc4314561e9c2eb5a364805.tar.gz
rust-04fef17143daad88bdc4314561e9c2eb5a364805.zip
Auto merge of #49753 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

Successful merges:

 - #49510 (Fix anchor position on fields)
 - #49652 (Fix anchors issue when everything is collapsed)
 - #49702 (std: Inline some Termination-related methods)
 - #49728 (add emit_debug_gdb_scripts target option and ..)
 - #49731 (add THUMB targets to rustup manifest)
 - #49742 (Using X headings instead of 0.X #49739)
 - #49748 (proc_macro: Improve Debug representations)
 - #49750 (bootstrap: Remove the fast path)
 - #49503 (Inject the `compiler_builtins` crate whenever the `core` crate is injected)

Failed merges:
Diffstat (limited to 'src')
-rw-r--r--src/Cargo.lock14
-rw-r--r--src/bootstrap/bootstrap.py5
-rw-r--r--src/doc/index.md24
-rw-r--r--src/liballoc/Cargo.toml1
-rw-r--r--src/liballoc_jemalloc/Cargo.toml1
-rw-r--r--src/liballoc_system/Cargo.toml1
-rw-r--r--src/libpanic_abort/Cargo.toml1
-rw-r--r--src/libpanic_unwind/Cargo.toml1
-rw-r--r--src/libproc_macro/lib.rs83
-rw-r--r--src/libproc_macro/quote.rs15
-rw-r--r--src/libprofiler_builtins/Cargo.toml1
-rw-r--r--src/librustc_asan/Cargo.toml1
-rw-r--r--src/librustc_back/target/apple_base.rs1
-rw-r--r--src/librustc_back/target/mod.rs6
-rw-r--r--src/librustc_back/target/msp430_none_elf.rs3
-rw-r--r--src/librustc_back/target/thumb_base.rs7
-rw-r--r--src/librustc_back/target/windows_base.rs1
-rw-r--r--src/librustc_back/target/windows_msvc_base.rs1
-rw-r--r--src/librustc_lsan/Cargo.toml1
-rw-r--r--src/librustc_msan/Cargo.toml1
-rw-r--r--src/librustc_trans/debuginfo/gdb.rs5
-rw-r--r--src/librustc_tsan/Cargo.toml1
-rw-r--r--src/librustdoc/html/static/main.js30
-rw-r--r--src/librustdoc/html/static/rustdoc.css3
-rw-r--r--src/librustdoc/html/static/storage.js3
-rw-r--r--src/libstd/lib.rs1
-rw-r--r--src/libstd/process.rs2
-rw-r--r--src/libstd/sys/unix/process/process_common.rs1
-rw-r--r--src/libstd/sys/windows/process.rs1
-rw-r--r--src/libstd_unicode/Cargo.toml1
-rw-r--r--src/libsyntax/print/pprust.rs2
-rw-r--r--src/libsyntax/std_inject.rs41
-rw-r--r--src/libunwind/Cargo.toml1
-rw-r--r--src/rustc/dlmalloc_shim/Cargo.toml1
-rw-r--r--src/rustc/libc_shim/Cargo.toml2
-rw-r--r--src/tools/build-manifest/src/main.rs4
36 files changed, 188 insertions, 80 deletions
diff --git a/src/Cargo.lock b/src/Cargo.lock
index f70fc81829f..004d1c0ffc9 100644
--- a/src/Cargo.lock
+++ b/src/Cargo.lock
@@ -10,6 +10,7 @@ dependencies = [
 name = "alloc"
 version = "0.0.0"
 dependencies = [
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
  "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "std_unicode 0.0.0",
@@ -23,6 +24,7 @@ dependencies = [
  "alloc_system 0.0.0",
  "build_helper 0.1.0",
  "cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
  "libc 0.0.0",
 ]
@@ -32,6 +34,7 @@ name = "alloc_system"
 version = "0.0.0"
 dependencies = [
  "alloc 0.0.0",
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
  "dlmalloc 0.0.0",
  "libc 0.0.0",
@@ -541,6 +544,7 @@ name = "dlmalloc"
 version = "0.0.0"
 dependencies = [
  "alloc 0.0.0",
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
 ]
 
@@ -976,6 +980,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 name = "libc"
 version = "0.0.0"
 dependencies = [
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
 ]
 
@@ -1254,6 +1259,7 @@ dependencies = [
 name = "panic_abort"
 version = "0.0.0"
 dependencies = [
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
  "libc 0.0.0",
 ]
@@ -1263,6 +1269,7 @@ name = "panic_unwind"
 version = "0.0.0"
 dependencies = [
  "alloc 0.0.0",
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
  "libc 0.0.0",
  "unwind 0.0.0",
@@ -1401,6 +1408,7 @@ name = "profiler_builtins"
 version = "0.0.0"
 dependencies = [
  "cc 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
 ]
 
@@ -1797,6 +1805,7 @@ dependencies = [
  "alloc_system 0.0.0",
  "build_helper 0.1.0",
  "cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
 ]
 
@@ -1942,6 +1951,7 @@ dependencies = [
  "alloc_system 0.0.0",
  "build_helper 0.1.0",
  "cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
 ]
 
@@ -1991,6 +2001,7 @@ dependencies = [
  "alloc_system 0.0.0",
  "build_helper 0.1.0",
  "cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
 ]
 
@@ -2130,6 +2141,7 @@ dependencies = [
  "alloc_system 0.0.0",
  "build_helper 0.1.0",
  "cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
 ]
 
@@ -2343,6 +2355,7 @@ dependencies = [
 name = "std_unicode"
 version = "0.0.0"
 dependencies = [
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
 ]
 
@@ -2725,6 +2738,7 @@ dependencies = [
 name = "unwind"
 version = "0.0.0"
 dependencies = [
+ "compiler_builtins 0.0.0",
  "core 0.0.0",
  "libc 0.0.0",
 ]
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index cf54591f25c..487440becf6 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -770,10 +770,7 @@ def bootstrap(help_triggered):
     if 'dev' in data:
         build.set_dev_environment()
 
-    # No help text depends on submodules. This check saves ~1 minute of git commands, even if
-    # all the submodules are present and downloaded!
-    if not help_triggered:
-        build.update_submodules()
+    build.update_submodules()
 
     # Fetch/build the bootstrap
     build.build = args.build or build.build_triple()
diff --git a/src/doc/index.md b/src/doc/index.md
index 2e36831d7e8..2ea889da1fd 100644
--- a/src/doc/index.md
+++ b/src/doc/index.md
@@ -13,65 +13,65 @@ unofficial documentation resources as well!
 Many of these resources take the form of "books"; we collectively call these
 "The Rust Bookshelf." Some are large, some are small.
 
-## Learn Rust
+# Learn Rust
 
 If you'd like to learn Rust, this is the spot for you! All of these resources
 assume that you have programmed before, but not in any specific language:
 
-### The Rust Programming Language
+## The Rust Programming Language
 
 Affectionately nicknamed "the book," [The Rust Programming
 Language](book/index.html) will give you an overview of the language from
 first principles. You'll build a few projects along the way, and by the end,
 you'll have a solid grasp of the language.
 
-### Rust By Example
+## Rust By Example
 
 If reading multiple hundreds of pages about a language isn't your style, then
 [Rust By Example](rust-by-example/index.html) has you covered. While the book talks about code with
 a lot of words, RBE shows off a bunch of code, and keeps the talking to a
 minimum. It also includes exercises!
 
-## Use Rust
+# Use Rust
 
 Once you've gotten familliar with the language, these resources can help you
 when you're actually using it day-to-day.
 
-### The Standard Library
+## The Standard Library
 
 Rust's standard library has [extensive API documentation](std/index.html),
 with explanations of how to use various things, as well as example code for
 accomplishing various tasks.
 
-### The Cargo Book
+## The Cargo Book
 
 [The Cargo Book](cargo/index.html) is a guide to Cargo, Rust's build tool and dependency manager.
 
-### The Rustdoc Book
+## The Rustdoc Book
 
 [The Rustdoc Book](rustdoc/index.html) describes our documentation tool, `rustdoc`.
 
-### Extended Error Listing
+## Extended Error Listing
 
 Many of Rust's errors come with error codes, and you can request extended
 diagnostics from the compiler on those errors. You can also [read them
 here](error-index.html), if you prefer to read them that way.
 
-## Master Rust
+# Master Rust
 
 Once you're quite familiar with the language, you may find these advanced
 resources useful.
 
-### The Reference
+## The Reference
 
 [The Reference](reference/index.html) is not a formal spec, but is more detailed and
 comprehensive than the book.
 
-### The Rustonomicon
+## The Rustonomicon
 
 [The Rustonomicon](nomicon/index.html) is your guidebook to the dark arts of unsafe
 Rust. It's also sometimes called "the 'nomicon."
 
-### The Unstable Book
+## The Unstable Book
 
 [The Unstable Book](unstable-book/index.html) has documentation for unstable features.
diff --git a/src/liballoc/Cargo.toml b/src/liballoc/Cargo.toml
index 3bf919b0c00..2eb8ea12604 100644
--- a/src/liballoc/Cargo.toml
+++ b/src/liballoc/Cargo.toml
@@ -10,6 +10,7 @@ path = "lib.rs"
 [dependencies]
 core = { path = "../libcore" }
 std_unicode = { path = "../libstd_unicode" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
 
 [dev-dependencies]
 rand = "0.4"
diff --git a/src/liballoc_jemalloc/Cargo.toml b/src/liballoc_jemalloc/Cargo.toml
index 6d7d83dd993..fd4a4553046 100644
--- a/src/liballoc_jemalloc/Cargo.toml
+++ b/src/liballoc_jemalloc/Cargo.toml
@@ -16,6 +16,7 @@ alloc = { path = "../liballoc" }
 alloc_system = { path = "../liballoc_system" }
 core = { path = "../libcore" }
 libc = { path = "../rustc/libc_shim" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
 
 [build-dependencies]
 build_helper = { path = "../build_helper" }
diff --git a/src/liballoc_system/Cargo.toml b/src/liballoc_system/Cargo.toml
index f9a57f7d97a..936e20a32e1 100644
--- a/src/liballoc_system/Cargo.toml
+++ b/src/liballoc_system/Cargo.toml
@@ -13,6 +13,7 @@ doc = false
 alloc = { path = "../liballoc" }
 core = { path = "../libcore" }
 libc = { path = "../rustc/libc_shim" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
 
 # See comments in the source for what this dependency is
 [target.'cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))'.dependencies]
diff --git a/src/libpanic_abort/Cargo.toml b/src/libpanic_abort/Cargo.toml
index e0eac41f49e..633d273b3b9 100644
--- a/src/libpanic_abort/Cargo.toml
+++ b/src/libpanic_abort/Cargo.toml
@@ -12,3 +12,4 @@ doc = false
 [dependencies]
 core = { path = "../libcore" }
 libc = { path = "../rustc/libc_shim" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
diff --git a/src/libpanic_unwind/Cargo.toml b/src/libpanic_unwind/Cargo.toml
index a978ea16e9e..74aaa4d5ae3 100644
--- a/src/libpanic_unwind/Cargo.toml
+++ b/src/libpanic_unwind/Cargo.toml
@@ -14,3 +14,4 @@ alloc = { path = "../liballoc" }
 core = { path = "../libcore" }
 libc = { path = "../rustc/libc_shim" }
 unwind = { path = "../libunwind" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs
index 32697e46a08..449b8fcfb2d 100644
--- a/src/libproc_macro/lib.rs
+++ b/src/libproc_macro/lib.rs
@@ -127,7 +127,8 @@ impl fmt::Display for TokenStream {
 #[stable(feature = "proc_macro_lib", since = "1.15.0")]
 impl fmt::Debug for TokenStream {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        self.0.fmt(f)
+        f.write_str("TokenStream ")?;
+        f.debug_list().entries(self.clone()).finish()
     }
 }
 
@@ -222,7 +223,7 @@ pub fn quote_span(span: Span) -> TokenStream {
 
 /// A region of source code, along with macro expansion information.
 #[unstable(feature = "proc_macro", issue = "38356")]
-#[derive(Copy, Clone, Debug)]
+#[derive(Copy, Clone)]
 pub struct Span(syntax_pos::Span);
 
 macro_rules! diagnostic_method {
@@ -334,6 +335,16 @@ impl Span {
     diagnostic_method!(help, Level::Help);
 }
 
+#[unstable(feature = "proc_macro", issue = "38356")]
+impl fmt::Debug for Span {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        write!(f, "{:?} bytes({}..{})",
+               self.0.ctxt(),
+               self.0.lo().0,
+               self.0.hi().0)
+    }
+}
+
 /// A line-column pair representing the start or end of a `Span`.
 #[unstable(feature = "proc_macro", issue = "38356")]
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
@@ -422,7 +433,7 @@ impl PartialEq<FileName> for SourceFile {
 
 /// A single token or a delimited sequence of token trees (e.g. `[1, (), ..]`).
 #[unstable(feature = "proc_macro", issue = "38356")]
-#[derive(Clone, Debug)]
+#[derive(Clone)]
 pub enum TokenTree {
     /// A delimited tokenstream
     Group(Group),
@@ -464,6 +475,20 @@ impl TokenTree {
 }
 
 #[unstable(feature = "proc_macro", issue = "38356")]
+impl fmt::Debug for TokenTree {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        // Each of these has the name in the struct type in the derived debug,
+        // so don't bother with an extra layer of indirection
+        match *self {
+            TokenTree::Group(ref tt) => tt.fmt(f),
+            TokenTree::Term(ref tt) => tt.fmt(f),
+            TokenTree::Op(ref tt) => tt.fmt(f),
+            TokenTree::Literal(ref tt) => tt.fmt(f),
+        }
+    }
+}
+
+#[unstable(feature = "proc_macro", issue = "38356")]
 impl From<Group> for TokenTree {
     fn from(g: Group) -> TokenTree {
         TokenTree::Group(g)
@@ -717,7 +742,8 @@ impl fmt::Display for Term {
 #[derive(Clone, Debug)]
 #[unstable(feature = "proc_macro", issue = "38356")]
 pub struct Literal {
-    token: token::Token,
+    lit: token::Lit,
+    suffix: Option<ast::Name>,
     span: Span,
 }
 
@@ -734,10 +760,9 @@ macro_rules! suffixed_int_literals {
         /// below.
         #[unstable(feature = "proc_macro", issue = "38356")]
         pub fn $name(n: $kind) -> Literal {
-            let lit = token::Lit::Integer(Symbol::intern(&n.to_string()));
-            let ty = Some(Symbol::intern(stringify!($kind)));
             Literal {
-                token: token::Literal(lit, ty),
+                lit: token::Lit::Integer(Symbol::intern(&n.to_string())),
+                suffix: Some(Symbol::intern(stringify!($kind))),
                 span: Span::call_site(),
             }
         }
@@ -759,9 +784,9 @@ macro_rules! unsuffixed_int_literals {
         /// below.
         #[unstable(feature = "proc_macro", issue = "38356")]
         pub fn $name(n: $kind) -> Literal {
-            let lit = token::Lit::Integer(Symbol::intern(&n.to_string()));
             Literal {
-                token: token::Literal(lit, None),
+                lit: token::Lit::Integer(Symbol::intern(&n.to_string())),
+                suffix: None,
                 span: Span::call_site(),
             }
         }
@@ -814,9 +839,9 @@ impl Literal {
         if !n.is_finite() {
             panic!("Invalid float literal {}", n);
         }
-        let lit = token::Lit::Float(Symbol::intern(&n.to_string()));
         Literal {
-            token: token::Literal(lit, None),
+            lit: token::Lit::Float(Symbol::intern(&n.to_string())),
+            suffix: None,
             span: Span::call_site(),
         }
     }
@@ -837,9 +862,9 @@ impl Literal {
         if !n.is_finite() {
             panic!("Invalid float literal {}", n);
         }
-        let lit = token::Lit::Float(Symbol::intern(&n.to_string()));
         Literal {
-            token: token::Literal(lit, Some(Symbol::intern("f32"))),
+            lit: token::Lit::Float(Symbol::intern(&n.to_string())),
+            suffix: Some(Symbol::intern("f32")),
             span: Span::call_site(),
         }
     }
@@ -859,9 +884,9 @@ impl Literal {
         if !n.is_finite() {
             panic!("Invalid float literal {}", n);
         }
-        let lit = token::Lit::Float(Symbol::intern(&n.to_string()));
         Literal {
-            token: token::Literal(lit, None),
+            lit: token::Lit::Float(Symbol::intern(&n.to_string())),
+            suffix: None,
             span: Span::call_site(),
         }
     }
@@ -882,9 +907,9 @@ impl Literal {
         if !n.is_finite() {
             panic!("Invalid float literal {}", n);
         }
-        let lit = token::Lit::Float(Symbol::intern(&n.to_string()));
         Literal {
-            token: token::Literal(lit, Some(Symbol::intern("f64"))),
+            lit: token::Lit::Float(Symbol::intern(&n.to_string())),
+            suffix: Some(Symbol::intern("f64")),
             span: Span::call_site(),
         }
     }
@@ -897,7 +922,8 @@ impl Literal {
             escaped.extend(ch.escape_debug());
         }
         Literal {
-            token: token::Literal(token::Lit::Str_(Symbol::intern(&escaped)), None),
+            lit: token::Lit::Str_(Symbol::intern(&escaped)),
+            suffix: None,
             span: Span::call_site(),
         }
     }
@@ -908,7 +934,8 @@ impl Literal {
         let mut escaped = String::new();
         escaped.extend(ch.escape_unicode());
         Literal {
-            token: token::Literal(token::Lit::Char(Symbol::intern(&escaped)), None),
+            lit: token::Lit::Char(Symbol::intern(&escaped)),
+            suffix: None,
             span: Span::call_site(),
         }
     }
@@ -919,7 +946,8 @@ impl Literal {
         let string = bytes.iter().cloned().flat_map(ascii::escape_default)
             .map(Into::<char>::into).collect::<String>();
         Literal {
-            token: token::Literal(token::Lit::ByteStr(Symbol::intern(&string)), None),
+            lit: token::Lit::ByteStr(Symbol::intern(&string)),
+            suffix: None,
             span: Span::call_site(),
         }
     }
@@ -1055,7 +1083,7 @@ impl TokenTree {
             Ident(ident, true) => {
                 tt!(Term::new(&format!("r#{}", ident), Span(span)))
             }
-            Literal(..) => tt!(self::Literal { token, span: Span(span) }),
+            Literal(lit, suffix) => tt!(self::Literal { lit, suffix, span: Span(span) }),
             DocComment(c) => {
                 let style = comments::doc_comment_style(&c.as_str());
                 let stripped = comments::strip_doc_comment_decoration(&c.as_str());
@@ -1111,33 +1139,36 @@ impl TokenTree {
                 return TokenTree::Token(tt.span.0, token).into();
             }
             self::TokenTree::Literal(self::Literal {
-                token: Literal(Lit::Integer(ref a), b),
+                lit: Lit::Integer(ref a),
+                suffix,
                 span,
             })
                 if a.as_str().starts_with("-") =>
             {
                 let minus = BinOp(BinOpToken::Minus);
                 let integer = Symbol::intern(&a.as_str()[1..]);
-                let integer = Literal(Lit::Integer(integer), b);
+                let integer = Literal(Lit::Integer(integer), suffix);
                 let a = TokenTree::Token(span.0, minus);
                 let b = TokenTree::Token(span.0, integer);
                 return vec![a, b].into_iter().collect()
             }
             self::TokenTree::Literal(self::Literal {
-                token: Literal(Lit::Float(ref a), b),
+                lit: Lit::Float(ref a),
+                suffix,
                 span,
             })
                 if a.as_str().starts_with("-") =>
             {
                 let minus = BinOp(BinOpToken::Minus);
                 let float = Symbol::intern(&a.as_str()[1..]);
-                let float = Literal(Lit::Float(float), b);
+                let float = Literal(Lit::Float(float), suffix);
                 let a = TokenTree::Token(span.0, minus);
                 let b = TokenTree::Token(span.0, float);
                 return vec![a, b].into_iter().collect()
             }
             self::TokenTree::Literal(tt) => {
-                return TokenTree::Token(tt.span.0, tt.token).into()
+                let token = Literal(tt.lit, tt.suffix);
+                return TokenTree::Token(tt.span.0, token).into()
             }
         };
 
diff --git a/src/libproc_macro/quote.rs b/src/libproc_macro/quote.rs
index cc8575b88be..a0ec6928094 100644
--- a/src/libproc_macro/quote.rs
+++ b/src/libproc_macro/quote.rs
@@ -208,13 +208,15 @@ macro_rules! literals {
                 match self {
                     $(LiteralKind::$i => {
                         Literal {
-                            token: token::Literal(token::Lit::$i(sym), suffix),
+                            lit: token::Lit::$i(sym),
+                            suffix,
                             span: contents.span,
                         }
                     })*
                     $(LiteralKind::$raw(n) => {
                         Literal {
-                            token: token::Literal(token::Lit::$raw(sym, n), suffix),
+                            lit: token::Lit::$raw(sym, n),
+                            suffix,
                             span: contents.span,
                         }
                     })*
@@ -224,16 +226,11 @@ macro_rules! literals {
 
         impl Literal {
             fn kind_contents_and_suffix(self) -> (LiteralKind, Term, Option<Term>) {
-                let (lit, suffix) = match self.token {
-                    token::Literal(lit, suffix) => (lit, suffix),
-                    _ => panic!("unsupported literal {:?}", self.token),
-                };
-
-                let (kind, contents) = match lit {
+                let (kind, contents) = match self.lit {
                     $(token::Lit::$i(contents) => (LiteralKind::$i, contents),)*
                     $(token::Lit::$raw(contents, n) => (LiteralKind::$raw(n), contents),)*
                 };
-                let suffix = suffix.map(|sym| Term::new(&sym.as_str(), self.span()));
+                let suffix = self.suffix.map(|sym| Term::new(&sym.as_str(), self.span()));
                 (kind, Term::new(&contents.as_str(), self.span()), suffix)
             }
         }
diff --git a/src/libprofiler_builtins/Cargo.toml b/src/libprofiler_builtins/Cargo.toml
index 04f456917b9..79192fbb681 100644
--- a/src/libprofiler_builtins/Cargo.toml
+++ b/src/libprofiler_builtins/Cargo.toml
@@ -13,6 +13,7 @@ doc = false
 
 [dependencies]
 core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
 
 [build-dependencies]
 cc = "1.0.1"
diff --git a/src/librustc_asan/Cargo.toml b/src/librustc_asan/Cargo.toml
index 8f8ef1cc4a0..34d8b75a5bf 100644
--- a/src/librustc_asan/Cargo.toml
+++ b/src/librustc_asan/Cargo.toml
@@ -17,3 +17,4 @@ cmake = "0.1.18"
 alloc = { path = "../liballoc" }
 alloc_system = { path = "../liballoc_system" }
 core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
diff --git a/src/librustc_back/target/apple_base.rs b/src/librustc_back/target/apple_base.rs
index 72173b62594..480de9ff486 100644
--- a/src/librustc_back/target/apple_base.rs
+++ b/src/librustc_back/target/apple_base.rs
@@ -47,6 +47,7 @@ pub fn opts() -> TargetOptions {
         exe_allocation_crate: super::maybe_jemalloc(),
         has_elf_tls: version >= (10, 7),
         abi_return_struct_as_int: true,
+        emit_debug_gdb_scripts: false,
         .. Default::default()
     }
 }
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
index 507243a58a5..592b27ac641 100644
--- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs
@@ -478,6 +478,9 @@ pub struct TargetOptions {
 
     /// Whether or not bitcode is embedded in object files
     pub embed_bitcode: bool,
+
+    /// Whether a .debug_gdb_scripts section will be added to the output object file
+    pub emit_debug_gdb_scripts: bool,
 }
 
 impl Default for TargetOptions {
@@ -550,6 +553,7 @@ impl Default for TargetOptions {
             codegen_backend: "llvm".to_string(),
             default_hidden_visibility: false,
             embed_bitcode: false,
+            emit_debug_gdb_scripts: true,
         }
     }
 }
@@ -799,6 +803,7 @@ impl Target {
         key!(codegen_backend);
         key!(default_hidden_visibility, bool);
         key!(embed_bitcode, bool);
+        key!(emit_debug_gdb_scripts, bool);
 
         if let Some(array) = obj.find("abi-blacklist").and_then(Json::as_array) {
             for name in array.iter().filter_map(|abi| abi.as_string()) {
@@ -1002,6 +1007,7 @@ impl ToJson for Target {
         target_option_val!(codegen_backend);
         target_option_val!(default_hidden_visibility);
         target_option_val!(embed_bitcode);
+        target_option_val!(emit_debug_gdb_scripts);
 
         if default.abi_blacklist != self.options.abi_blacklist {
             d.insert("abi-blacklist".to_string(), self.options.abi_blacklist.iter()
diff --git a/src/librustc_back/target/msp430_none_elf.rs b/src/librustc_back/target/msp430_none_elf.rs
index d0f512ae47c..31df9be0bc3 100644
--- a/src/librustc_back/target/msp430_none_elf.rs
+++ b/src/librustc_back/target/msp430_none_elf.rs
@@ -59,6 +59,9 @@ pub fn target() -> TargetResult {
             // too much overhead for such small target.
             trap_unreachable: false,
 
+            // See the thumb_base.rs file for an explanation of this value
+            emit_debug_gdb_scripts: false,
+
             .. Default::default( )
         }
     })
diff --git a/src/librustc_back/target/thumb_base.rs b/src/librustc_back/target/thumb_base.rs
index 6a8f52f5093..bb1fbfad261 100644
--- a/src/librustc_back/target/thumb_base.rs
+++ b/src/librustc_back/target/thumb_base.rs
@@ -53,6 +53,13 @@ pub fn opts() -> TargetOptions {
         // costs it involves.
         relocation_model: "static".to_string(),
         abi_blacklist: super::arm_base::abi_blacklist(),
+        // When this section is added a volatile load to its start address is also generated. This
+        // volatile load is a footgun as it can end up loading an invalid memory address, depending
+        // on how the user set up their linker scripts. This section adds pretty printer for stuff
+        // like std::Vec, which is not that used in no-std context, so it's best to left it out
+        // until we figure a way to add the pretty printers without requiring a volatile load cf.
+        // rust-lang/rust#44993.
+        emit_debug_gdb_scripts: false,
         .. Default::default()
     }
 }
diff --git a/src/librustc_back/target/windows_base.rs b/src/librustc_back/target/windows_base.rs
index 05b6247c951..971b21e062f 100644
--- a/src/librustc_back/target/windows_base.rs
+++ b/src/librustc_back/target/windows_base.rs
@@ -102,6 +102,7 @@ pub fn opts() -> TargetOptions {
         ],
         custom_unwind_resume: true,
         abi_return_struct_as_int: true,
+        emit_debug_gdb_scripts: false,
 
         .. Default::default()
     }
diff --git a/src/librustc_back/target/windows_msvc_base.rs b/src/librustc_back/target/windows_msvc_base.rs
index 34aa17267f8..06e879bec34 100644
--- a/src/librustc_back/target/windows_msvc_base.rs
+++ b/src/librustc_back/target/windows_msvc_base.rs
@@ -34,6 +34,7 @@ pub fn opts() -> TargetOptions {
         crt_static_allows_dylibs: true,
         crt_static_respected: true,
         abi_return_struct_as_int: true,
+        emit_debug_gdb_scripts: false,
 
         .. Default::default()
     }
diff --git a/src/librustc_lsan/Cargo.toml b/src/librustc_lsan/Cargo.toml
index 087c3162119..9c19b537426 100644
--- a/src/librustc_lsan/Cargo.toml
+++ b/src/librustc_lsan/Cargo.toml
@@ -17,3 +17,4 @@ cmake = "0.1.18"
 alloc = { path = "../liballoc" }
 alloc_system = { path = "../liballoc_system" }
 core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
diff --git a/src/librustc_msan/Cargo.toml b/src/librustc_msan/Cargo.toml
index 8d7279b29eb..17ec2b96438 100644
--- a/src/librustc_msan/Cargo.toml
+++ b/src/librustc_msan/Cargo.toml
@@ -17,3 +17,4 @@ cmake = "0.1.18"
 alloc = { path = "../liballoc" }
 alloc_system = { path = "../liballoc_system" }
 core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
diff --git a/src/librustc_trans/debuginfo/gdb.rs b/src/librustc_trans/debuginfo/gdb.rs
index 03e7c63dbca..0b4858c7ab0 100644
--- a/src/librustc_trans/debuginfo/gdb.rs
+++ b/src/librustc_trans/debuginfo/gdb.rs
@@ -83,7 +83,6 @@ pub fn needs_gdb_debug_scripts_section(cx: &CodegenCx) -> bool {
                             "omit_gdb_pretty_printer_section");
 
     !omit_gdb_pretty_printer_section &&
-    !cx.sess().target.target.options.is_like_osx &&
-    !cx.sess().target.target.options.is_like_windows &&
-    cx.sess().opts.debuginfo != NoDebugInfo
+    cx.sess().opts.debuginfo != NoDebugInfo &&
+    cx.sess().target.target.options.emit_debug_gdb_scripts
 }
diff --git a/src/librustc_tsan/Cargo.toml b/src/librustc_tsan/Cargo.toml
index 7b83985ba67..8bb67c0bbac 100644
--- a/src/librustc_tsan/Cargo.toml
+++ b/src/librustc_tsan/Cargo.toml
@@ -17,3 +17,4 @@ cmake = "0.1.18"
 alloc = { path = "../liballoc" }
 alloc_system = { path = "../liballoc_system" }
 core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 3c115e2b8ba..3a3fa833c23 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -56,6 +56,14 @@
         };
     }
 
+    function getPageId() {
+        var id = document.location.href.split('#')[1];
+        if (id) {
+            return id.split('?')[0].split('&')[0];
+        }
+        return null;
+    }
+
     function hasClass(elem, className) {
         if (elem && className && elem.className) {
             var elemClass = elem.className;
@@ -1643,7 +1651,7 @@
         }
     }
 
-    function toggleAllDocs() {
+    function toggleAllDocs(pageId) {
         var toggle = document.getElementById("toggle-all-docs");
         if (hasClass(toggle, "will-expand")) {
             updateLocalStorage("rustdoc-collapse", "false");
@@ -1664,12 +1672,12 @@
             toggle.title = "expand all docs";
 
             onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
-                collapseDocs(e, "hide");
+                collapseDocs(e, "hide", pageId);
             });
         }
     }
 
-    function collapseDocs(toggle, mode) {
+    function collapseDocs(toggle, mode, pageId) {
         if (!toggle || !toggle.parentNode) {
             return;
         }
@@ -1745,14 +1753,18 @@
                 }
             }
 
-            var relatedDoc = toggle.parentNode;
+            var parentElem = toggle.parentNode;
+            var relatedDoc = parentElem;
             var docblock = relatedDoc.nextElementSibling;
 
             while (!hasClass(relatedDoc, "impl-items")) {
                 relatedDoc = relatedDoc.nextElementSibling;
             }
 
-            if (!relatedDoc && !hasClass(docblock, "docblock")) {
+            if ((!relatedDoc && !hasClass(docblock, "docblock")) ||
+                (pageId && onEach(relatedDoc.childNodes, function(e) {
+                    return e.id === pageId;
+                }) === true)) {
                 return;
             }
 
@@ -1782,7 +1794,7 @@
         }
     }
 
-    function autoCollapseAllImpls() {
+    function autoCollapseAllImpls(pageId) {
         // Automatically minimize all non-inherent impls
         onEach(document.getElementsByClassName('impl'), function(n) {
             // inherent impl ids are like 'impl' or impl-<number>'
@@ -1790,7 +1802,7 @@
             if (!inherent) {
                 onEach(n.childNodes, function(m) {
                     if (hasClass(m, "collapse-toggle")) {
-                        collapseDocs(m, "hide");
+                        collapseDocs(m, "hide", pageId);
                     }
                 });
             }
@@ -1900,7 +1912,7 @@
         }
     })
 
-    autoCollapseAllImpls();
+    autoCollapseAllImpls(getPageId());
 
     function createToggleWrapper() {
         var span = document.createElement('span');
@@ -2030,7 +2042,7 @@
     };
 
     if (getCurrentValue("rustdoc-collapse") === "true") {
-        toggleAllDocs();
+        toggleAllDocs(getPageId());
     }
 }());
 
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 31a501d24e7..f4918033c8e 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -533,6 +533,9 @@ a {
 	left: -5px;
 }
 .small-section-header > .anchor {
+	left: -20px;
+}
+.small-section-header > .anchor:not(.field) {
 	left: -28px;
 }
 .anchor:before {
diff --git a/src/librustdoc/html/static/storage.js b/src/librustdoc/html/static/storage.js
index 2f4e203ebc5..4ef8349fa9c 100644
--- a/src/librustdoc/html/static/storage.js
+++ b/src/librustdoc/html/static/storage.js
@@ -19,10 +19,11 @@ function onEach(arr, func) {
     if (arr && arr.length > 0 && func) {
         for (var i = 0; i < arr.length; i++) {
             if (func(arr[i]) === true) {
-                break;
+                return true;
             }
         }
     }
+    return false;
 }
 
 function updateLocalStorage(name, value) {
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 6f6abfdd31e..f9041ac8546 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -373,6 +373,7 @@ extern crate unwind;
 
 // compiler-rt intrinsics
 #[doc(masked)]
+#[cfg(stage0)]
 extern crate compiler_builtins;
 
 // During testing, this crate is not actually the "real" std library, but rather
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index 40bc84f4bc1..92f0406c09b 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -1452,6 +1452,7 @@ pub trait Termination {
 
 #[unstable(feature = "termination_trait_lib", issue = "43301")]
 impl Termination for () {
+    #[inline]
     fn report(self) -> i32 { ExitCode::SUCCESS.report() }
 }
 
@@ -1481,6 +1482,7 @@ impl<E: fmt::Debug> Termination for Result<!, E> {
 
 #[unstable(feature = "termination_trait_lib", issue = "43301")]
 impl Termination for ExitCode {
+    #[inline]
     fn report(self) -> i32 {
         self.0.as_i32()
     }
diff --git a/src/libstd/sys/unix/process/process_common.rs b/src/libstd/sys/unix/process/process_common.rs
index b7f30600b8a..6396bb3a49e 100644
--- a/src/libstd/sys/unix/process/process_common.rs
+++ b/src/libstd/sys/unix/process/process_common.rs
@@ -404,6 +404,7 @@ impl ExitCode {
     pub const SUCCESS: ExitCode = ExitCode(EXIT_SUCCESS as _);
     pub const FAILURE: ExitCode = ExitCode(EXIT_FAILURE as _);
 
+    #[inline]
     pub fn as_i32(&self) -> i32 {
         self.0 as i32
     }
diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs
index afa8e3e1369..bd5507e8f89 100644
--- a/src/libstd/sys/windows/process.rs
+++ b/src/libstd/sys/windows/process.rs
@@ -414,6 +414,7 @@ impl ExitCode {
     pub const SUCCESS: ExitCode = ExitCode(EXIT_SUCCESS as _);
     pub const FAILURE: ExitCode = ExitCode(EXIT_FAILURE as _);
 
+    #[inline]
     pub fn as_i32(&self) -> i32 {
         self.0 as i32
     }
diff --git a/src/libstd_unicode/Cargo.toml b/src/libstd_unicode/Cargo.toml
index b3346dbe2fb..283070a0e2c 100644
--- a/src/libstd_unicode/Cargo.toml
+++ b/src/libstd_unicode/Cargo.toml
@@ -15,3 +15,4 @@ path = "tests/lib.rs"
 
 [dependencies]
 core = { path = "../libcore" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 8d42206c5cc..8168db19058 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -94,7 +94,7 @@ pub fn print_crate<'a>(cm: &'a CodeMap,
                        is_expanded: bool) -> io::Result<()> {
     let mut s = State::new_from_input(cm, sess, filename, input, out, ann, is_expanded);
 
-    if is_expanded && !std_inject::injected_crate_name().is_none() {
+    if is_expanded && std_inject::injected_crate_name().is_some() {
         // We need to print `#![no_std]` (and its feature gate) so that
         // compiling pretty-printed source won't inject libstd again.
         // However we don't want these attributes in the AST because
diff --git a/src/libsyntax/std_inject.rs b/src/libsyntax/std_inject.rs
index 63d7b3336a8..bba7a2d7377 100644
--- a/src/libsyntax/std_inject.rs
+++ b/src/libsyntax/std_inject.rs
@@ -44,27 +44,38 @@ thread_local! {
 }
 
 pub fn maybe_inject_crates_ref(mut krate: ast::Crate, alt_std_name: Option<&str>) -> ast::Crate {
-    let name = if attr::contains_name(&krate.attrs, "no_core") {
+    // the first name in this list is the crate name of the crate with the prelude
+    let names: &[&str] = if attr::contains_name(&krate.attrs, "no_core") {
         return krate;
     } else if attr::contains_name(&krate.attrs, "no_std") {
-        "core"
+        if attr::contains_name(&krate.attrs, "compiler_builtins") {
+            &["core"]
+        } else {
+            &["core", "compiler_builtins"]
+        }
     } else {
-        "std"
+        &["std"]
     };
 
-    INJECTED_CRATE_NAME.with(|opt_name| opt_name.set(Some(name)));
+    for name in names {
+        krate.module.items.insert(0, P(ast::Item {
+            attrs: vec![attr::mk_attr_outer(DUMMY_SP,
+                                            attr::mk_attr_id(),
+                                            attr::mk_word_item(ast::Ident::from_str("macro_use")))],
+            vis: dummy_spanned(ast::VisibilityKind::Inherited),
+            node: ast::ItemKind::ExternCrate(alt_std_name.map(Symbol::intern)),
+            ident: ast::Ident::from_str(name),
+            id: ast::DUMMY_NODE_ID,
+            span: DUMMY_SP,
+            tokens: None,
+        }));
+    }
 
-    krate.module.items.insert(0, P(ast::Item {
-        attrs: vec![attr::mk_attr_outer(DUMMY_SP,
-                                        attr::mk_attr_id(),
-                                        attr::mk_word_item(ast::Ident::from_str("macro_use")))],
-        vis: dummy_spanned(ast::VisibilityKind::Inherited),
-        node: ast::ItemKind::ExternCrate(alt_std_name.map(Symbol::intern)),
-        ident: ast::Ident::from_str(name),
-        id: ast::DUMMY_NODE_ID,
-        span: DUMMY_SP,
-        tokens: None,
-    }));
+    // the crates have been injected, the assumption is that the first one is the one with
+    // the prelude.
+    let name = names[0];
+
+    INJECTED_CRATE_NAME.with(|opt_name| opt_name.set(Some(name)));
 
     let span = ignored_span(DUMMY_SP);
     krate.module.items.insert(0, P(ast::Item {
diff --git a/src/libunwind/Cargo.toml b/src/libunwind/Cargo.toml
index fbd9789d2f5..4760461df64 100644
--- a/src/libunwind/Cargo.toml
+++ b/src/libunwind/Cargo.toml
@@ -14,3 +14,4 @@ doc = false
 [dependencies]
 core = { path = "../libcore" }
 libc = { path = "../rustc/libc_shim" }
+compiler_builtins = { path = "../rustc/compiler_builtins_shim" }
diff --git a/src/rustc/dlmalloc_shim/Cargo.toml b/src/rustc/dlmalloc_shim/Cargo.toml
index cf8440c40da..d2fe159d806 100644
--- a/src/rustc/dlmalloc_shim/Cargo.toml
+++ b/src/rustc/dlmalloc_shim/Cargo.toml
@@ -11,4 +11,5 @@ doc = false
 
 [dependencies]
 core = { path = "../../libcore" }
+compiler_builtins = { path = "../../rustc/compiler_builtins_shim" }
 alloc = { path = "../../liballoc" }
diff --git a/src/rustc/libc_shim/Cargo.toml b/src/rustc/libc_shim/Cargo.toml
index 0c04402124a..e77897d6433 100644
--- a/src/rustc/libc_shim/Cargo.toml
+++ b/src/rustc/libc_shim/Cargo.toml
@@ -29,6 +29,8 @@ doc = false
 #
 # See https://github.com/rust-lang/rfcs/pull/1133.
 core = { path = "../../libcore" }
+compiler_builtins = { path = "../compiler_builtins_shim" }
+
 
 [features]
 # Certain parts of libc are conditionally compiled differently than when used
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
index 0f482c95e05..9f238929215 100644
--- a/src/tools/build-manifest/src/main.rs
+++ b/src/tools/build-manifest/src/main.rs
@@ -90,6 +90,10 @@ static TARGETS: &'static [&'static str] = &[
     "sparc-unknown-linux-gnu",
     "sparc64-unknown-linux-gnu",
     "sparcv9-sun-solaris",
+    "thumbv6m-none-eabi",
+    "thumbv7em-none-eabi",
+    "thumbv7em-none-eabihf",
+    "thumbv7m-none-eabi",
     "wasm32-unknown-emscripten",
     "wasm32-unknown-unknown",
     "x86_64-apple-darwin",