Skip to content

Commit fae5162

Browse files
committed
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:
2 parents 6e44653 + b34e625 commit fae5162

File tree

17 files changed

+104
-29
lines changed

17 files changed

+104
-29
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*.elc
1818
*.epub
1919
*.exe
20+
*.pdb
2021
*.fn
2122
*.html
2223
*.kdev4

mk/cfg/i586-unknown-linux-gnu.mk

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# i586-unknown-linux-gnu configuration
2+
CC_i586-unknown-linux-gnu=$(CC)
3+
CXX_i586-unknown-linux-gnu=$(CXX)
4+
CPP_i586-unknown-linux-gnu=$(CPP)
5+
AR_i586-unknown-linux-gnu=$(AR)
6+
CFG_LIB_NAME_i586-unknown-linux-gnu=lib$(1).so
7+
CFG_STATIC_LIB_NAME_i586-unknown-linux-gnu=lib$(1).a
8+
CFG_LIB_GLOB_i586-unknown-linux-gnu=lib$(1)-*.so
9+
CFG_LIB_DSYM_GLOB_i586-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
10+
CFG_JEMALLOC_CFLAGS_i586-unknown-linux-gnu := -m32 $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_i586-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
12+
CFG_GCCISH_CXXFLAGS_i586-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
13+
CFG_GCCISH_LINK_FLAGS_i586-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32
14+
CFG_GCCISH_DEF_FLAG_i586-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
15+
CFG_LLC_FLAGS_i586-unknown-linux-gnu :=
16+
CFG_INSTALL_NAME_i586-unknown-linux-gnu =
17+
CFG_EXE_SUFFIX_i586-unknown-linux-gnu =
18+
CFG_WINDOWSY_i586-unknown-linux-gnu :=
19+
CFG_UNIXY_i586-unknown-linux-gnu := 1
20+
CFG_LDPATH_i586-unknown-linux-gnu :=
21+
CFG_RUN_i586-unknown-linux-gnu=$(2)
22+
CFG_RUN_TARG_i586-unknown-linux-gnu=$(call CFG_RUN_i586-unknown-linux-gnu,,$(2))
23+
CFG_GNU_TRIPLE_i586-unknown-linux-gnu := i586-unknown-linux-gnu

src/doc/book/concurrency.md

+2
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ use std::sync::mpsc;
286286
fn main() {
287287
let data = Arc::new(Mutex::new(0));
288288

289+
// `tx` is the "transmitter" or "sender"
290+
// `rx` is the "receiver"
289291
let (tx, rx) = mpsc::channel();
290292

291293
for _ in 0..10 {

src/doc/book/documentation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -319,23 +319,23 @@ our source code:
319319
```text
320320
First, we set `x` to five:
321321
322-
```text
322+
```rust
323323
let x = 5;
324324
# let y = 6;
325325
# println!("{}", x + y);
326326
```
327327
328328
Next, we set `y` to six:
329329
330-
```text
330+
```rust
331331
# let x = 5;
332332
let y = 6;
333333
# println!("{}", x + y);
334334
```
335335
336336
Finally, we print the sum of `x` and `y`:
337337
338-
```text
338+
```rust
339339
# let x = 5;
340340
# let y = 6;
341341
println!("{}", x + y);

src/doc/book/ownership.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ fn foo() {
5151
}
5252
```
5353

54-
When `v` comes into scope, a new [vector] is created, and it allocates space on
55-
[the heap][heap] for each of its elements. When `v` goes out of scope at the
56-
end of `foo()`, Rust will clean up everything related to the vector, even the
57-
heap-allocated memory. This happens deterministically, at the end of the scope.
54+
When `v` comes into scope, a new [vector] is created on [the stack][stack],
55+
and it allocates space on [the heap][heap] for its elements. When `v` goes out
56+
of scope at the end of `foo()`, Rust will clean up everything related to the
57+
vector, even the heap-allocated memory. This happens deterministically, at the
58+
end of the scope.
5859

5960
We'll cover [vectors] in detail later in this chapter; we only use them
6061
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
6768
[arrays]: primitive-types.html#arrays
6869
[vectors]: vectors.html
6970
[heap]: the-stack-and-the-heap.html
71+
[stack]: the-stack-and-the-heap.html#the-stack
7072
[bindings]: variable-bindings.html
7173
[generics]: generics.html
7274

src/doc/book/using-rust-without-the-standard-library.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ don’t want to use the standard library via an attribute: `#![no_std]`.
1111
> For details on binaries without the standard library, see [the nightly
1212
> chapter on `#![no_std]`](no-stdlib.html)
1313
14-
To use `#![no_std]`, add a it to your crate root:
14+
To use `#![no_std]`, add it to your crate root:
1515

1616
```rust
1717
#![no_std]

src/doc/uptack.tex

-2
This file was deleted.

src/libcollections/vec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ impl<T> Vec<T> {
528528
}
529529

530530
/// Inserts an element at position `index` within the vector, shifting all
531-
/// elements after position `i` one position to the right.
531+
/// elements after it to the right.
532532
///
533533
/// # Panics
534534
///
@@ -570,7 +570,7 @@ impl<T> Vec<T> {
570570
}
571571

572572
/// Removes and returns the element at position `index` within the vector,
573-
/// shifting all elements after position `index` one position to the left.
573+
/// shifting all elements after it to the left.
574574
///
575575
/// # Panics
576576
///

src/libcore/num/mod.rs

+14
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,13 @@ macro_rules! int_impl {
741741
/// where `mask` removes any high-order bits of `rhs` that
742742
/// would cause the shift to exceed the bitwidth of the type.
743743
///
744+
/// Note that this is *not* the same as a rotate-left; the
745+
/// RHS of a wrapping shift-left is restricted to the range
746+
/// of the type, rather than the bits shifted out of the LHS
747+
/// being returned to the other end. The primitive integer
748+
/// types all implement a `rotate_left` function, which may
749+
/// be what you want instead.
750+
///
744751
/// # Examples
745752
///
746753
/// Basic usage:
@@ -759,6 +766,13 @@ macro_rules! int_impl {
759766
/// where `mask` removes any high-order bits of `rhs` that
760767
/// would cause the shift to exceed the bitwidth of the type.
761768
///
769+
/// Note that this is *not* the same as a rotate-right; the
770+
/// RHS of a wrapping shift-right is restricted to the range
771+
/// of the type, rather than the bits shifted out of the LHS
772+
/// being returned to the other end. The primitive integer
773+
/// types all implement a `rotate_right` function, which may
774+
/// be what you want instead.
775+
///
762776
/// # Examples
763777
///
764778
/// Basic usage:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use target::Target;
12+
13+
pub fn target() -> Target {
14+
let mut base = super::linux_base::opts();
15+
base.cpu = "pentium".to_string();
16+
base.pre_link_args.push("-m32".to_string());
17+
18+
Target {
19+
llvm_target: "i586-unknown-linux-gnu".to_string(),
20+
target_endian: "little".to_string(),
21+
target_pointer_width: "32".to_string(),
22+
arch: "x86".to_string(),
23+
target_os: "linux".to_string(),
24+
target_env: "gnu".to_string(),
25+
target_vendor: "unknown".to_string(),
26+
options: base,
27+
}
28+
}

src/librustc_back/target/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ macro_rules! supported_targets {
8989
supported_targets! {
9090
("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu),
9191
("i686-unknown-linux-gnu", i686_unknown_linux_gnu),
92+
("i586-unknown-linux-gnu", i586_unknown_linux_gnu),
9293
("mips-unknown-linux-gnu", mips_unknown_linux_gnu),
9394
("mipsel-unknown-linux-gnu", mipsel_unknown_linux_gnu),
9495
("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu),

src/libstd/ascii.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub trait AsciiExt {
4545
#[stable(feature = "rust1", since = "1.0.0")]
4646
type Owned;
4747

48-
/// Checks if within the ASCII range.
48+
/// Checks if the value is within the ASCII range.
4949
///
5050
/// # Examples
5151
///
@@ -55,8 +55,8 @@ pub trait AsciiExt {
5555
/// let ascii = 'a';
5656
/// let utf8 = '❤';
5757
///
58-
/// assert_eq!(true, ascii.is_ascii());
59-
/// assert_eq!(false, utf8.is_ascii())
58+
/// assert!(ascii.is_ascii());
59+
/// assert!(!utf8.is_ascii());
6060
/// ```
6161
#[stable(feature = "rust1", since = "1.0.0")]
6262
fn is_ascii(&self) -> bool;
@@ -114,9 +114,9 @@ pub trait AsciiExt {
114114
/// let ascii3 = 'A';
115115
/// let ascii4 = 'z';
116116
///
117-
/// assert_eq!(true, ascii1.eq_ignore_ascii_case(&ascii2));
118-
/// assert_eq!(true, ascii1.eq_ignore_ascii_case(&ascii3));
119-
/// assert_eq!(false, ascii1.eq_ignore_ascii_case(&ascii4));
117+
/// assert!(ascii1.eq_ignore_ascii_case(&ascii2));
118+
/// assert!(ascii1.eq_ignore_ascii_case(&ascii3));
119+
/// assert!(!ascii1.eq_ignore_ascii_case(&ascii4));
120120
/// ```
121121
#[stable(feature = "rust1", since = "1.0.0")]
122122
fn eq_ignore_ascii_case(&self, other: &Self) -> bool;

src/libstd/macros.rs

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

src/libstd/prelude/mod.rs

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

src/libstd/sys/common/poison.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl<T> fmt::Display for PoisonError<T> {
111111
}
112112

113113
#[stable(feature = "rust1", since = "1.0.0")]
114-
impl<T: Send + Reflect> Error for PoisonError<T> {
114+
impl<T: Reflect> Error for PoisonError<T> {
115115
fn description(&self) -> &str {
116116
"poisoned lock: another task failed inside"
117117
}
@@ -158,14 +158,17 @@ impl<T> fmt::Debug for TryLockError<T> {
158158
}
159159

160160
#[stable(feature = "rust1", since = "1.0.0")]
161-
impl<T: Send + Reflect> fmt::Display for TryLockError<T> {
161+
impl<T> fmt::Display for TryLockError<T> {
162162
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
163-
self.description().fmt(f)
163+
match *self {
164+
TryLockError::Poisoned(..) => "poisoned lock: another task failed inside",
165+
TryLockError::WouldBlock => "try_lock failed because the operation would block"
166+
}.fmt(f)
164167
}
165168
}
166169

167170
#[stable(feature = "rust1", since = "1.0.0")]
168-
impl<T: Send + Reflect> Error for TryLockError<T> {
171+
impl<T: Reflect> Error for TryLockError<T> {
169172
fn description(&self) -> &str {
170173
match *self {
171174
TryLockError::Poisoned(ref p) => p.description(),

src/libsyntax/codemap.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl MultiSpan {
341341
for idx in 0.. {
342342
if let Some(sp_trim) = sp.trim_start(prev) {
343343
// Implies `sp.hi > prev.hi`
344-
let cur = match self.spans.as_slice().get(idx) {
344+
let cur = match self.spans.get(idx) {
345345
Some(s) => *s,
346346
None => {
347347
sp = sp_trim;

src/test/run-make/codegen-options-parsing/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ all:
2525

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

0 commit comments

Comments
 (0)