Skip to content

Commit 053cf52

Browse files
committed
---
yaml --- r: 209486 b: refs/heads/try c: 4991c7a h: refs/heads/master v: v3
1 parent c0d93b8 commit 053cf52

File tree

430 files changed

+28778
-4142
lines changed

Some content is hidden

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

430 files changed

+28778
-4142
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: 1014ac44f6271a55249b0488a2ce1cc49deed338
5+
refs/heads/try: 4991c7acad6e030120a2ca352ccd3ed71c5f7aa7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/compiletest/compiletest.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212

1313
#![feature(box_syntax)]
1414
#![feature(collections)]
15+
#![feature(old_io)]
1516
#![feature(rustc_private)]
17+
#![feature(unboxed_closures)]
1618
#![feature(std_misc)]
1719
#![feature(test)]
1820
#![feature(path_ext)]
1921
#![feature(str_char)]
20-
#![feature(libc)]
2122

2223
#![deny(warnings)]
2324

24-
extern crate libc;
2525
extern crate test;
2626
extern crate getopts;
2727

@@ -42,7 +42,6 @@ pub mod header;
4242
pub mod runtest;
4343
pub mod common;
4444
pub mod errors;
45-
mod raise_fd_limit;
4645

4746
pub fn main() {
4847
let config = parse_config(env::args().collect());
@@ -246,7 +245,11 @@ pub fn run_tests(config: &Config) {
246245
// sadly osx needs some file descriptor limits raised for running tests in
247246
// parallel (especially when we have lots and lots of child processes).
248247
// For context, see #8904
249-
unsafe { raise_fd_limit::raise_fd_limit(); }
248+
#[allow(deprecated)]
249+
fn raise_fd_limit() {
250+
std::old_io::test::raise_fd_limit();
251+
}
252+
raise_fd_limit();
250253
// Prevent issue #21352 UAC blocking .exe containing 'patch' etc. on Windows
251254
// If #11207 is resolved (adding manifest to .exe) this becomes unnecessary
252255
env::set_var("__COMPAT_LAYER", "RunAsInvoker");
@@ -368,7 +371,7 @@ pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::Test
368371
fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
369372
match full_version_line {
370373
Some(ref full_version_line)
371-
if !full_version_line.trim().is_empty() => {
374+
if full_version_line.trim().len() > 0 => {
372375
let full_version_line = full_version_line.trim();
373376

374377
// used to be a regex "(^|[^0-9])([0-9]\.[0-9])([^0-9]|$)"
@@ -408,7 +411,7 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
408411

409412
match full_version_line {
410413
Some(ref full_version_line)
411-
if !full_version_line.trim().is_empty() => {
414+
if full_version_line.trim().len() > 0 => {
412415
let full_version_line = full_version_line.trim();
413416

414417
for (pos, l) in full_version_line.char_indices() {
@@ -426,7 +429,7 @@ fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
426429
let vers = full_version_line[pos + 5..].chars().take_while(|c| {
427430
c.is_digit(10)
428431
}).collect::<String>();
429-
if !vers.is_empty() { return Some(vers) }
432+
if vers.len() > 0 { return Some(vers) }
430433
}
431434
println!("Could not extract LLDB version from line '{}'",
432435
full_version_line);

branches/try/src/compiletest/raise_fd_limit.rs

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

branches/try/src/compiletest/runtest.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use std::net::TcpStream;
2929
use std::path::{Path, PathBuf};
3030
use std::process::{Command, Output, ExitStatus};
3131
use std::str;
32+
use std::time::Duration;
3233
use test::MetricMap;
3334

3435
pub fn run(config: Config, testfile: &Path) {
@@ -451,7 +452,11 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
451452
.expect(&format!("failed to exec `{:?}`", config.adb_path));
452453
loop {
453454
//waiting 1 second for gdbserver start
454-
::std::thread::sleep_ms(1000);
455+
#[allow(deprecated)]
456+
fn sleep() {
457+
::std::old_io::timer::sleep(Duration::milliseconds(1000));
458+
}
459+
sleep();
455460
if TcpStream::connect("127.0.0.1:5039").is_ok() {
456461
break
457462
}
@@ -864,7 +869,7 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
864869
}
865870
first = false;
866871
}
867-
if !failed && rest.is_empty() {
872+
if !failed && rest.len() == 0 {
868873
i += 1;
869874
}
870875
if i == num_check_lines {
@@ -1662,7 +1667,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
16621667
// codegen tests (vs. clang)
16631668

16641669
fn append_suffix_to_stem(p: &Path, suffix: &str) -> PathBuf {
1665-
if suffix.is_empty() {
1670+
if suffix.len() == 0 {
16661671
p.to_path_buf()
16671672
} else {
16681673
let mut stem = p.file_stem().unwrap().to_os_string();

branches/try/src/doc/index.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ Rust, its syntax, and its concepts. Upon completing the book, you'll be an
1515
intermediate Rust developer, and will have a good grasp of the fundamental
1616
ideas behind Rust.
1717

18-
[Rust By Example][rbe] was originally a community resource, but was then
19-
donated to the Rust project. As the name implies, it teaches you Rust through a
20-
series of small examples.
21-
22-
[rbe]: http://rustbyexample.com/
23-
2418
# Community & Getting Help
2519

2620
If you need help with something, or just want to talk about Rust with others,
@@ -82,3 +76,17 @@ We have [API documentation for the entire standard
8276
library](std/index.html). There's a list of crates on the left with more
8377
specific sections, or you can use the search bar at the top to search for
8478
something if you know its name.
79+
80+
# External documentation
81+
82+
*Note: While these are great resources for learning Rust, they may track a
83+
particular version of Rust that is likely not exactly the same as that for
84+
which this documentation was generated.*
85+
86+
* [Rust by Example] - Short examples of common tasks in Rust (tracks the master
87+
branch).
88+
* [Rust for Rubyists] - The first community tutorial for Rust. Tracks the last
89+
stable release. Not just for Ruby programmers.
90+
91+
[Rust by Example]: http://rustbyexample.com/
92+
[Rust for Rubyists]: http://www.rustforrubyists.com/

branches/try/src/doc/intro.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ safe concurrent programs.
389389
Here's an example of a concurrent Rust program:
390390
391391
```{rust}
392-
# #![feature(scoped)]
393392
use std::thread;
394393
395394
fn main() {
@@ -422,7 +421,6 @@ problem.
422421
Let's see an example. This Rust code will not compile:
423422
424423
```{rust,ignore}
425-
# #![feature(scoped)]
426424
use std::thread;
427425
428426
fn main() {
@@ -469,7 +467,6 @@ that our mutation doesn't cause a data race.
469467
Here's what using a Mutex looks like:
470468
471469
```{rust}
472-
# #![feature(scoped)]
473470
use std::thread;
474471
use std::sync::Mutex;
475472
@@ -530,7 +527,6 @@ As an example, Rust's ownership system is _entirely_ at compile time. The
530527
safety check that makes this an error about moved values:
531528
532529
```{rust,ignore}
533-
# #![feature(scoped)]
534530
use std::thread;
535531
536532
fn main() {

branches/try/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3788,7 +3788,7 @@ its type parameters are types:
37883788

37893789
```ignore
37903790
fn map<A: Clone, B: Clone>(f: |A| -> B, xs: &[A]) -> Vec<B> {
3791-
if xs.is_empty() {
3791+
if xs.len() == 0 {
37923792
return vec![];
37933793
}
37943794
let first: B = f(xs[0].clone());

branches/try/src/doc/trpl/comments.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,47 @@
11
% Comments
22

3-
Now that we have some functions, its a good idea to learn about comments.
3+
Now that we have some functions, it's a good idea to learn about comments.
44
Comments are notes that you leave to other programmers to help explain things
55
about your code. The compiler mostly ignores them.
66

77
Rust has two kinds of comments that you should care about: *line comments*
88
and *doc comments*.
99

10-
```rust
11-
// Line comments are anything after ‘//’ and extend to the end of the line.
10+
```{rust}
11+
// Line comments are anything after '//' and extend to the end of the line.
1212
1313
let x = 5; // this is also a line comment.
1414
1515
// If you have a long explanation for something, you can put line comments next
16-
// to each other. Put a space between the // and your comment so that its
16+
// to each other. Put a space between the // and your comment so that it's
1717
// more readable.
1818
```
1919

2020
The other kind of comment is a doc comment. Doc comments use `///` instead of
2121
`//`, and support Markdown notation inside:
2222

23-
```rust
24-
/// Adds one to the number given.
23+
```{rust}
24+
/// `hello` is a function that prints a greeting that is personalized based on
25+
/// the name given.
2526
///
26-
/// # Examples
27+
/// # Arguments
2728
///
28-
/// ```
29-
/// let five = 5;
29+
/// * `name` - The name of the person you'd like to greet.
30+
///
31+
/// # Examples
3032
///
31-
/// assert_eq!(6, add_one(5));
33+
/// ```rust
34+
/// let name = "Steve";
35+
/// hello(name); // prints "Hello, Steve!"
3236
/// ```
33-
fn add_one(x: i32) -> i32 {
34-
x + 1
37+
fn hello(name: &str) {
38+
println!("Hello, {}!", name);
3539
}
3640
```
3741

38-
When writing doc comments, providing some examples of usage is very, very
39-
helpful. You’ll notice we’ve used a new macro here: `assert_eq!`. This compares
40-
two values, and `panic!`s if they’re not equal to each other. It’s very helpful
41-
in documentation. There’s another macro, `assert!`, which `panic!`s if the
42-
value passed to it is `false`.
42+
When writing doc comments, adding sections for any arguments, return values,
43+
and providing some examples of usage is very, very helpful. Don't worry about
44+
the `&str`, we'll get to it soon.
4345

4446
You can use the [`rustdoc`](documentation.html) tool to generate HTML documentation
45-
from these doc comments, and also to run the code examples as tests!
47+
from these doc comments.

0 commit comments

Comments
 (0)