Skip to content

Commit bbcaaef

Browse files
committed
---
yaml --- r: 277989 b: refs/heads/auto c: 5bac8cb h: refs/heads/master i: 277987: bc5ee19
1 parent 8db21e6 commit bbcaaef

File tree

215 files changed

+4618
-3811
lines changed

Some content is hidden

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

215 files changed

+4618
-3811
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 3f49920495c1db358e5964acf8182b96405ce435
11+
refs/heads/auto: 5bac8cb16d7c2ce68a826e5b4238e545cd68d3d5
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Read ["Installing Rust"] from [The Book].
1616

1717
1. Make sure you have installed the dependencies:
1818

19-
* `g++` 4.7 or `clang++` 3.x
19+
* `g++` 4.7 or later or `clang++` 3.x
2020
* `python` 2.7 (but not 3.x)
2121
* GNU `make` 3.81 or later
2222
* `curl`

branches/auto/src/liballoc_jemalloc/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,28 @@ use libc::{c_int, c_void, size_t};
4141
#[cfg(not(cargobuild))]
4242
extern {}
4343

44-
// Note that the symbols here are prefixed by default on OSX (we don't
45-
// explicitly request it), and on Android and DragonFly we explicitly request
46-
// it as unprefixing cause segfaults (mismatches in allocators).
44+
// Note that the symbols here are prefixed by default on OSX and Windows (we
45+
// don't explicitly request it), and on Android and DragonFly we explicitly
46+
// request it as unprefixing cause segfaults (mismatches in allocators).
4747
extern {
4848
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
49-
target_os = "dragonfly"),
49+
target_os = "dragonfly", target_os = "windows"),
5050
link_name = "je_mallocx")]
5151
fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
5252
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
53-
target_os = "dragonfly"),
53+
target_os = "dragonfly", target_os = "windows"),
5454
link_name = "je_rallocx")]
5555
fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
5656
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
57-
target_os = "dragonfly"),
57+
target_os = "dragonfly", target_os = "windows"),
5858
link_name = "je_xallocx")]
5959
fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
6060
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
61-
target_os = "dragonfly"),
61+
target_os = "dragonfly", target_os = "windows"),
6262
link_name = "je_sdallocx")]
6363
fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
6464
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
65-
target_os = "dragonfly"),
65+
target_os = "dragonfly", target_os = "windows"),
6666
link_name = "je_nallocx")]
6767
fn nallocx(size: size_t, flags: c_int) -> size_t;
6868
}

branches/auto/src/libcollections/btree/set.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@ impl<T: Ord> BTreeSet<T> {
477477

478478
/// Adds a value to the set.
479479
///
480-
/// If the set did not have a value present, `true` is returned.
480+
/// If the set did not have this value present, `true` is returned.
481481
///
482-
/// If the set did have this key present, `false` is returned, and the
482+
/// If the set did have this value present, `false` is returned, and the
483483
/// entry is not updated. See the [module-level documentation] for more.
484484
///
485485
/// [module-level documentation]: index.html#insert-and-complex-keys

branches/auto/src/libcollections/fmt.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
//! precision := count | '*'
334334
//! type := identifier | ''
335335
//! count := parameter | integer
336-
//! parameter := integer '$'
336+
//! parameter := argument '$'
337337
//! ```
338338
//!
339339
//! # Formatting Parameters
@@ -403,11 +403,12 @@
403403
//! println!("Hello {:5}!", "x");
404404
//! println!("Hello {:1$}!", "x", 5);
405405
//! println!("Hello {1:0$}!", 5, "x");
406+
//! println!("Hello {:width$}!", "x", width = 5);
406407
//! ```
407408
//!
408409
//! Referring to an argument with the dollar syntax does not affect the "next
409-
//! argument" counter, so it's usually a good idea to refer to all arguments by
410-
//! their position explicitly.
410+
//! argument" counter, so it's usually a good idea to refer to arguments by
411+
//! position, or use named arguments.
411412
//!
412413
//! ## Precision
413414
//!
@@ -426,7 +427,7 @@
426427
//!
427428
//! the integer `N` itself is the precision.
428429
//!
429-
//! 2. An integer followed by dollar sign `.N$`:
430+
//! 2. An integer or name followed by dollar sign `.N$`:
430431
//!
431432
//! use format *argument* `N` (which must be a `usize`) as the precision.
432433
//!
@@ -456,6 +457,10 @@
456457
//! // Hello {next arg (x)} is {arg 2 (0.01) with precision
457458
//! // specified in its predecessor (5)}
458459
//! println!("Hello {} is {2:.*}", "x", 5, 0.01);
460+
//!
461+
//! // Hello {next arg (x)} is {arg "number" (0.01) with precision specified
462+
//! // in arg "prec" (5)}
463+
//! println!("Hello {} is {number:.prec$}", "x", prec = 5, number = 0.01);
459464
//! ```
460465
//!
461466
//! All print the same thing:

branches/auto/src/libcore/intrinsics.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,8 @@ extern "rust-intrinsic" {
192192

193193
/// The size of a type in bytes.
194194
///
195-
/// This is the exact number of bytes in memory taken up by a
196-
/// value of the given type. In other words, a memset of this size
197-
/// would *exactly* overwrite a value. When laid out in vectors
198-
/// and structures there may be additional padding between
199-
/// elements.
195+
/// More specifically, this is the offset in bytes between successive
196+
/// items of the same type, including alignment padding.
200197
pub fn size_of<T>() -> usize;
201198

202199
/// Moves a value to an uninitialized memory location.

branches/auto/src/libcore/iter/mod.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,23 @@ impl<A, B> Iterator for Chain<A, B> where
541541
}
542542
}
543543

544+
#[inline]
545+
fn find<P>(&mut self, mut predicate: P) -> Option<Self::Item> where
546+
P: FnMut(&Self::Item) -> bool,
547+
{
548+
match self.state {
549+
ChainState::Both => match self.a.find(&mut predicate) {
550+
None => {
551+
self.state = ChainState::Back;
552+
self.b.find(predicate)
553+
}
554+
v => v
555+
},
556+
ChainState::Front => self.a.find(predicate),
557+
ChainState::Back => self.b.find(predicate),
558+
}
559+
}
560+
544561
#[inline]
545562
fn last(self) -> Option<A::Item> {
546563
match self.state {

branches/auto/src/libcore/mem.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ pub fn forget<T>(t: T) {
117117

118118
/// Returns the size of a type in bytes.
119119
///
120+
/// More specifically, this is the offset in bytes between successive
121+
/// items of the same type, including alignment padding.
122+
///
120123
/// # Examples
121124
///
122125
/// ```

branches/auto/src/libcore/num/int_macros.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![doc(hidden)]
1212

13+
#[cfg(stage0)]
1314
macro_rules! int_module { ($T:ty, $bits:expr) => (
1415

1516
// FIXME(#11621): Should be deprecated once CTFE is implemented in favour of
@@ -25,3 +26,15 @@ pub const MIN: $T = (-1 as $T) << ($bits - 1);
2526
pub const MAX: $T = !MIN;
2627

2728
) }
29+
30+
#[cfg(not(stage0))]
31+
macro_rules! int_module { ($T:ident, $bits:expr) => (
32+
33+
#[stable(feature = "rust1", since = "1.0.0")]
34+
#[allow(missing_docs)]
35+
pub const MIN: $T = $T::min_value();
36+
#[stable(feature = "rust1", since = "1.0.0")]
37+
#[allow(missing_docs)]
38+
pub const MAX: $T = $T::max_value();
39+
40+
) }

branches/auto/src/libcore/num/uint_macros.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![doc(hidden)]
1212

13+
#[cfg(stage0)]
1314
macro_rules! uint_module { ($T:ty, $bits:expr) => (
1415

1516
#[stable(feature = "rust1", since = "1.0.0")]
@@ -20,3 +21,15 @@ pub const MIN: $T = 0 as $T;
2021
pub const MAX: $T = !0 as $T;
2122

2223
) }
24+
25+
#[cfg(not(stage0))]
26+
macro_rules! uint_module { ($T:ident, $bits:expr) => (
27+
28+
#[stable(feature = "rust1", since = "1.0.0")]
29+
#[allow(missing_docs)]
30+
pub const MIN: $T = $T::min_value();
31+
#[stable(feature = "rust1", since = "1.0.0")]
32+
#[allow(missing_docs)]
33+
pub const MAX: $T = $T::max_value();
34+
35+
) }

branches/auto/src/libcoretest/iter.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,19 @@ fn test_iterator_chain_count() {
133133
assert_eq!(zs.iter().chain(&ys).count(), 4);
134134
}
135135

136+
#[test]
137+
fn test_iterator_chain_find() {
138+
let xs = [0, 1, 2, 3, 4, 5];
139+
let ys = [30, 40, 50, 60];
140+
let mut iter = xs.iter().chain(&ys);
141+
assert_eq!(iter.find(|&&i| i == 4), Some(&4));
142+
assert_eq!(iter.next(), Some(&5));
143+
assert_eq!(iter.find(|&&i| i == 40), Some(&40));
144+
assert_eq!(iter.next(), Some(&50));
145+
assert_eq!(iter.find(|&&i| i == 100), None);
146+
assert_eq!(iter.next(), None);
147+
}
148+
136149
#[test]
137150
fn test_filter_map() {
138151
let it = (0..).step_by(1).take(10)

branches/auto/src/librustc/diagnostics.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,17 @@ fn foo(x: u8) -> u8 {
635635
```
636636
637637
It is advisable to find out what the unhandled cases are and check for them,
638-
returning an appropriate value or panicking if necessary.
638+
returning an appropriate value or panicking if necessary. Check if you need
639+
to remove a semicolon from the last expression, like in this case:
640+
641+
```ignore
642+
fn foo(x: u8) -> u8 {
643+
inner(2*x + 1);
644+
}
645+
```
646+
647+
The semicolon discards the return value of `inner`, instead of returning
648+
it from `foo`.
639649
"##,
640650

641651
E0270: r##"
@@ -1569,5 +1579,5 @@ register_diagnostics! {
15691579
E0490, // a value of type `..` is borrowed for too long
15701580
E0491, // in type `..`, reference has a longer lifetime than the data it...
15711581
E0495, // cannot infer an appropriate lifetime due to conflicting requirements
1572-
E0524, // expected a closure that implements `..` but this closure only implements `..`
1582+
E0525, // expected a closure that implements `..` but this closure only implements `..`
15731583
}

0 commit comments

Comments
 (0)