From d142a4eed0ea6c3f6d0b3ba9427caa6270b0a90b Mon Sep 17 00:00:00 2001 From: Keshav Kini Date: Mon, 19 Oct 2015 12:05:52 -0500 Subject: [PATCH 1/9] =?UTF-8?q?Reword=20`curl=20|=20sh`=20disclaimer=20in?= =?UTF-8?q?=20TRPL=20=C2=A72.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The paragraph here seemed confusing, so I reworded it. Also added another possible reason why `curl | sh` might be objectionable to users. --- src/doc/trpl/installing-rust.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/doc/trpl/installing-rust.md b/src/doc/trpl/installing-rust.md index a3666d1c08e0a..6872b7da0e9df 100644 --- a/src/doc/trpl/installing-rust.md +++ b/src/doc/trpl/installing-rust.md @@ -51,11 +51,15 @@ us an uninstall option. ## That disclaimer we promised Some people, and somewhat rightfully so, get very upset when we tell them to -`curl | sh`. Basically, when they do this, they are trusting that the good -people who maintain Rust aren't going to hack their computer and do bad things. -That's a good instinct! If you're one of those people, please check out the -documentation on [building Rust from Source][from-source], or [the official -binary downloads][install-page]. +`curl | sh`. Their concern is that `curl | sh` implicitly requires you to trust +that the good people who maintain Rust aren't going to hack your computer and +do bad things -- and even having accepted that, there is still the possibility +that the Rust website has been hacked and the `rustup` script compromised. + +Being wary of such possibilities is a good instinct! If you're uncomfortable +using `curl | sh` for reasons like these, please check out the documentation on +[building Rust from Source][from-source], or +[the official binary downloads][install-page]. [from-source]: https://github.com/rust-lang/rust#building-from-source From 968d17a3eb925e19053b8277fc094d14c470e63f Mon Sep 17 00:00:00 2001 From: Keshav Kini Date: Mon, 19 Oct 2015 16:18:20 -0500 Subject: [PATCH 2/9] =?UTF-8?q?Replace=20--=20with=20=E2=80=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/doc/trpl/installing-rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/trpl/installing-rust.md b/src/doc/trpl/installing-rust.md index 6872b7da0e9df..9f241717d3609 100644 --- a/src/doc/trpl/installing-rust.md +++ b/src/doc/trpl/installing-rust.md @@ -53,7 +53,7 @@ us an uninstall option. Some people, and somewhat rightfully so, get very upset when we tell them to `curl | sh`. Their concern is that `curl | sh` implicitly requires you to trust that the good people who maintain Rust aren't going to hack your computer and -do bad things -- and even having accepted that, there is still the possibility +do bad things — and even having accepted that, there is still the possibility that the Rust website has been hacked and the `rustup` script compromised. Being wary of such possibilities is a good instinct! If you're uncomfortable From 3ed49ef6f3bcf4cdd4ae3fde4951848f905f02d2 Mon Sep 17 00:00:00 2001 From: Bryce Van Dyk Date: Tue, 20 Oct 2015 21:02:19 +1300 Subject: [PATCH 3/9] Add example to install git in MSYS2 --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c4a3becacb42f..9d85487f793ef 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,9 @@ Read ["Installing Rust"] from [The Book]. $ pacman -S mingw-w64-i686-toolchain $ pacman -S mingw-w64-x86_64-toolchain + # Make git available in MSYS2 (if not already available on path) + $ pacman -S git + $ pacman -S base-devel ``` @@ -98,7 +101,7 @@ Building the documentation requires building the compiler, so the above details will apply. Once you have the compiler built, you can ```sh -$ make docs NO_REBUILD=1 +$ make docs NO_REBUILD=1 ``` To make sure you don’t re-build the compiler because you made a change From 79102e327c9d694f42c67d165380248253c0ac69 Mon Sep 17 00:00:00 2001 From: Keshav Kini Date: Tue, 20 Oct 2015 16:07:17 -0500 Subject: [PATCH 4/9] =?UTF-8?q?Remove=20reference=20to=20`hello=5Fworld.rs?= =?UTF-8?q?`=20in=20TRPL=20=C2=A72.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When reading this paragraph, the beginning Rust programmer is starting to write a Hello World program. We have just told her to name the file `main.rs`, and immediately afterward, a `hello_world.rs` is mentioned. I changed this to an unrelated filename (incidentally one that appears in this repository) to make it clear that this is just an example. Also, wording it as a declarative sentence rather than an imperative one further separates it from the Hello World instructions in this section. --- src/doc/trpl/hello-world.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/doc/trpl/hello-world.md b/src/doc/trpl/hello-world.md index c3de956d29dcb..2f9166751d965 100644 --- a/src/doc/trpl/hello-world.md +++ b/src/doc/trpl/hello-world.md @@ -37,8 +37,9 @@ If we’re on Windows and not using PowerShell, the `~` may not work. Consult th documentation for our shell for more details. Let’s make a new source file next. We’ll call our file `main.rs`. Rust files -always end in a `.rs` extension. If we’re using more than one word in our -filename, use an underscore: `hello_world.rs` rather than `helloworld.rs`. +always end in a `.rs` extension, and if we’re using more than one word in a +Rust filename, we use an underscore: for example, `linked_list.rs`, not +`linkedlist.rs` or `LinkedList.rs`. Now that we’ve got our file open, type this in: From 55796c07b894d0ce20b87bfdd731b9b7f68affad Mon Sep 17 00:00:00 2001 From: Yoshito Komatsu Date: Wed, 21 Oct 2015 22:17:23 +0900 Subject: [PATCH 5/9] Fix some typos in TRPL --- src/doc/trpl/error-handling.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/doc/trpl/error-handling.md b/src/doc/trpl/error-handling.md index d839e1820920a..994d92f152681 100644 --- a/src/doc/trpl/error-handling.md +++ b/src/doc/trpl/error-handling.md @@ -1545,7 +1545,7 @@ cargo build --release ## Argument parsing -Let's get argument parsing out of the way. we won't go into too much +Let's get argument parsing out of the way. We won't go into too much detail on Getopts, but there is [some good documentation][15] describing it. The short story is that Getopts generates an argument parser and a help message from a vector of options (The fact that it @@ -1855,7 +1855,7 @@ In our program, we accept a single file for input and do one pass over the data. This means we probably should be able to accept input on stdin. But maybe we like the current format too—so let's have both! -Adding support for stdin is actually quite easy. There are only two things we +Adding support for stdin is actually quite easy. There are only three things we have to do: 1. Tweak the program arguments so that a single parameter—the @@ -2057,7 +2057,7 @@ so. This can be a little clumsy, especially if you intend for the program to be used in shell scripts. So let's start by adding the flags. Like before, we need to tweak the usage -string and add a flag to the Option variable. Once were done that, Getopts does the rest: +string and add a flag to the Option variable. Once we're done that, Getopts does the rest: ```rust,ignore ... From f657e134cb66844b2dc476c5b276c1be9788caf2 Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Wed, 21 Oct 2015 14:15:43 -0400 Subject: [PATCH 6/9] Remove obsolete note about `UnsafeCell`'s fields --- src/libcore/cell.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 1b4af44da4689..0d717992ce8df 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -784,9 +784,6 @@ impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> { /// /// unsafe impl Sync for NotThreadSafe {} /// ``` -/// -/// **NOTE:** `UnsafeCell`'s fields are public to allow static initializers. It is not -/// recommended to access its fields directly, `get` should be used instead. #[lang = "unsafe_cell"] #[stable(feature = "rust1", since = "1.0.0")] pub struct UnsafeCell { @@ -799,8 +796,7 @@ impl UnsafeCell { /// Constructs a new instance of `UnsafeCell` which will wrap the specified /// value. /// - /// All access to the inner value through methods is `unsafe`, and it is highly discouraged to - /// access the fields directly. + /// All access to the inner value through methods is `unsafe`. /// /// # Examples /// From f609d17573b720f13bab4172d1b82209253f1bb7 Mon Sep 17 00:00:00 2001 From: Yoshito Komatsu Date: Thu, 22 Oct 2015 09:17:04 +0900 Subject: [PATCH 7/9] Correct a previous patch --- src/doc/trpl/error-handling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/trpl/error-handling.md b/src/doc/trpl/error-handling.md index 994d92f152681..c7d1b0eea3437 100644 --- a/src/doc/trpl/error-handling.md +++ b/src/doc/trpl/error-handling.md @@ -2057,7 +2057,7 @@ so. This can be a little clumsy, especially if you intend for the program to be used in shell scripts. So let's start by adding the flags. Like before, we need to tweak the usage -string and add a flag to the Option variable. Once we're done that, Getopts does the rest: +string and add a flag to the Option variable. Once we've done that, Getopts does the rest: ```rust,ignore ... From 3673978539227f3674afb50e4f7943aea3b19173 Mon Sep 17 00:00:00 2001 From: Wesley Wiser Date: Wed, 21 Oct 2015 22:33:24 -0400 Subject: [PATCH 8/9] Fix doc sample for Cursor Fixes #29219 --- src/libstd/io/cursor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/io/cursor.rs b/src/libstd/io/cursor.rs index 7bca5359690ec..e4f00c4874e5f 100644 --- a/src/libstd/io/cursor.rs +++ b/src/libstd/io/cursor.rs @@ -69,7 +69,7 @@ use slice; /// use std::io::Cursor; /// let mut buff = Cursor::new(vec![0; 15]); /// -/// write_ten_bytes(&mut buff).unwrap(); +/// write_ten_bytes_at_end(&mut buff).unwrap(); /// /// assert_eq!(&buff.get_ref()[5..15], &[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); /// } From 6003b479a01b4cc5d60b9293aa5f46992331f01e Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Thu, 22 Oct 2015 03:33:47 -0600 Subject: [PATCH 9/9] Add missing "to" in Rustonomicon Atomics. --- src/doc/nomicon/atomics.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/doc/nomicon/atomics.md b/src/doc/nomicon/atomics.md index 08f0de4f00677..1efca08abd094 100644 --- a/src/doc/nomicon/atomics.md +++ b/src/doc/nomicon/atomics.md @@ -1,11 +1,11 @@ % Atomics Rust pretty blatantly just inherits C11's memory model for atomics. This is not -due this model being particularly excellent or easy to understand. Indeed, this -model is quite complex and known to have [several flaws][C11-busted]. Rather, it -is a pragmatic concession to the fact that *everyone* is pretty bad at modeling -atomics. At very least, we can benefit from existing tooling and research around -C. +due to this model being particularly excellent or easy to understand. Indeed, +this model is quite complex and known to have [several flaws][C11-busted]. +Rather, it is a pragmatic concession to the fact that *everyone* is pretty bad +at modeling atomics. At very least, we can benefit from existing tooling and +research around C. Trying to fully explain the model in this book is fairly hopeless. It's defined in terms of madness-inducing causality graphs that require a full book to