Skip to content

Commit 0d4293a

Browse files
committed
---
yaml --- r: 209975 b: refs/heads/try c: 38042d1 h: refs/heads/master i: 209973: 53888f6 209971: f8cac99 209967: f8fd393 v: v3
1 parent a42665c commit 0d4293a

File tree

11 files changed

+46
-56
lines changed

11 files changed

+46
-56
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 30f41b1bd672a2ceb6ed60895448fef1722ffc5d
5+
refs/heads/try: 38042d1e18bc37dac34c74e094a3678b4c613a7a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/doc/trpl/hello-cargo.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ $ mkdir src
3232
$ mv main.rs src/main.rs
3333
```
3434

35+
Note that since we're creating an executable, we used `main.rs`. If we
36+
want to make a library instead, we should use `lib.rs`.
37+
Custom file locations for the entry point can be specified
38+
with a [`[[lib]]` or `[[bin]]`][crates-custom] key in the TOML file described below.
39+
40+
[crates-custom]: http://doc.crates.io/manifest.html#configuring-a-target
41+
3542
Cargo expects your source files to live inside a `src` directory. That leaves
3643
the top level for other things, like READMEs, license information, and anything
3744
not related to your code. Cargo helps us keep our projects nice and tidy. A

branches/try/src/libcollections/string.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -951,13 +951,12 @@ impl<'a> Deref for DerefString<'a> {
951951
/// # #![feature(collections)]
952952
/// use std::string::as_string;
953953
///
954-
/// // Let's pretend we have a function that requires `&String`
955-
/// fn string_consumer(s: &String) {
956-
/// assert_eq!(s, "foo");
954+
/// fn string_consumer(s: String) {
955+
/// assert_eq!(s, "foo".to_string());
957956
/// }
958957
///
959-
/// // Provide a `&String` from a `&str` without allocating
960-
/// string_consumer(&as_string("foo"));
958+
/// let string = as_string("foo").clone();
959+
/// string_consumer(string);
961960
/// ```
962961
#[unstable(feature = "collections")]
963962
pub fn as_string<'a>(x: &'a str) -> DerefString<'a> {

branches/try/src/libcollections/vec.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,22 +1915,6 @@ impl<'a, T> Drop for DerefVec<'a, T> {
19151915
}
19161916

19171917
/// Converts a slice to a wrapper type providing a `&Vec<T>` reference.
1918-
///
1919-
/// # Examples
1920-
///
1921-
/// ```
1922-
/// # #![feature(collections)]
1923-
/// use std::vec::as_vec;
1924-
///
1925-
/// // Let's pretend we have a function that requires `&Vec<i32>`
1926-
/// fn vec_consumer(s: &Vec<i32>) {
1927-
/// assert_eq!(s, &[1, 2, 3]);
1928-
/// }
1929-
///
1930-
/// // Provide a `&Vec<i32>` from a `&[i32]` without allocating
1931-
/// let values = [1, 2, 3];
1932-
/// vec_consumer(&as_vec(&values));
1933-
/// ```
19341918
#[unstable(feature = "collections")]
19351919
pub fn as_vec<'a, T>(x: &'a [T]) -> DerefVec<'a, T> {
19361920
unsafe {

branches/try/src/libcore/cell.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl<T> RefCell<T> {
417417
///
418418
/// let result = thread::spawn(move || {
419419
/// let c = RefCell::new(5);
420-
/// let m = c.borrow();
420+
/// let m = c.borrow_mut();
421421
///
422422
/// let b = c.borrow_mut(); // this causes a panic
423423
/// }).join();

branches/try/src/libcore/convert.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,10 @@ pub trait Into<T>: Sized {
8383
/// `String` implements `From<&str>`:
8484
///
8585
/// ```
86+
/// let s = "hello";
8687
/// let string = "hello".to_string();
87-
/// let other_string = String::from("hello");
88+
///
89+
/// let other_string: String = From::from(s);
8890
///
8991
/// assert_eq!(string, other_string);
9092
/// ```

branches/try/src/librustdoc/html/render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ impl<'a> fmt::Display for Item<'a> {
14601460
try!(write!(fmt, "<span class='out-of-band'>"));
14611461
try!(write!(fmt,
14621462
r##"<span id='render-detail'>
1463-
<a id="toggle-all-docs" href="#" title="collapse all docs">[&minus;]</a>
1463+
<a id="toggle-all-docs" href="#" title="collapse all docs">[-]</a>
14641464
</span>"##));
14651465

14661466
// Write `src` tag

branches/try/src/librustdoc/html/static/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ a {
392392
text-decoration: underline;
393393
}
394394

395-
.content span.trait, .content a.trait, .block a.current.trait { color: #8866ff; }
395+
.content span.trait, .content a.trait, .block a.current.trait { color: #ed9603; }
396396
.content span.mod, .content a.mod, block a.current.mod { color: #4d76ae; }
397397
.content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
398398
.content span.struct, .content a.struct, .block a.current.struct { color: #e53700; }

branches/try/src/librustdoc/html/static/main.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -808,20 +808,20 @@
808808

809809
$("#toggle-all-docs").on("click", function() {
810810
var toggle = $("#toggle-all-docs");
811-
if (toggle.html() == "[&minus;]") {
812-
toggle.html("[&plus;]");
811+
if (toggle.html() == "[-]") {
812+
toggle.html("[+]");
813813
toggle.attr("title", "expand all docs");
814814
$(".docblock").hide();
815815
$(".toggle-label").show();
816816
$(".toggle-wrapper").addClass("collapsed");
817-
$(".collapse-toggle").children(".inner").html("&plus;");
817+
$(".collapse-toggle").children(".inner").html("+");
818818
} else {
819-
toggle.html("[&minus;]");
819+
toggle.html("[-]");
820820
toggle.attr("title", "collapse all docs");
821821
$(".docblock").show();
822822
$(".toggle-label").hide();
823823
$(".toggle-wrapper").removeClass("collapsed");
824-
$(".collapse-toggle").children(".inner").html("&minus;");
824+
$(".collapse-toggle").children(".inner").html("-");
825825
}
826826
});
827827

@@ -835,20 +835,20 @@
835835
if (relatedDoc.is(":visible")) {
836836
relatedDoc.slideUp({duration:'fast', easing:'linear'});
837837
toggle.parent(".toggle-wrapper").addClass("collapsed");
838-
toggle.children(".inner").html("&plus;");
838+
toggle.children(".inner").html("+");
839839
toggle.children(".toggle-label").fadeIn();
840840
} else {
841841
relatedDoc.slideDown({duration:'fast', easing:'linear'});
842842
toggle.parent(".toggle-wrapper").removeClass("collapsed");
843-
toggle.children(".inner").html("&minus;");
843+
toggle.children(".inner").html("-");
844844
toggle.children(".toggle-label").hide();
845845
}
846846
}
847847
});
848848

849849
$(function() {
850850
var toggle = $("<a/>", {'href': 'javascript:void(0)', 'class': 'collapse-toggle'})
851-
.html("[<span class='inner'>&minus;</span>]");
851+
.html("[<span class='inner'>-</span>]");
852852

853853
$(".method").each(function() {
854854
if ($(this).next().is(".docblock") ||

branches/try/src/libstd/sys/windows/process2.rs

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,6 @@ fn zeroed_process_information() -> libc::types::os::arch::extra::PROCESS_INFORMA
367367

368368
// Produces a wide string *without terminating null*
369369
fn make_command_line(prog: &OsStr, args: &[OsString]) -> Vec<u16> {
370-
// Encode the command and arguments in a command line string such
371-
// that the spawned process may recover them using CommandLineToArgvW.
372370
let mut cmd: Vec<u16> = Vec::new();
373371
append_arg(&mut cmd, prog);
374372
for arg in args {
@@ -389,27 +387,30 @@ fn make_command_line(prog: &OsStr, args: &[OsString]) -> Vec<u16> {
389387
}
390388

391389
let mut iter = arg.encode_wide();
392-
let mut backslashes: usize = 0;
393390
while let Some(x) = iter.next() {
394-
if x == '\\' as u16 {
395-
backslashes += 1;
396-
} else {
397-
if x == '"' as u16 {
398-
// Add n+1 backslashes to total 2n+1 before internal '"'.
399-
for _ in 0..(backslashes+1) {
400-
cmd.push('\\' as u16);
401-
}
391+
if x == '"' as u16 {
392+
// escape quotes
393+
cmd.push('\\' as u16);
394+
cmd.push('"' as u16);
395+
} else if x == '\\' as u16 {
396+
// is this a run of backslashes followed by a " ?
397+
if iter.clone().skip_while(|y| *y == '\\' as u16).next() == Some('"' as u16) {
398+
// Double it ... NOTE: this behavior is being
399+
// preserved as it's been part of Rust for a long
400+
// time, but no one seems to know exactly why this
401+
// is the right thing to do.
402+
cmd.push('\\' as u16);
403+
cmd.push('\\' as u16);
404+
} else {
405+
// Push it through unescaped
406+
cmd.push('\\' as u16);
402407
}
403-
backslashes = 0;
408+
} else {
409+
cmd.push(x)
404410
}
405-
cmd.push(x);
406411
}
407412

408413
if quote {
409-
// Add n backslashes to total 2n before ending '"'.
410-
for _ in 0..backslashes {
411-
cmd.push('\\' as u16);
412-
}
413414
cmd.push('"' as u16);
414415
}
415416
}
@@ -485,10 +486,6 @@ mod tests {
485486
test_wrapper("echo", &["a b c"]),
486487
"echo \"a b c\""
487488
);
488-
assert_eq!(
489-
test_wrapper("echo", &["\" \\\" \\", "\\"]),
490-
"echo \"\\\" \\\\\\\" \\\\\" \\"
491-
);
492489
assert_eq!(
493490
test_wrapper("\u{03c0}\u{042f}\u{97f3}\u{00e6}\u{221e}", &[]),
494491
"\u{03c0}\u{042f}\u{97f3}\u{00e6}\u{221e}"

branches/try/src/libstd/thread/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@
115115
//! ## Configuring threads
116116
//!
117117
//! A new thread can be configured before it is spawned via the `Builder` type,
118-
//! which currently allows you to set the name and stack size for the child thread:
118+
//! which currently allows you to set the name, stack size, and writers for
119+
//! `println!` and `panic!` for the child thread:
119120
//!
120121
//! ```rust
121122
//! # #![allow(unused_must_use)]

0 commit comments

Comments
 (0)