Skip to content

Commit 27cacb2

Browse files
committed
---
yaml --- r: 274671 b: refs/heads/stable c: 5089b43 h: refs/heads/master i: 274669: c673fe4 274667: 6a198cd 274663: d292bc5 274655: 7a7dfc2
1 parent 52a7146 commit 27cacb2

File tree

6 files changed

+16
-51
lines changed

6 files changed

+16
-51
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: 75271d8f1ad12ff8b9e97c4df1c94e7b3911e485
32+
refs/heads/stable: 5089b43b4560043150b88e6de1ee98eabf0bf11d
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/liballoc/arc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ impl<T: ?Sized> Deref for Arc<T> {
380380
}
381381

382382
impl<T: Clone> Arc<T> {
383-
/// Make a mutable reference into the given `Arc<T>`.
384-
/// If the `Arc<T>` has more than one strong reference, or any weak
385-
/// references, the inner data is cloned.
383+
/// Make a mutable reference into the given `Arc<T>` by cloning the inner
384+
/// data if the `Arc<T>` doesn't have one strong reference and no weak
385+
/// references.
386386
///
387387
/// This is also referred to as a copy-on-write.
388388
///

branches/stable/src/libcollections/string.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -479,16 +479,15 @@ impl String {
479479
}
480480
}
481481

482-
/// Converts a slice of bytes to a `String`, including invalid characters.
482+
/// Converts a slice of bytes to a string, including invalid characters.
483483
///
484-
/// A string slice ([`&str`]) is made of bytes ([`u8`]), and a slice of
485-
/// bytes ([`&[u8]`][byteslice]) is made of bytes, so this function converts between
486-
/// the two. Not all byte slices are valid string slices, however: [`&str`]
487-
/// requires that it is valid UTF-8. During this conversion,
484+
/// Strings are made of bytes ([`u8`]), and a slice of bytes
485+
/// ([`&[u8]`][byteslice]) is made of bytes, so this function converts
486+
/// between the two. Not all byte slices are valid strings, however: strings
487+
/// are required to be valid UTF-8. During this conversion,
488488
/// `from_utf8_lossy()` will replace any invalid UTF-8 sequences with
489489
/// `U+FFFD REPLACEMENT CHARACTER`, which looks like this: �
490490
///
491-
/// [`&str`]: ../primitive.str.html
492491
/// [`u8`]: ../primitive.u8.html
493492
/// [byteslice]: ../primitive.slice.html
494493
///
@@ -499,10 +498,13 @@ impl String {
499498
///
500499
/// [`from_utf8_unchecked()`]: struct.String.html#method.from_utf8_unchecked
501500
///
502-
/// If you need a [`&str`] instead of a `String`, consider
503-
/// [`str::from_utf8()`].
501+
/// This function returns a [`Cow<'a, str>`]. If our byte slice is invalid
502+
/// UTF-8, then we need to insert the replacement characters, which will
503+
/// change the size of the string, and hence, require a `String`. But if
504+
/// it's already valid UTF-8, we don't need a new allocation. This return
505+
/// type allows us to handle both cases.
504506
///
505-
/// [`str::from_utf8()`]: ../str/fn.from_utf8.html
507+
/// [`Cow<'a, str>`]: ../borrow/enum.Cow.html
506508
///
507509
/// # Examples
508510
///
@@ -512,8 +514,7 @@ impl String {
512514
/// // some bytes, in a vector
513515
/// let sparkle_heart = vec![240, 159, 146, 150];
514516
///
515-
/// // We know these bytes are valid, so we'll use `unwrap()`.
516-
/// let sparkle_heart = String::from_utf8(sparkle_heart).unwrap();
517+
/// let sparkle_heart = String::from_utf8_lossy(&sparkle_heart);
517518
///
518519
/// assert_eq!("💖", sparkle_heart);
519520
/// ```

branches/stable/src/librustc/session/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ pub enum PrintRequest {
163163
FileNames,
164164
Sysroot,
165165
CrateName,
166-
Cfg,
167166
}
168167

169168
pub enum Input {
@@ -1106,7 +1105,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
11061105
"crate-name" => PrintRequest::CrateName,
11071106
"file-names" => PrintRequest::FileNames,
11081107
"sysroot" => PrintRequest::Sysroot,
1109-
"cfg" => PrintRequest::Cfg,
11101108
req => {
11111109
early_error(error_format, &format!("unknown print request `{}`", req))
11121110
}

branches/stable/src/librustc_driver/lib.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -518,25 +518,6 @@ impl RustcDefaultCalls {
518518
.to_string_lossy());
519519
}
520520
}
521-
PrintRequest::Cfg => {
522-
for cfg in config::build_configuration(sess) {
523-
match cfg.node {
524-
ast::MetaWord(ref word) => println!("{}", word),
525-
ast::MetaNameValue(ref name, ref value) => {
526-
println!("{}=\"{}\"", name, match value.node {
527-
ast::LitStr(ref s, _) => s,
528-
_ => continue,
529-
});
530-
}
531-
// Right now there are not and should not be any
532-
// MetaList items in the configuration returned by
533-
// `build_configuration`.
534-
ast::MetaList(..) => {
535-
panic!("MetaList encountered in default cfg")
536-
}
537-
}
538-
}
539-
}
540521
}
541522
}
542523
return Compilation::Stop;

branches/stable/src/test/run-make/print-cfg/Makefile

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)