Auto merge of #31643 - Manishearth:rollup, r=Manishearth

- Successful merges: #31535, #31537, #31542, #31559, #31563, #31582, #31584, #31585, #31589, #31607, #31609, #31610, #31612, #31629, #31635, #31637, #31638
- Failed merges:
This commit is contained in:
bors 2016-02-13 23:37:10 +00:00
commit fae516277b
17 changed files with 104 additions and 29 deletions

1
.gitignore vendored
View File

@ -17,6 +17,7 @@
*.elc
*.epub
*.exe
*.pdb
*.fn
*.html
*.kdev4

View File

@ -0,0 +1,23 @@
# i586-unknown-linux-gnu configuration
CC_i586-unknown-linux-gnu=$(CC)
CXX_i586-unknown-linux-gnu=$(CXX)
CPP_i586-unknown-linux-gnu=$(CPP)
AR_i586-unknown-linux-gnu=$(AR)
CFG_LIB_NAME_i586-unknown-linux-gnu=lib$(1).so
CFG_STATIC_LIB_NAME_i586-unknown-linux-gnu=lib$(1).a
CFG_LIB_GLOB_i586-unknown-linux-gnu=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_i586-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
CFG_JEMALLOC_CFLAGS_i586-unknown-linux-gnu := -m32 $(CFLAGS)
CFG_GCCISH_CFLAGS_i586-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
CFG_GCCISH_CXXFLAGS_i586-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
CFG_GCCISH_LINK_FLAGS_i586-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32
CFG_GCCISH_DEF_FLAG_i586-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
CFG_LLC_FLAGS_i586-unknown-linux-gnu :=
CFG_INSTALL_NAME_i586-unknown-linux-gnu =
CFG_EXE_SUFFIX_i586-unknown-linux-gnu =
CFG_WINDOWSY_i586-unknown-linux-gnu :=
CFG_UNIXY_i586-unknown-linux-gnu := 1
CFG_LDPATH_i586-unknown-linux-gnu :=
CFG_RUN_i586-unknown-linux-gnu=$(2)
CFG_RUN_TARG_i586-unknown-linux-gnu=$(call CFG_RUN_i586-unknown-linux-gnu,,$(2))
CFG_GNU_TRIPLE_i586-unknown-linux-gnu := i586-unknown-linux-gnu

View File

@ -286,6 +286,8 @@ use std::sync::mpsc;
fn main() {
let data = Arc::new(Mutex::new(0));
// `tx` is the "transmitter" or "sender"
// `rx` is the "receiver"
let (tx, rx) = mpsc::channel();
for _ in 0..10 {

View File

@ -319,7 +319,7 @@ our source code:
```text
First, we set `x` to five:
```text
```rust
let x = 5;
# let y = 6;
# println!("{}", x + y);
@ -327,7 +327,7 @@ our source code:
Next, we set `y` to six:
```text
```rust
# let x = 5;
let y = 6;
# println!("{}", x + y);
@ -335,7 +335,7 @@ our source code:
Finally, we print the sum of `x` and `y`:
```text
```rust
# let x = 5;
# let y = 6;
println!("{}", x + y);

View File

@ -51,10 +51,11 @@ fn foo() {
}
```
When `v` comes into scope, a new [vector] is created, and it allocates space on
[the heap][heap] for each of its elements. When `v` goes out of scope at the
end of `foo()`, Rust will clean up everything related to the vector, even the
heap-allocated memory. This happens deterministically, at the end of the scope.
When `v` comes into scope, a new [vector] is created on [the stack][stack],
and it allocates space on [the heap][heap] for its elements. When `v` goes out
of scope at the end of `foo()`, Rust will clean up everything related to the
vector, even the heap-allocated memory. This happens deterministically, at the
end of the scope.
We'll cover [vectors] in detail later in this chapter; we only use them
here as an example of a type that allocates space on the heap at runtime. They
@ -67,6 +68,7 @@ Vectors have a [generic type][generics] `Vec<T>`, so in this example `v` will ha
[arrays]: primitive-types.html#arrays
[vectors]: vectors.html
[heap]: the-stack-and-the-heap.html
[stack]: the-stack-and-the-heap.html#the-stack
[bindings]: variable-bindings.html
[generics]: generics.html

View File

@ -11,7 +11,7 @@ dont want to use the standard library via an attribute: `#![no_std]`.
> For details on binaries without the standard library, see [the nightly
> chapter on `#![no_std]`](no-stdlib.html)
To use `#![no_std]`, add a it to your crate root:
To use `#![no_std]`, add it to your crate root:
```rust
#![no_std]

View File

@ -1,2 +0,0 @@
\usepackage{newunicodechar}
\newunicodechar{{$\bot$}}

View File

@ -528,7 +528,7 @@ impl<T> Vec<T> {
}
/// Inserts an element at position `index` within the vector, shifting all
/// elements after position `i` one position to the right.
/// elements after it to the right.
///
/// # Panics
///
@ -570,7 +570,7 @@ impl<T> Vec<T> {
}
/// Removes and returns the element at position `index` within the vector,
/// shifting all elements after position `index` one position to the left.
/// shifting all elements after it to the left.
///
/// # Panics
///

View File

@ -741,6 +741,13 @@ macro_rules! int_impl {
/// where `mask` removes any high-order bits of `rhs` that
/// would cause the shift to exceed the bitwidth of the type.
///
/// Note that this is *not* the same as a rotate-left; the
/// RHS of a wrapping shift-left is restricted to the range
/// of the type, rather than the bits shifted out of the LHS
/// being returned to the other end. The primitive integer
/// types all implement a `rotate_left` function, which may
/// be what you want instead.
///
/// # Examples
///
/// Basic usage:
@ -759,6 +766,13 @@ macro_rules! int_impl {
/// where `mask` removes any high-order bits of `rhs` that
/// would cause the shift to exceed the bitwidth of the type.
///
/// Note that this is *not* the same as a rotate-right; the
/// RHS of a wrapping shift-right is restricted to the range
/// of the type, rather than the bits shifted out of the LHS
/// being returned to the other end. The primitive integer
/// types all implement a `rotate_right` function, which may
/// be what you want instead.
///
/// # Examples
///
/// Basic usage:

View File

@ -0,0 +1,28 @@
// Copyright 2014 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.
use target::Target;
pub fn target() -> Target {
let mut base = super::linux_base::opts();
base.cpu = "pentium".to_string();
base.pre_link_args.push("-m32".to_string());
Target {
llvm_target: "i586-unknown-linux-gnu".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
arch: "x86".to_string(),
target_os: "linux".to_string(),
target_env: "gnu".to_string(),
target_vendor: "unknown".to_string(),
options: base,
}
}

View File

@ -89,6 +89,7 @@ macro_rules! supported_targets {
supported_targets! {
("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu),
("i686-unknown-linux-gnu", i686_unknown_linux_gnu),
("i586-unknown-linux-gnu", i586_unknown_linux_gnu),
("mips-unknown-linux-gnu", mips_unknown_linux_gnu),
("mipsel-unknown-linux-gnu", mipsel_unknown_linux_gnu),
("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu),

View File

@ -45,7 +45,7 @@ pub trait AsciiExt {
#[stable(feature = "rust1", since = "1.0.0")]
type Owned;
/// Checks if within the ASCII range.
/// Checks if the value is within the ASCII range.
///
/// # Examples
///
@ -55,8 +55,8 @@ pub trait AsciiExt {
/// let ascii = 'a';
/// let utf8 = '❤';
///
/// assert_eq!(true, ascii.is_ascii());
/// assert_eq!(false, utf8.is_ascii())
/// assert!(ascii.is_ascii());
/// assert!(!utf8.is_ascii());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
fn is_ascii(&self) -> bool;
@ -114,9 +114,9 @@ pub trait AsciiExt {
/// let ascii3 = 'A';
/// let ascii4 = 'z';
///
/// assert_eq!(true, ascii1.eq_ignore_ascii_case(&ascii2));
/// assert_eq!(true, ascii1.eq_ignore_ascii_case(&ascii3));
/// assert_eq!(false, ascii1.eq_ignore_ascii_case(&ascii4));
/// assert!(ascii1.eq_ignore_ascii_case(&ascii2));
/// assert!(ascii1.eq_ignore_ascii_case(&ascii3));
/// assert!(!ascii1.eq_ignore_ascii_case(&ascii4));
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
fn eq_ignore_ascii_case(&self, other: &Self) -> bool;

View File

@ -269,9 +269,10 @@ pub mod builtin {
/// This macro takes any number of comma-separated identifiers, and
/// concatenates them all into one, yielding an expression which is a new
/// identifier. Note that hygiene makes it such that this macro cannot
/// capture local variables, and macros are only allowed in item,
/// statement or expression position, meaning this macro may be difficult to
/// use in some situations.
/// capture local variables. Also, as a general rule, macros are only
/// allowed in item, statement or expression position. That means while
/// you may use this macro for referring to existing variables, functions or
/// modules etc, you cannot define a new one with it.
///
/// # Examples
///
@ -283,6 +284,8 @@ pub mod builtin {
///
/// let f = concat_idents!(foo, bar);
/// println!("{}", f());
///
/// // fn concat_idents!(new, fun, name) { } // not usable in this way!
/// # }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]

View File

@ -55,7 +55,7 @@
//! * [`std::marker`]::{[`Copy`], [`Send`], [`Sized`], [`Sync`]}. The marker
//! traits indicate fundamental properties of types.
//! * [`std::ops`]::{[`Drop`], [`Fn`], [`FnMut`], [`FnOnce`]}. Various
//! operations for both destuctors and overloading `()`.
//! operations for both destructors and overloading `()`.
//! * [`std::mem`]::[`drop`], a convenience function for explicitly dropping a
//! value.
//! * [`std::boxed`]::[`Box`], a way to allocate values on the heap.

View File

@ -111,7 +111,7 @@ impl<T> fmt::Display for PoisonError<T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Send + Reflect> Error for PoisonError<T> {
impl<T: Reflect> Error for PoisonError<T> {
fn description(&self) -> &str {
"poisoned lock: another task failed inside"
}
@ -158,14 +158,17 @@ impl<T> fmt::Debug for TryLockError<T> {
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Send + Reflect> fmt::Display for TryLockError<T> {
impl<T> fmt::Display for TryLockError<T> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.description().fmt(f)
match *self {
TryLockError::Poisoned(..) => "poisoned lock: another task failed inside",
TryLockError::WouldBlock => "try_lock failed because the operation would block"
}.fmt(f)
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<T: Send + Reflect> Error for TryLockError<T> {
impl<T: Reflect> Error for TryLockError<T> {
fn description(&self) -> &str {
match *self {
TryLockError::Poisoned(ref p) => p.description(),

View File

@ -341,7 +341,7 @@ impl MultiSpan {
for idx in 0.. {
if let Some(sp_trim) = sp.trim_start(prev) {
// Implies `sp.hi > prev.hi`
let cur = match self.spans.as_slice().get(idx) {
let cur = match self.spans.get(idx) {
Some(s) => *s,
None => {
sp = sp_trim;

View File

@ -25,7 +25,7 @@ all:
# Should not link dead code...
$(RUSTC) -Z print-link-args dummy.rs 2>&1 | \
grep -e '--gc-sections\|-dead_strip\|/OPT:REF,ICF'
grep -e '--gc-sections' -e '-dead_strip' -e '/OPT:REF,ICF'
# ... unless you specifically ask to keep it
$(RUSTC) -Z print-link-args -C link-dead-code dummy.rs 2>&1 | \
(! grep -e '--gc-sections\|-dead_strip\|/OPT:REF,ICF')
(! grep -e '--gc-sections' -e '-dead_strip' -e '/OPT:REF,ICF')