Skip to content

Commit cee6805

Browse files
committed
---
yaml --- r: 275288 b: refs/heads/stable c: d555882 h: refs/heads/master
1 parent 302e231 commit cee6805

File tree

33 files changed

+275
-86
lines changed

33 files changed

+275
-86
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: a34fd5c3fea8e7301e33531ee3c27b3299eaeab6
32+
refs/heads/stable: d5558825b484b022fc00715b8bf441c2542ac4a2
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/RELEASES.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Libraries
7575
improved by using `memchr` to search for newlines][1.7m].
7676
* [`f32::to_degrees` and `f32::to_radians` are stable][1.7f]. The
7777
`f64` variants were stabilized previously.
78-
* [`BTreeMap` was rewritten to use less memory improve performance of
79-
insertion and iteration, the latter by as much as 5x`][1.7bm].
78+
* [`BTreeMap` was rewritten to use less memory and improve the performance
79+
of insertion and iteration, the latter by as much as 5x`][1.7bm].
8080
* [`BTreeSet` and its iterators, `Iter`, `IntoIter`, and `Range` are
8181
covariant over their contained type][1.7bt].
8282
* [`LinkedList` and its iterators, `Iter` and `IntoIter` are covariant

branches/stable/src/doc/book/const-and-static.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ unsafe {
6464

6565
[unsafe]: unsafe.html
6666

67-
Furthermore, any type stored in a `static` must be `Sync`, and may not have
67+
Furthermore, any type stored in a `static` must be `Sync`, and must not have
6868
a [`Drop`][drop] implementation.
6969

7070
[drop]: drop.html
7171

7272
# Initializing
7373

74-
Both `const` and `static` have requirements for giving them a value. They may
75-
only be given a value that’s a constant expression. In other words, you cannot
76-
use the result of a function call or anything similarly complex or at runtime.
74+
Both `const` and `static` have requirements for giving them a value. They must
75+
be given a value that’s a constant expression. In other words, you cannot use
76+
the result of a function call or anything similarly complex or at runtime.
7777

7878
# Which construct should I use?
7979

branches/stable/src/doc/book/guessing-game.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -906,17 +906,17 @@ let guess: u32 = match guess.trim().parse() {
906906
Err(_) => continue,
907907
};
908908
```
909-
910909
This is how you generally move from ‘crash on error’ to ‘actually handle the
911-
error’, by switching from `expect()` to a `match` statement. The `Result`
912-
returned by `parse()` is an `enum` like `Ordering`, but in this case, each
913-
variant has some data associated with it: `Ok` is a success, and `Err` is a
910+
error’, by switching from `expect()` to a `match` statement. A `Result` is
911+
returned by `parse()`, this is an `enum` like `Ordering`, but in this case,
912+
each variant has some data associated with it: `Ok` is a success, and `Err` is a
914913
failure. Each contains more information: the successfully parsed integer, or an
915-
error type. In this case, we `match` on `Ok(num)`, which sets the inner value
916-
of the `Ok` to the name `num`, and then we return it on the right-hand
917-
side. In the `Err` case, we don’t care what kind of error it is, so we
918-
use `_` instead of a name. This ignores the error, and `continue` causes us
919-
to go to the next iteration of the `loop`.
914+
error type. In this case, we `match` on `Ok(num)`, which sets the name `num` to
915+
the unwrapped `Ok` value (ythe integer), and then we return it on the
916+
right-hand side. In the `Err` case, we don’t care what kind of error it is, so
917+
we just use the catch all `_` instead of a name. This catches everything that
918+
isn't `Ok`, and `continue` lets us move to the next iteration of the loop; in
919+
effect, this enables us to ignore all errors and continue with our program.
920920
921921
Now we should be good! Let’s try:
922922

branches/stable/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3040,7 +3040,7 @@ the case of a `while` loop, the head is the conditional expression controlling
30403040
the loop. In the case of a `for` loop, the head is the call-expression
30413041
controlling the loop. If the label is present, then `continue 'foo` returns
30423042
control to the head of the loop with label `'foo`, which need not be the
3043-
innermost label enclosing the `break` expression, but must enclose it.
3043+
innermost label enclosing the `continue` expression, but must enclose it.
30443044

30453045
A `continue` expression is only permitted in the body of a loop.
30463046

branches/stable/src/libcollections/str.rs

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,11 @@ impl str {
267267
/// Converts a string slice to a raw pointer.
268268
///
269269
/// As string slices are a slice of bytes, the raw pointer points to a
270-
/// `u8`. This pointer will be pointing to the first byte of the string
270+
/// [`u8`]. This pointer will be pointing to the first byte of the string
271271
/// slice.
272272
///
273+
/// [`u8`]: primitive.u8.html
274+
///
273275
/// # Examples
274276
///
275277
/// Basic usage:
@@ -661,7 +663,7 @@ impl str {
661663
/// assert_eq!(None, chars.next());
662664
/// ```
663665
///
664-
/// Remember, `char`s may not match your human intuition about characters:
666+
/// Remember, [`char`]s may not match your human intuition about characters:
665667
///
666668
/// ```
667669
/// let y = "y̆";
@@ -678,16 +680,18 @@ impl str {
678680
pub fn chars(&self) -> Chars {
679681
core_str::StrExt::chars(self)
680682
}
681-
/// Returns an iterator over the `char`s of a string slice, and their
683+
/// Returns an iterator over the [`char`]s of a string slice, and their
682684
/// positions.
683685
///
684686
/// As a string slice consists of valid UTF-8, we can iterate through a
685-
/// string slice by `char`. This method returns an iterator of both
686-
/// these `char`s, as well as their byte positions.
687+
/// string slice by [`char`]. This method returns an iterator of both
688+
/// these [`char`]s, as well as their byte positions.
687689
///
688-
/// The iterator yields tuples. The position is first, the `char` is
690+
/// The iterator yields tuples. The position is first, the [`char`] is
689691
/// second.
690692
///
693+
/// [`char`]: primitive.char.html
694+
///
691695
/// # Examples
692696
///
693697
/// Basic usage:
@@ -711,7 +715,7 @@ impl str {
711715
/// assert_eq!(None, char_indices.next());
712716
/// ```
713717
///
714-
/// Remember, `char`s may not match your human intuition about characters:
718+
/// Remember, [`char`]s may not match your human intuition about characters:
715719
///
716720
/// ```
717721
/// let y = "y̆";
@@ -918,12 +922,13 @@ impl str {
918922
/// Returns the byte index of the first character of this string slice that
919923
/// matches the pattern.
920924
///
921-
/// Returns `None` if the pattern doesn't match.
925+
/// Returns [`None`] if the pattern doesn't match.
922926
///
923927
/// The pattern can be a `&str`, [`char`], or a closure that determines if
924928
/// a character matches.
925929
///
926930
/// [`char`]: primitive.char.html
931+
/// [`None`]: option/enum.Option.html#variant.None
927932
///
928933
/// # Examples
929934
///
@@ -962,12 +967,13 @@ impl str {
962967
/// Returns the byte index of the last character of this string slice that
963968
/// matches the pattern.
964969
///
965-
/// Returns `None` if the pattern doesn't match.
970+
/// Returns [`None`] if the pattern doesn't match.
966971
///
967972
/// The pattern can be a `&str`, [`char`], or a closure that determines if
968973
/// a character matches.
969974
///
970975
/// [`char`]: primitive.char.html
976+
/// [`None`]: option/enum.Option.html#variant.None
971977
///
972978
/// # Examples
973979
///
@@ -1187,14 +1193,18 @@ impl str {
11871193
/// An iterator over substrings of `self`, separated by characters
11881194
/// matched by a pattern and yielded in reverse order.
11891195
///
1190-
/// The pattern can be a simple `&str`, `char`, or a closure that
1196+
/// The pattern can be a simple `&str`, [`char`], or a closure that
11911197
/// determines the split.
11921198
/// Additional libraries might provide more complex patterns like
11931199
/// regular expressions.
11941200
///
1195-
/// Equivalent to `split`, except that the trailing substring is
1201+
/// [`char`]: primitive.char.html
1202+
///
1203+
/// Equivalent to [`split()`], except that the trailing substring is
11961204
/// skipped if empty.
11971205
///
1206+
/// [`split()`]: #method.split
1207+
///
11981208
/// This method can be used for string data that is _terminated_,
11991209
/// rather than _separated_ by a pattern.
12001210
///
@@ -1457,7 +1467,7 @@ impl str {
14571467
/// # Iterator behavior
14581468
///
14591469
/// The returned iterator requires that the pattern supports a reverse
1460-
/// search, and it will be a `[DoubleEndedIterator]` if a forward/reverse
1470+
/// search, and it will be a [`DoubleEndedIterator`] if a forward/reverse
14611471
/// search yields the same elements.
14621472
///
14631473
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
@@ -1694,9 +1704,11 @@ impl str {
16941704
///
16951705
/// # Errors
16961706
///
1697-
/// Will return `Err` if it's not possible to parse this string slice into
1707+
/// Will return [`Err`] if it's not possible to parse this string slice into
16981708
/// the desired type.
16991709
///
1710+
/// [`Err`]: str/trait.FromStr.html#associatedtype.Err
1711+
///
17001712
/// # Example
17011713
///
17021714
/// Basic usage
@@ -1707,7 +1719,7 @@ impl str {
17071719
/// assert_eq!(4, four);
17081720
/// ```
17091721
///
1710-
/// Using the 'turbofish' instead of annotationg `four`:
1722+
/// Using the 'turbofish' instead of annotating `four`:
17111723
///
17121724
/// ```
17131725
/// let four = "4".parse::<u32>();
@@ -1765,11 +1777,13 @@ impl str {
17651777
result
17661778
}
17671779

1768-
/// Returns the lowercase equivalent of this string slice, as a new `String`.
1780+
/// Returns the lowercase equivalent of this string slice, as a new [`String`].
17691781
///
17701782
/// 'Lowercase' is defined according to the terms of the Unicode Derived Core Property
17711783
/// `Lowercase`.
17721784
///
1785+
/// [`String`]: string/struct.String.html
1786+
///
17731787
/// # Examples
17741788
///
17751789
/// Basic usage:
@@ -1839,11 +1853,13 @@ impl str {
18391853
}
18401854
}
18411855

1842-
/// Returns the uppercase equivalent of this string slice, as a new `String`.
1856+
/// Returns the uppercase equivalent of this string slice, as a new [`String`].
18431857
///
18441858
/// 'Uppercase' is defined according to the terms of the Unicode Derived Core Property
18451859
/// `Uppercase`.
18461860
///
1861+
/// [`String`]: string/struct.String.html
1862+
///
18471863
/// # Examples
18481864
///
18491865
/// Basic usage:
@@ -1884,7 +1900,9 @@ impl str {
18841900
self.chars().flat_map(|c| c.escape_unicode()).collect()
18851901
}
18861902

1887-
/// Converts a `Box<str>` into a `String` without copying or allocating.
1903+
/// Converts a `Box<str>` into a [`String`] without copying or allocating.
1904+
///
1905+
/// [`String`]: string/struct.String.html
18881906
///
18891907
/// # Examples
18901908
///

branches/stable/src/libcore/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
//! ```
190190
//! let values = vec![1, 2, 3, 4, 5];
191191
//! {
192-
//! let result = match values.into_iter() {
192+
//! let result = match IntoIterator::into_iter(values) {
193193
//! mut iter => loop {
194194
//! match iter.next() {
195195
//! Some(x) => { println!("{}", x); },

branches/stable/src/libcore/num/flt2dec/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl<'a> Part<'a> {
210210
}
211211
}
212212
Part::Copy(buf) => {
213-
out[..buf.len()].clone_from_slice(buf);
213+
out[..buf.len()].copy_from_slice(buf);
214214
}
215215
}
216216
Some(len)
@@ -245,7 +245,7 @@ impl<'a> Formatted<'a> {
245245
/// (It may still leave partially written bytes in the buffer; do not rely on that.)
246246
pub fn write(&self, out: &mut [u8]) -> Option<usize> {
247247
if out.len() < self.sign.len() { return None; }
248-
out[..self.sign.len()].clone_from_slice(self.sign);
248+
out[..self.sign.len()].copy_from_slice(self.sign);
249249

250250
let mut written = self.sign.len();
251251
for part in self.parts {

branches/stable/src/libcoretest/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#![feature(box_syntax)]
1616
#![feature(cell_extras)]
1717
#![feature(const_fn)]
18+
#![feature(copy_from_slice)]
1819
#![feature(core_float)]
1920
#![feature(core_private_bignum)]
2021
#![feature(core_private_diy_float)]

branches/stable/src/libcoretest/num/flt2dec/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn check_exact<F, T>(mut f: F, v: T, vstr: &str, expected: &[u8], expectedk: i16
100100

101101
// check significant digits
102102
for i in 1..cut.unwrap_or(expected.len() - 1) {
103-
expected_[..i].clone_from_slice(&expected[..i]);
103+
expected_[..i].copy_from_slice(&expected[..i]);
104104
let mut expectedk_ = expectedk;
105105
if expected[i] >= b'5' {
106106
// check if this is a rounding-to-even case.
@@ -147,7 +147,7 @@ fn check_exact<F, T>(mut f: F, v: T, vstr: &str, expected: &[u8], expectedk: i16
147147
// check infinite zero digits
148148
if let Some(cut) = cut {
149149
for i in cut..expected.len()-1 {
150-
expected_[..cut].clone_from_slice(&expected[..cut]);
150+
expected_[..cut].copy_from_slice(&expected[..cut]);
151151
for c in &mut expected_[cut..i] { *c = b'0'; }
152152

153153
try_exact!(f(&decoded) => &mut buf, &expected_[..i], expectedk;

branches/stable/src/librbml/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
test(attr(deny(warnings))))]
123123
#![cfg_attr(not(stage0), deny(warnings))]
124124

125+
#![feature(copy_from_slice)]
125126
#![feature(rustc_private)]
126127
#![feature(staged_api)]
127128

@@ -519,7 +520,7 @@ pub mod reader {
519520
// of the page and segfault.
520521

521522
let mut b = [0; 8];
522-
b.clone_from_slice(&d.data[d.end - 8..d.end]);
523+
b.copy_from_slice(&d.data[d.end - 8..d.end]);
523524
let data = unsafe { (*(b.as_ptr() as *const u64)).to_be() };
524525
let len = d.end - d.start;
525526
if len < 8 {
@@ -1043,7 +1044,7 @@ pub mod writer {
10431044
{
10441045
let last_size_pos = last_size_pos as usize;
10451046
let data = &self.writer.get_ref()[last_size_pos + 4..cur_pos as usize];
1046-
buf[..size].clone_from_slice(data);
1047+
buf[..size].copy_from_slice(data);
10471048
}
10481049

10491050
// overwrite the size and data and continue

branches/stable/src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#![feature(cell_extras)]
3030
#![feature(collections)]
3131
#![feature(const_fn)]
32+
#![feature(copy_from_slice)]
3233
#![feature(enumset)]
3334
#![feature(iter_arith)]
3435
#![feature(libc)]

0 commit comments

Comments
 (0)