From 8cd9c2b2599f37bc5d33ce461fb21c2b70bfbbff Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Thu, 31 Mar 2016 14:54:09 +0200 Subject: [PATCH 01/17] Stop re-exporting check_match::Constructor. --- src/librustc_const_eval/check_match.rs | 2 +- src/librustc_trans/_match.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index f00df1f671f8c..8420f9f4e77a5 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub use self::Constructor::*; +use self::Constructor::*; use self::Usefulness::*; use self::WitnessPreference::*; diff --git a/src/librustc_trans/_match.rs b/src/librustc_trans/_match.rs index f545ba2cbe056..f947235337d0b 100644 --- a/src/librustc_trans/_match.rs +++ b/src/librustc_trans/_match.rs @@ -189,7 +189,7 @@ use self::Opt::*; use self::FailureHandler::*; use llvm::{ValueRef, BasicBlockRef}; -use rustc_const_eval::check_match::{self, StaticInliner}; +use rustc_const_eval::check_match::{self, Constructor, StaticInliner}; use rustc_const_eval::{compare_lit_exprs, eval_const_expr}; use middle::def::{Def, DefMap}; use middle::def_id::DefId; @@ -609,19 +609,19 @@ fn enter_opt<'a, 'p, 'blk, 'tcx>( let _indenter = indenter(); let ctor = match opt { - &ConstantValue(ConstantExpr(expr), _) => check_match::ConstantValue( + &ConstantValue(ConstantExpr(expr), _) => Constructor::ConstantValue( eval_const_expr(bcx.tcx(), &expr) ), - &ConstantRange(ConstantExpr(lo), ConstantExpr(hi), _) => check_match::ConstantRange( + &ConstantRange(ConstantExpr(lo), ConstantExpr(hi), _) => Constructor::ConstantRange( eval_const_expr(bcx.tcx(), &lo), eval_const_expr(bcx.tcx(), &hi) ), &SliceLengthEqual(n, _) => - check_match::Slice(n), + Constructor::Slice(n), &SliceLengthGreaterOrEqual(before, after, _) => - check_match::SliceWithSubslice(before, after), + Constructor::SliceWithSubslice(before, after), &Variant(_, _, def_id, _) => - check_match::Constructor::Variant(def_id) + Constructor::Variant(def_id) }; let param_env = bcx.tcx().empty_parameter_environment(); @@ -1229,7 +1229,7 @@ fn compile_submatch_continue<'a, 'p, 'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, Some(field_vals) => { let pats = enter_match(bcx, dm, m, col, val, |pats| check_match::specialize(&mcx, pats, - &check_match::Single, col, + &Constructor::Single, col, field_vals.len()) ); let mut vals: Vec<_> = field_vals.into_iter() From a3329f5452b20fd611537e7db1a86a9fe115008a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Mu=CC=88ller?= Date: Sat, 9 Apr 2016 14:23:11 +0200 Subject: [PATCH 02/17] Don't read past limit for in BufRead instance of Take --- src/libstd/io/mod.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index bcce8ee6abf44..e6db558c8c4e2 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -1505,6 +1505,11 @@ impl Read for Take { #[stable(feature = "rust1", since = "1.0.0")] impl BufRead for Take { fn fill_buf(&mut self) -> Result<&[u8]> { + // Don't call into inner reader at all at EOF because it may still block + if self.limit == 0 { + return Ok(&[]); + } + let buf = self.inner.fill_buf()?; let cap = cmp::min(buf.len() as u64, self.limit) as usize; Ok(&buf[..cap]) @@ -1860,9 +1865,16 @@ mod tests { Err(io::Error::new(io::ErrorKind::Other, "")) } } + impl BufRead for R { + fn fill_buf(&mut self) -> io::Result<&[u8]> { + Err(io::Error::new(io::ErrorKind::Other, "")) + } + fn consume(&mut self, _amt: usize) { } + } let mut buf = [0; 1]; assert_eq!(0, R.take(0).read(&mut buf).unwrap()); + assert_eq!(b"", R.take(0).fill_buf().unwrap()); } fn cmp_bufread(mut br1: Br1, mut br2: Br2, exp: &[u8]) { From a4579c54b92f7ca949bba2c01dd65d19e8ea9cc3 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Sat, 9 Apr 2016 09:39:22 -0500 Subject: [PATCH 03/17] librustc_back: fix incorrect comment about RUST_TARGET_PATH The path `/etc/rustc/` is not the default last entry in RUST_TARGET_PATH. This was in RFC131 but was never implemented in rustc so it was removed as part of #31117 and rust-lang/rfcs#1473. Signed-off-by: Doug Goldstein --- src/librustc_back/target/mod.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index a8eac524971ba..0a9724d075c69 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -27,8 +27,7 @@ //! rustc will search each directory in the environment variable //! `RUST_TARGET_PATH` for a file named `TRIPLE.json`. The first one found will //! be loaded. If no file is found in any of those directories, a fatal error -//! will be given. `RUST_TARGET_PATH` includes `/etc/rustc` as its last entry, -//! to be searched by default. +//! will be given. //! //! Projects defining their own targets should use //! `--target=path/to/my-awesome-platform.json` instead of adding to From 3632278c8407023c482cc23179fc31bf7a05c83f Mon Sep 17 00:00:00 2001 From: Nick Platt Date: Sun, 10 Apr 2016 00:27:32 -0400 Subject: [PATCH 04/17] Add rustbuild option to use Ninja for LLVM build --- src/bootstrap/Cargo.lock | 4 ++-- src/bootstrap/Cargo.toml | 2 +- src/bootstrap/build/config.rs | 3 +++ src/bootstrap/build/native.rs | 3 +++ src/bootstrap/build/sanity.rs | 3 +++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock index c33838a146c2c..9bb3e79744bb6 100644 --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock @@ -3,7 +3,7 @@ name = "bootstrap" version = "0.0.0" dependencies = [ "build_helper 0.1.0", - "cmake 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "cmake 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "gcc 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", @@ -21,7 +21,7 @@ version = "0.1.0" [[package]] name = "cmake" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gcc 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 0d334219b4fe9..7b379e1c7b6b9 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -21,7 +21,7 @@ path = "rustdoc.rs" [dependencies] build_helper = { path = "../build_helper" } -cmake = "0.1.10" +cmake = "0.1.17" filetime = "0.1" num_cpus = "0.2" toml = "0.1" diff --git a/src/bootstrap/build/config.rs b/src/bootstrap/build/config.rs index 1e67c4a9a3e8d..9563a3629dad8 100644 --- a/src/bootstrap/build/config.rs +++ b/src/bootstrap/build/config.rs @@ -31,6 +31,7 @@ use toml::{Parser, Decoder, Value}; #[derive(Default)] pub struct Config { pub ccache: bool, + pub ninja: bool, pub verbose: bool, pub submodules: bool, pub compiler_docs: bool, @@ -107,6 +108,7 @@ struct Build { #[derive(RustcDecodable, Default)] struct Llvm { ccache: Option, + ninja: Option, assertions: Option, optimize: Option, version_check: Option, @@ -200,6 +202,7 @@ impl Config { if let Some(ref llvm) = toml.llvm { set(&mut config.ccache, llvm.ccache); + set(&mut config.ninja, llvm.ninja); set(&mut config.llvm_assertions, llvm.assertions); set(&mut config.llvm_optimize, llvm.optimize); set(&mut config.llvm_optimize, llvm.optimize); diff --git a/src/bootstrap/build/native.rs b/src/bootstrap/build/native.rs index bf0494bcd8c8c..91bc0924b1fef 100644 --- a/src/bootstrap/build/native.rs +++ b/src/bootstrap/build/native.rs @@ -43,6 +43,9 @@ pub fn llvm(build: &Build, target: &str) { // http://llvm.org/docs/CMake.html let mut cfg = cmake::Config::new(build.src.join("src/llvm")); + if build.config.ninja { + cfg.generator("Ninja"); + } cfg.target(target) .host(&build.config.build) .out_dir(&dst) diff --git a/src/bootstrap/build/sanity.rs b/src/bootstrap/build/sanity.rs index 6ce2749638841..50fd9c2453826 100644 --- a/src/bootstrap/build/sanity.rs +++ b/src/bootstrap/build/sanity.rs @@ -48,6 +48,9 @@ pub fn check(build: &mut Build) { } } need_cmd("cmake".as_ref()); + if build.config.ninja { + need_cmd("ninja".as_ref()) + } break } From 7dd0bebff406dae343b8ae1b242940284986526d Mon Sep 17 00:00:00 2001 From: Nick Platt Date: Sun, 10 Apr 2016 00:50:16 -0400 Subject: [PATCH 05/17] Remove redundant assignment --- src/bootstrap/build/config.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bootstrap/build/config.rs b/src/bootstrap/build/config.rs index 9563a3629dad8..98fdaae64a5f2 100644 --- a/src/bootstrap/build/config.rs +++ b/src/bootstrap/build/config.rs @@ -205,7 +205,6 @@ impl Config { set(&mut config.ninja, llvm.ninja); set(&mut config.llvm_assertions, llvm.assertions); set(&mut config.llvm_optimize, llvm.optimize); - set(&mut config.llvm_optimize, llvm.optimize); set(&mut config.llvm_version_check, llvm.version_check); set(&mut config.llvm_static_stdcpp, llvm.static_libstdcpp); } From 43a0f4119b8bdb6cc5a3c07ff201705186f84d82 Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Sun, 10 Apr 2016 06:59:19 -0700 Subject: [PATCH 06/17] Remove an extra command from the usage message --- src/librustc/session/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index 574c927bd75d2..4ea6baca36784 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -892,7 +892,7 @@ pub fn rustc_short_optgroups() -> Vec { opt::multi_s("L", "", "Add a directory to the library search path", "[KIND=]PATH"), opt::multi_s("l", "", "Link the generated crate(s) to the specified native - library NAME. The optional KIND can be one of, + library NAME. The optional KIND can be one of static, dylib, or framework. If omitted, dylib is assumed.", "[KIND=]NAME"), opt::multi_s("", "crate-type", "Comma separated list of types of crates From f0a1ea27ccf17e2f63c496e868aa7614842c077b Mon Sep 17 00:00:00 2001 From: Ulrik Sverdrup Date: Sun, 10 Apr 2016 20:09:26 +0200 Subject: [PATCH 07/17] Add test for is_char_boundary --- src/libcollectionstest/str.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/libcollectionstest/str.rs b/src/libcollectionstest/str.rs index 1150035eb4255..c89972668e96a 100644 --- a/src/libcollectionstest/str.rs +++ b/src/libcollectionstest/str.rs @@ -346,6 +346,22 @@ fn test_slice_fail() { &"中华Việt Nam"[0..2]; } + +#[test] +fn test_is_char_boundary() { + let s = "ศไทย中华Việt Nam β-release 🐱123"; + assert!(s.is_char_boundary(0)); + assert!(s.is_char_boundary(s.len())); + assert!(!s.is_char_boundary(s.len() + 1)); + for (i, ch) in s.char_indices() { + // ensure character locations are boundaries and continuation bytes are not + assert!(s.is_char_boundary(i), "{} is a char boundary in {:?}", i, s); + for j in 1..ch.len_utf8() { + assert!(!s.is_char_boundary(i + j), + "{} should not be a char boundary in {:?}", i + j, s); + } + } +} const LOREM_PARAGRAPH: &'static str = "\ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse quis lorem sit amet dolor \ ultricies condimentum. Praesent iaculis purus elit, ac malesuada quam malesuada in. Duis sed orci \ From fb8a808ab77d65a8d3ea3a5160d30309d7f2e028 Mon Sep 17 00:00:00 2001 From: Dave Huseby Date: Mon, 11 Apr 2016 01:14:30 -0700 Subject: [PATCH 08/17] i386-unknown-freebsd snap 235d774 --- src/snapshots.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/snapshots.txt b/src/snapshots.txt index 61dfd4f8f867d..3cf9f3e81e1ae 100644 --- a/src/snapshots.txt +++ b/src/snapshots.txt @@ -6,6 +6,7 @@ S 2016-03-18 235d774 winnt-i386 7703869608cc4192b8f1943e51b19ba1a03c0110 winnt-x86_64 8512b5ecc0c53a2cd3552e4f5688577de95cd978 openbsd-x86_64 c5b6feda38138a12cd5c05574b585dadebbb5e87 + freebsd-i386 b5a87e66e3e3eed5f0b68367ad22f25f0be2d4ea freebsd-x86_64 390b9a9f60f3d0d6a52c04d939a0355f572d03b3 S 2016-02-17 4d3eebf From 6f95d5b73defe8a4792cf6d4da7dc846f44984f3 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Mon, 11 Apr 2016 17:58:38 +0000 Subject: [PATCH 09/17] Bump to 1.10 --- mk/main.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/main.mk b/mk/main.mk index 9b8080f96610f..431de6a3f9c80 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -13,7 +13,7 @@ ###################################################################### # The version number -CFG_RELEASE_NUM=1.9.0 +CFG_RELEASE_NUM=1.10.0 # An optional number to put after the label, e.g. '.2' -> '-beta.2' # NB Make sure it starts with a dot to conform to semver pre-release From 3757a3786ca9ac21c385fda96baa2c0e457a2f52 Mon Sep 17 00:00:00 2001 From: rkjnsn Date: Mon, 11 Apr 2016 11:31:00 -0700 Subject: [PATCH 10/17] Fix conflicting link identifiers --- RELEASES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 5682960709ffa..6c76d13360f5a 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -130,7 +130,7 @@ Compatibility Notes numbers [no longer return platform-specific types][1.8r], but instead return widened integers. [RFC 1415]. * [Modules sourced from the filesystem cannot appear within arbitrary - blocks, but only within other modules][1.8m]. + blocks, but only within other modules][1.8mf]. * [`--cfg` compiler flags are parsed strictly as identifiers][1.8c]. * On Unix, [stack overflow triggers a runtime abort instead of a SIGSEGV][1.8so]. @@ -160,7 +160,7 @@ Compatibility Notes [1.8h]: https://github.com/rust-lang/rust/pull/31460 [1.8l]: https://github.com/rust-lang/rust/pull/31668 [1.8m]: https://github.com/rust-lang/rust/pull/31020 -[1.8m]: https://github.com/rust-lang/rust/pull/31534 +[1.8mf]: https://github.com/rust-lang/rust/pull/31534 [1.8mp]: https://github.com/rust-lang/rust/pull/30894 [1.8mr]: https://users.rust-lang.org/t/multirust-0-8-with-cross-std-installation/4901 [1.8ms]: https://github.com/rust-lang/rust/pull/30448 From 0c8a7f293d212871ef4da0be012f00a00d4dbe39 Mon Sep 17 00:00:00 2001 From: Szabolcs Berecz Date: Tue, 12 Apr 2016 01:18:35 +0200 Subject: [PATCH 11/17] Clarify try! doc example The original is correct, but a bit misleading. --- src/libcore/macros.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index f923668688b8c..ad90b44750854 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -182,7 +182,7 @@ macro_rules! debug_assert_eq { /// fn write_to_file_using_match() -> Result<(), io::Error> { /// let mut file = try!(File::create("my_best_friends.txt")); /// match file.write_all(b"This is a list of my best friends.") { -/// Ok(_) => (), +/// Ok(v) => v, /// Err(e) => return Err(e), /// } /// println!("I wrote to the file"); From 647e73dc0a6348210ea7c36c8404e07e518c7169 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 12 Apr 2016 00:14:03 +0000 Subject: [PATCH 12/17] Fix beta branch This test tests a message that is only displayed on nightly. --- src/test/compile-fail/feature-gate-try-operator.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/test/compile-fail/feature-gate-try-operator.rs b/src/test/compile-fail/feature-gate-try-operator.rs index 184aa63b23426..b05c7323962c5 100644 --- a/src/test/compile-fail/feature-gate-try-operator.rs +++ b/src/test/compile-fail/feature-gate-try-operator.rs @@ -14,7 +14,5 @@ macro_rules! id { fn main() { id!(x?); //~ error: the `?` operator is not stable (see issue #31436) - //~^ help: add #![feature(question_mark)] to the crate attributes to enable y?; //~ error: the `?` operator is not stable (see issue #31436) - //~^ help: add #![feature(question_mark)] to the crate attributes to enable } From 327ce2ecf9b067389694aabacb1fb9e5aa37f193 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 13 Apr 2016 16:13:24 +0530 Subject: [PATCH 13/17] Make librustc_mir pass rustdoc --- src/librustc_mir/traversal.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/librustc_mir/traversal.rs b/src/librustc_mir/traversal.rs index 8b6821136f511..c58b5c8772461 100644 --- a/src/librustc_mir/traversal.rs +++ b/src/librustc_mir/traversal.rs @@ -19,6 +19,8 @@ use rustc::mir::repr::*; /// Preorder traversal is when each node is visited before an of it's /// successors /// +/// ```text +/// /// A /// / \ /// / \ @@ -26,6 +28,7 @@ use rustc::mir::repr::*; /// \ / /// \ / /// D +/// ``` /// /// A preorder traversal of this graph is either `A B D C` or `A C D B` #[derive(Clone)] @@ -80,6 +83,9 @@ impl<'a, 'tcx> Iterator for Preorder<'a, 'tcx> { /// Postorder traversal is when each node is visited after all of it's /// successors, except when the successor is only reachable by a back-edge /// +/// +/// ```text +/// /// A /// / \ /// / \ @@ -87,6 +93,7 @@ impl<'a, 'tcx> Iterator for Preorder<'a, 'tcx> { /// \ / /// \ / /// D +/// ``` /// /// A Postorder traversal of this graph is `D B C A` or `D C B A` pub struct Postorder<'a, 'tcx: 'a> { @@ -215,6 +222,8 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> { /// This is different to a preorder traversal and represents a natural /// linearisation of control-flow. /// +/// ```text +/// /// A /// / \ /// / \ @@ -222,6 +231,7 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> { /// \ / /// \ / /// D +/// ``` /// /// A reverse postorder traversal of this graph is either `A B C D` or `A C B D` /// Note that for a graph containing no loops (i.e. A DAG), this is equivalent to From 3e93a6e2655f36aab5ea69f9f8c250ef8ecda73e Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 13 Apr 2016 16:16:14 +0530 Subject: [PATCH 14/17] Make librustc_mir pass rustdoc --test --- src/librustc_mir/build/matches/mod.rs | 2 +- src/librustc_mir/build/matches/util.rs | 4 ++++ src/librustc_mir/build/scope.rs | 2 +- src/librustc_mir/pretty.rs | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/librustc_mir/build/matches/mod.rs b/src/librustc_mir/build/matches/mod.rs index cabf5c955466c..ccb2099dcc75d 100644 --- a/src/librustc_mir/build/matches/mod.rs +++ b/src/librustc_mir/build/matches/mod.rs @@ -434,7 +434,7 @@ impl<'a,'tcx> Builder<'a,'tcx> { /// But there may also be candidates that the test just doesn't /// apply to. For example, consider the case of #29740: /// - /// ```rust + /// ```rust,ignore /// match x { /// "foo" => ..., /// "bar" => ..., diff --git a/src/librustc_mir/build/matches/util.rs b/src/librustc_mir/build/matches/util.rs index 101d7594309a9..e5f2c7543786e 100644 --- a/src/librustc_mir/build/matches/util.rs +++ b/src/librustc_mir/build/matches/util.rs @@ -32,14 +32,18 @@ impl<'a,'tcx> Builder<'a,'tcx> { /// this function converts the prefix (`x`, `y`) and suffix (`z`) into /// distinct match pairs: /// + /// ```rust,ignore /// lv[0 of 3] @ x // see ProjectionElem::ConstantIndex (and its Debug impl) /// lv[1 of 3] @ y // to explain the `[x of y]` notation /// lv[-1 of 3] @ z + /// ``` /// /// If a slice like `s` is present, then the function also creates /// a temporary like: /// + /// ```rust,ignore /// tmp0 = lv[2..-1] // using the special Rvalue::Slice + /// ``` /// /// and creates a match pair `tmp0 @ s` pub fn prefix_suffix_slice<'pat>(&mut self, diff --git a/src/librustc_mir/build/scope.rs b/src/librustc_mir/build/scope.rs index bda9cf058f6e9..ebcc79ecafd7a 100644 --- a/src/librustc_mir/build/scope.rs +++ b/src/librustc_mir/build/scope.rs @@ -47,7 +47,7 @@ set of scheduled drops up front, and so whenever we exit from the scope we only drop the values scheduled thus far. For example, consider the scope S corresponding to this loop: -``` +```rust,ignore loop { let x = ...; if cond { break; } diff --git a/src/librustc_mir/pretty.rs b/src/librustc_mir/pretty.rs index d0c66b340d96e..9160093d1f099 100644 --- a/src/librustc_mir/pretty.rs +++ b/src/librustc_mir/pretty.rs @@ -23,7 +23,7 @@ const INDENT: &'static str = " "; /// If the session is properly configured, dumps a human-readable /// representation of the mir into: /// -/// ``` +/// ```text /// rustc.node.. /// ``` /// From a40629d2c9aa2a3bed2e4edaafa2303eb4b19854 Mon Sep 17 00:00:00 2001 From: Deepak Kannan Date: Wed, 13 Apr 2016 21:23:42 +0530 Subject: [PATCH 15/17] Doc fix: Do not mention next project in book/guessing-game The next project refers to the dining-philosophers problem https://github.com/rust-lang/rust/blob/27a1834ce522e3ec7fe4726b1661de16ee30c503/src/doc/book/dining-philosophers.md which was removed in https://github.com/rust-lang/rust/commit/0c6c34de87c899ecb8b977e7ef24510ab2a68168 so removing reference to that project from book/guessing-game --- src/doc/book/guessing-game.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/doc/book/guessing-game.md b/src/doc/book/guessing-game.md index 590c7e848190a..a2067e33a60aa 100644 --- a/src/doc/book/guessing-game.md +++ b/src/doc/book/guessing-game.md @@ -988,8 +988,7 @@ fn main() { # Complete! -At this point, you have successfully built the Guessing Game! Congratulations! +This project showed you a lot: `let`, `match`, methods, associated +functions, using external crates, and more. -This first project showed you a lot: `let`, `match`, methods, associated -functions, using external crates, and more. Our next project will show off -even more. +At this point, you have successfully built the Guessing Game! Congratulations! From 05a3fea8f6b425889f905c7b1dca47139e7df63f Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 13 Apr 2016 19:35:21 +0200 Subject: [PATCH 16/17] Fix a typo and add a missing word --- src/libstd/panic.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstd/panic.rs b/src/libstd/panic.rs index 16401c4527f16..bbd89af01a73a 100644 --- a/src/libstd/panic.rs +++ b/src/libstd/panic.rs @@ -346,9 +346,9 @@ impl R> FnOnce<()> for AssertRecoverSafe { /// It is **not** recommended to use this function for a general try/catch /// mechanism. The `Result` type is more appropriate to use for functions that /// can fail on a regular basis. Additionally, this function is not guaranteed -/// to catch all panics, see the "Notes" sectino below. +/// to catch all panics, see the "Notes" section below. /// -/// The closure provided is required to adhere to the `UnwindSafe` to ensure +/// The closure provided is required to adhere to the `UnwindSafe` trait to ensure /// that all captured variables are safe to cross this boundary. The purpose of /// this bound is to encode the concept of [exception safety][rfc] in the type /// system. Most usage of this function should not need to worry about this From 2bf000349a06f874f8bb6c67a37d3ff533e36165 Mon Sep 17 00:00:00 2001 From: Gigih Aji Ibrahim Date: Thu, 14 Apr 2016 03:39:10 +0700 Subject: [PATCH 17/17] fix str::split_at_mut() example --- src/libcollections/str.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index b2b1e019a1b89..2059943bfdf61 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -634,9 +634,9 @@ impl str { /// Basic usage: /// /// ``` - /// let s = "Per Martin-Löf"; + /// let mut s = "Per Martin-Löf".to_string(); /// - /// let (first, last) = s.split_at(3); + /// let (first, last) = s.split_at_mut(3); /// /// assert_eq!("Per", first); /// assert_eq!(" Martin-Löf", last);