Skip to content

Rollup of 9 pull requests #29232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0d3d6e4
Fix typo in custom allocator docs.
solson Oct 13, 2015
d142a4e
Reword `curl | sh` disclaimer in TRPL §2.1
kini Oct 19, 2015
968d17a
Replace -- with —
kini Oct 19, 2015
3ed49ef
Add example to install git in MSYS2
SingingTree Oct 20, 2015
79102e3
Remove reference to `hello_world.rs` in TRPL §2.2
kini Oct 20, 2015
55796c0
Fix some typos in TRPL
ykomatsu Oct 21, 2015
f657e13
Remove obsolete note about `UnsafeCell`'s fields
apasel422 Oct 21, 2015
f609d17
Correct a previous patch
ykomatsu Oct 22, 2015
0dce92a
Add a regression test for #29122 (fixed in #29134)
wthrowe Oct 18, 2015
3673978
Fix doc sample for Cursor
wesleywiser Oct 22, 2015
6003b47
Add missing "to" in Rustonomicon Atomics.
solson Oct 22, 2015
9dd9a22
Rollup merge of #29018 - tsion:doc-typo, r=steveklabnik
steveklabnik Oct 22, 2015
0f03f75
Rollup merge of #29151 - wthrowe:linker-output-ICE, r=alexcrichton
steveklabnik Oct 22, 2015
412b362
Rollup merge of #29170 - kini:curl-sh-disclaimer, r=steveklabnik
steveklabnik Oct 22, 2015
13232d4
Rollup merge of #29180 - SingingTree:readme_windows_build, r=stevekla…
steveklabnik Oct 22, 2015
4ed0cf4
Rollup merge of #29193 - kini:filename-conventions, r=alexcrichton
steveklabnik Oct 22, 2015
2c540c3
Rollup merge of #29207 - ykomatsu:trpl, r=steveklabnik
steveklabnik Oct 22, 2015
b1a6356
Rollup merge of #29213 - apasel422:unsafe-cell, r=Gankro
steveklabnik Oct 22, 2015
96e6dff
Rollup merge of #29224 - wesleywiser:patch-2, r=alexcrichton
steveklabnik Oct 22, 2015
d941e40
Rollup merge of #29230 - tsion:fix-nomicon-typo-2, r=steveklabnik
steveklabnik Oct 22, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
10 changes: 5 additions & 5 deletions src/doc/nomicon/atomics.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/custom-allocators.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ compiler errors:

* Any one artifact may only be linked to at most one allocator. Binaries,
dylibs, and staticlibs must link to exactly one allocator, and if none have
been explicitly chosen the compiler will choose one. On the other than rlibs
been explicitly chosen the compiler will choose one. On the other hand rlibs
do not need to link to an allocator (but still can).

* A consumer of an allocator is tagged with `#![needs_allocator]` (e.g. the
Expand Down
6 changes: 3 additions & 3 deletions src/doc/trpl/error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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've done that, Getopts does the rest:

```rust,ignore
...
Expand Down
5 changes: 3 additions & 2 deletions src/doc/trpl/hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
14 changes: 9 additions & 5 deletions src/doc/trpl/installing-rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 1 addition & 5 deletions src/libcore/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -784,9 +784,6 @@ impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> {
///
/// unsafe impl<T> Sync for NotThreadSafe<T> {}
/// ```
///
/// **NOTE:** `UnsafeCell<T>`'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<T: ?Sized> {
Expand All @@ -799,8 +796,7 @@ impl<T> UnsafeCell<T> {
/// 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
///
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/io/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
/// }
Expand Down
12 changes: 12 additions & 0 deletions src/test/run-make/linker-output-non-utf8/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-include ../tools.mk

# Make sure we don't ICE if the linker prints a non-UTF-8 error message.

# The zzz it to allow humans to tab complete or glob this thing.
bad_dir := $(TMPDIR)/zzz$$'\xff'

all:
$(RUSTC) library.rs
mkdir $(bad_dir)
mv $(TMPDIR)/liblibrary.a $(bad_dir)
LIBRARY_PATH=$(bad_dir) $(RUSTC) exec.rs 2>&1 | grep this_symbol_not_defined
16 changes: 16 additions & 0 deletions src/test/run-make/linker-output-non-utf8/exec.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[link(name="library")]
extern "C" {
fn foo();
}

fn main() { unsafe { foo(); } }
20 changes: 20 additions & 0 deletions src/test/run-make/linker-output-non-utf8/library.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![crate_type = "staticlib"]

extern "C" {
fn this_symbol_not_defined();
}

#[no_mangle]
pub extern "C" fn foo() {
unsafe { this_symbol_not_defined(); }
}