Skip to content

Commit dccdde4

Browse files
committed
Auto merge of #22755 - Manishearth:rollup, r=Manishearth
2 parents 0ef56da + b182cd7 commit dccdde4

File tree

113 files changed

+1401
-948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1401
-948
lines changed

src/doc/reference.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,7 @@ fn needs_foo_or_bar() {
21652165
21662166
// This function is only included when compiling for a unixish OS with a 32-bit
21672167
// architecture
2168-
#[cfg(all(unix, target_word_size = "32"))]
2168+
#[cfg(all(unix, target_pointer_width = "32"))]
21692169
fn on_32bit_unix() {
21702170
// ...
21712171
}
@@ -2193,9 +2193,9 @@ The following configurations must be defined by the implementation:
21932193
* `target_os = "..."`. Operating system of the target, examples include
21942194
`"win32"`, `"macos"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"`,
21952195
`"bitrig"` or `"openbsd"`.
2196-
* `target_word_size = "..."`. Target word size in bits. This is set to `"32"`
2197-
for targets with 32-bit pointers, and likewise set to `"64"` for 64-bit
2198-
pointers.
2196+
* `target_pointer_width = "..."`. Target pointer width in bits. This is set
2197+
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
2198+
64-bit pointers.
21992199
* `unix`. See `target_family`.
22002200
* `windows`. See `target_family`.
22012201

src/doc/rust.css

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
/* General structure */
5757

5858
body {
59+
background-color: white;
5960
margin: 0 auto;
6061
padding: 0 15px;
6162
font-family: "Source Serif Pro", Georgia, Times, "Times New Roman", serif;

src/doc/trpl/pointers.md

+14-13
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,16 @@ duration a *lifetime*. Let's try a more complex example:
361361

362362
```{rust}
363363
fn main() {
364-
let x = &mut 5;
364+
let mut x = 5;
365365
366-
if *x < 10 {
366+
if x < 10 {
367367
let y = &x;
368368
369369
println!("Oh no: {}", y);
370370
return;
371371
}
372372
373-
*x -= 1;
373+
x -= 1;
374374
375375
println!("Oh no: {}", x);
376376
}
@@ -382,17 +382,18 @@ mutated, and therefore, lets us pass. This wouldn't work:
382382

383383
```{rust,ignore}
384384
fn main() {
385-
let x = &mut 5;
385+
let mut x = 5;
386386
387-
if *x < 10 {
387+
if x < 10 {
388388
let y = &x;
389-
*x -= 1;
389+
390+
x -= 1;
390391
391392
println!("Oh no: {}", y);
392393
return;
393394
}
394395
395-
*x -= 1;
396+
x -= 1;
396397
397398
println!("Oh no: {}", x);
398399
}
@@ -401,12 +402,12 @@ fn main() {
401402
It gives this error:
402403

403404
```text
404-
test.rs:5:8: 5:10 error: cannot assign to `*x` because it is borrowed
405-
test.rs:5 *x -= 1;
406-
^~
407-
test.rs:4:16: 4:18 note: borrow of `*x` occurs here
408-
test.rs:4 let y = &x;
409-
^~
405+
test.rs:7:9: 7:15 error: cannot assign to `x` because it is borrowed
406+
test.rs:7 x -= 1;
407+
^~~~~~
408+
test.rs:5:18: 5:19 note: borrow of `x` occurs here
409+
test.rs:5 let y = &x;
410+
^
410411
```
411412

412413
As you might guess, this kind of analysis is complex for a human, and therefore

src/doc/trpl/static-and-dynamic-dispatch.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ dynamic dispatch is sometimes more efficient.
9393

9494
However, the common case is that it is more efficient to use static dispatch,
9595
and one can always have a thin statically-dispatched wrapper function that does
96-
a dynamic, but not vice versa, meaning static calls are more flexible. The
97-
standard library tries to be statically dispatched where possible for this
96+
a dynamic dispatch, but not vice versa, meaning static calls are more flexible.
97+
The standard library tries to be statically dispatched where possible for this
9898
reason.
9999

100100
## Dynamic dispatch

src/libcollections/borrow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl<T> ToOwned for T where T: Clone {
132132
/// ```rust
133133
/// use std::borrow::Cow;
134134
///
135-
/// fn abs_all(input: &mut Cow<[int]>) {
135+
/// fn abs_all(input: &mut Cow<[i32]>) {
136136
/// for i in 0..input.len() {
137137
/// let v = input[i];
138138
/// if v < 0 {

src/libcollections/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@
404404
#![stable(feature = "rust1", since = "1.0.0")]
405405

406406
pub use core::fmt::{Formatter, Result, Write, rt};
407-
pub use core::fmt::{Show, String, Octal, Binary};
407+
pub use core::fmt::{Octal, Binary};
408408
pub use core::fmt::{Display, Debug};
409409
pub use core::fmt::{LowerHex, UpperHex, Pointer};
410410
pub use core::fmt::{LowerExp, UpperExp};

src/libcore/fmt/float.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ pub enum ExponentFormat {
4040
pub enum SignificantDigits {
4141
/// At most the given number of digits will be printed, truncating any
4242
/// trailing zeroes.
43-
DigMax(uint),
43+
DigMax(usize),
4444

4545
/// Precisely the given number of digits will be printed.
46-
DigExact(uint)
46+
DigExact(usize)
4747
}
4848

4949
/// How to emit the sign of a number.
@@ -240,27 +240,27 @@ pub fn float_to_str_bytes_common<T: Float, U, F>(
240240
// If reached left end of number, have to
241241
// insert additional digit:
242242
if i < 0
243-
|| buf[i as uint] == b'-'
244-
|| buf[i as uint] == b'+' {
245-
for j in (i as uint + 1..end).rev() {
243+
|| buf[i as usize] == b'-'
244+
|| buf[i as usize] == b'+' {
245+
for j in (i as usize + 1..end).rev() {
246246
buf[j + 1] = buf[j];
247247
}
248-
buf[(i + 1) as uint] = value2ascii(1);
248+
buf[(i + 1) as usize] = value2ascii(1);
249249
end += 1;
250250
break;
251251
}
252252

253253
// Skip the '.'
254-
if buf[i as uint] == b'.' { i -= 1; continue; }
254+
if buf[i as usize] == b'.' { i -= 1; continue; }
255255

256256
// Either increment the digit,
257257
// or set to 0 if max and carry the 1.
258-
let current_digit = ascii2value(buf[i as uint]);
258+
let current_digit = ascii2value(buf[i as usize]);
259259
if current_digit < (radix - 1) {
260-
buf[i as uint] = value2ascii(current_digit+1);
260+
buf[i as usize] = value2ascii(current_digit+1);
261261
break;
262262
} else {
263-
buf[i as uint] = value2ascii(0);
263+
buf[i as usize] = value2ascii(0);
264264
i -= 1;
265265
}
266266
}
@@ -311,7 +311,7 @@ pub fn float_to_str_bytes_common<T: Float, U, F>(
311311

312312
struct Filler<'a> {
313313
buf: &'a mut [u8],
314-
end: &'a mut uint,
314+
end: &'a mut usize,
315315
}
316316

317317
impl<'a> fmt::Write for Filler<'a> {

0 commit comments

Comments
 (0)