Skip to content

Commit b5fc6ec

Browse files
committed
---
yaml --- r: 132781 b: refs/heads/dist-snap c: bf0a925 h: refs/heads/master i: 132779: 1b4f4cd v: v3
1 parent 194f232 commit b5fc6ec

File tree

253 files changed

+5182
-2084
lines changed

Some content is hidden

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

253 files changed

+5182
-2084
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 457a3c991d79b971be07fce75f9d0c12848fb37c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 05e45b9e365edad947ff4de10680127686e39a04
9+
refs/heads/dist-snap: bf0a925dcde7a2c66df4e05661a9b1d1472435ab
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> {
233233
parse_name_value_directive(line, "exec-env").map(|nv| {
234234
// nv is either FOO or FOO=BAR
235235
let mut strs: Vec<String> = nv.as_slice()
236-
.splitn('=', 1)
236+
.splitn(1, '=')
237237
.map(|s| s.to_string())
238238
.collect();
239239

branches/dist-snap/src/compiletest/runtest.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ use header::TestProps;
1616
use header;
1717
use procsrv;
1818
use util::logv;
19-
#[cfg(target_os = "win32")]
19+
#[cfg(target_os = "windows")]
20+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
2021
use util;
2122

2223
use std::io::File;
@@ -30,6 +31,7 @@ use std::os;
3031
use std::str;
3132
use std::string::String;
3233
use std::task;
34+
use std::time::Duration;
3335
use test::MetricMap;
3436

3537
pub fn run(config: Config, testfile: String) {
@@ -400,7 +402,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
400402
.expect(format!("failed to exec `{}`", config.adb_path).as_slice());
401403
loop {
402404
//waiting 1 second for gdbserver start
403-
timer::sleep(1000);
405+
timer::sleep(Duration::milliseconds(1000));
404406
let result = task::try(proc() {
405407
tcp::TcpStream::connect("127.0.0.1", 5039).unwrap();
406408
});
@@ -816,7 +818,8 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
816818
format!("{}:{}:", testfile.display(), ee.line)
817819
}).collect::<Vec<String> >();
818820

819-
#[cfg(target_os = "win32")]
821+
#[cfg(target_os = "windows")]
822+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
820823
fn to_lower( s : &str ) -> String {
821824
let i = s.chars();
822825
let c : Vec<char> = i.map( |c| {
@@ -829,7 +832,8 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
829832
String::from_chars(c.as_slice())
830833
}
831834

832-
#[cfg(target_os = "win32")]
835+
#[cfg(target_os = "windows")]
836+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
833837
fn prefix_matches( line : &str, prefix : &str ) -> bool {
834838
to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice())
835839
}
@@ -1246,14 +1250,16 @@ fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String {
12461250
format!("{} {}", prog, args.connect(" "))
12471251
}
12481252

1249-
#[cfg(target_os = "win32")]
1253+
#[cfg(target_os = "windows")]
1254+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
12501255
fn make_cmdline(libpath: &str, prog: &str, args: &[String]) -> String {
12511256
format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
12521257
}
12531258

12541259
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
12551260
// for diagnostic purposes
1256-
#[cfg(target_os = "win32")]
1261+
#[cfg(target_os = "windows")]
1262+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
12571263
fn lib_path_cmd_prefix(path: &str) -> String {
12581264
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
12591265
}

branches/dist-snap/src/compiletest/util.rs

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

1111
use common::Config;
1212

13-
#[cfg(target_os = "win32")]
13+
#[cfg(target_os = "windows")]
14+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
1415
use std::os::getenv;
1516

1617
/// Conversion table from triple OS name to Rust SYSNAME
1718
static OS_TABLE: &'static [(&'static str, &'static str)] = &[
18-
("mingw32", "win32"),
19-
("win32", "win32"),
19+
("mingw32", "windows"),
20+
("win32", "windows"),
21+
("windows", "windows"),
2022
("darwin", "macos"),
2123
("android", "android"),
2224
("linux", "linux"),
@@ -33,7 +35,8 @@ pub fn get_os(triple: &str) -> &'static str {
3335
fail!("Cannot determine OS from triple");
3436
}
3537

36-
#[cfg(target_os = "win32")]
38+
#[cfg(target_os = "windows")]
39+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
3740
pub fn make_new_path(path: &str) -> String {
3841

3942
// Windows just uses PATH as the library search path, so we have to
@@ -46,10 +49,12 @@ pub fn make_new_path(path: &str) -> String {
4649
}
4750
}
4851

49-
#[cfg(target_os = "win32")]
52+
#[cfg(target_os = "windows")]
53+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
5054
pub fn lib_path_env_var() -> &'static str { "PATH" }
5155

52-
#[cfg(target_os = "win32")]
56+
#[cfg(target_os = "windows")]
57+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
5358
pub fn path_div() -> &'static str { ";" }
5459

5560
pub fn logv(config: &Config, s: String) {

branches/dist-snap/src/doc/guide-ffi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ linking to, and in the second case `bar` is the type of native library that the
350350
compiler is linking to. There are currently three known types of native
351351
libraries:
352352
353-
* Dynamic - `#[link(name = "readline")]
354-
* Static - `#[link(name = "my_build_dependency", kind = "static")]
355-
* Frameworks - `#[link(name = "CoreFoundation", kind = "framework")]
353+
* Dynamic - `#[link(name = "readline")]`
354+
* Static - `#[link(name = "my_build_dependency", kind = "static")]`
355+
* Frameworks - `#[link(name = "CoreFoundation", kind = "framework")]`
356356
357357
Note that frameworks are only available on OSX targets.
358358

branches/dist-snap/src/doc/guide.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ while !done {
13601360
```
13611361

13621362
`while` loops are the correct choice when you're not sure how many times
1363-
you need to loop.
1363+
you need to loop.
13641364

13651365
If you need an infinite loop, you may be tempted to write this:
13661366

@@ -1650,7 +1650,7 @@ a full line of input. Nice and easy.
16501650
.ok().expect("Failed to read line");
16511651
```
16521652

1653-
Do you remember this code?
1653+
Do you remember this code?
16541654

16551655
```
16561656
enum OptionalInt {
@@ -1796,6 +1796,21 @@ Excellent! Open up your `src/main.rs` again. We'll be writing all of
17961796
our code in this file. We'll talk about multiple-file projects later on in the
17971797
guide.
17981798

1799+
Before we move on, let me show you one more Cargo command: `run`. `cargo run`
1800+
is kind of like `cargo build`, but it also then runs the produced exectuable.
1801+
Try it out:
1802+
1803+
```{notrust,ignore}
1804+
$ cargo run
1805+
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1806+
Running `target/guessing_game`
1807+
Hello, world!
1808+
$
1809+
```
1810+
1811+
Great! The `run` command comes in handy when you need to rapidly iterate on a project.
1812+
Our game is just such a project, we need to quickly test each iteration before moving on to the next one.
1813+
17991814
## Processing a Guess
18001815

18011816
Let's get to it! The first thing we need to do for our guessing game is
@@ -1933,19 +1948,19 @@ $
19331948
Excellent! Try running our new program a few times:
19341949

19351950
```{notrust,ignore}
1936-
$ ./target/guessing_game
1951+
$ ./target/guessing_game
19371952
Guess the number!
19381953
The secret number is: 7
19391954
Please input your guess.
19401955
4
19411956
You guessed: 4
1942-
$ ./target/guessing_game
1957+
$ ./target/guessing_game
19431958
Guess the number!
19441959
The secret number is: 83
19451960
Please input your guess.
19461961
5
19471962
You guessed: 5
1948-
$ ./target/guessing_game
1963+
$ ./target/guessing_game
19491964
Guess the number!
19501965
The secret number is: -29
19511966
Please input your guess.
@@ -1986,7 +2001,7 @@ And trying it out:
19862001
```{notrust,ignore}
19872002
$ cargo build
19882003
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1989-
$ ./target/guessing_game
2004+
$ ./target/guessing_game
19902005
Guess the number!
19912006
The secret number is: 57
19922007
Please input your guess.
@@ -2022,7 +2037,7 @@ fn main() {
20222037
20232038
println!("You guessed: {}", input);
20242039
2025-
match cmp(input, secret_number) {
2040+
match cmp(input, secret_number) {
20262041
Less => println!("Too small!"),
20272042
Greater => println!("Too big!"),
20282043
Equal => { println!("You win!"); },
@@ -2106,7 +2121,7 @@ a `String` instead! That's because our `input` variable is coming from the
21062121
standard input, and you can guess anything. Try it:
21072122

21082123
```{notrust,ignore}
2109-
$ ./target/guessing_game
2124+
$ ./target/guessing_game
21102125
Guess the number!
21112126
The secret number is: 73
21122127
Please input your guess.
@@ -2257,7 +2272,7 @@ print an error message and return. Let's give this a shot:
22572272
```{notrust,ignore}
22582273
$ cargo build
22592274
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2260-
$ ./target/guessing_game
2275+
$ ./target/guessing_game
22612276
Guess the number!
22622277
The secret number is: 17
22632278
Please input your guess.
@@ -2323,7 +2338,7 @@ Let's try it!
23232338
```{notrust,ignore}
23242339
$ cargo build
23252340
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2326-
$ ./target/guessing_game
2341+
$ ./target/guessing_game
23272342
Guess the number!
23282343
The secret number is: 58
23292344
Please input your guess.
@@ -2401,7 +2416,7 @@ that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24012416
```{notrust,ignore}
24022417
$ cargo build
24032418
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2404-
$ ./target/guessing_game
2419+
$ ./target/guessing_game
24052420
Guess the number!
24062421
The secret number is: 59
24072422
Please input your guess.
@@ -2534,7 +2549,7 @@ Now we should be good! Let's try:
25342549
```{rust,ignore}
25352550
$ cargo build
25362551
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2537-
$ ./target/guessing_game
2552+
$ ./target/guessing_game
25382553
Guess the number!
25392554
The secret number is: 61
25402555
Please input your guess.
@@ -2731,16 +2746,6 @@ mod hello {
27312746

27322747
This will work:
27332748

2734-
```{notrust,ignore}
2735-
$ cargo build
2736-
Compiling modules v0.1.0 (file:/home/you/projects/modules)
2737-
$
2738-
```
2739-
2740-
Before we move on, let me show you one more Cargo command: `run`. `cargo run`
2741-
is kind of like `cargo build`, but it also then runs the produced exectuable.
2742-
Try it out:
2743-
27442749
```{notrust,ignore}
27452750
$ cargo run
27462751
Compiling modules v0.1.0 (file:/home/steve/tmp/modules)
@@ -3647,14 +3652,14 @@ In order to truly understand this error, we have to learn a few new concepts:
36473652
All of our references so far have been to variables we've created on the stack.
36483653
In Rust, the simplest way to allocate heap variables is using a *box*. To
36493654
create a box, use the `box` keyword:
3650-
3655+
36513656
```{rust}
36523657
let x = box 5i;
36533658
```
36543659

36553660
This allocates an integer `5` on the heap, and creates a binding `x` that
36563661
refers to it.. The great thing about boxed pointers is that we don't have to
3657-
manually free this allocation! If we write
3662+
manually free this allocation! If we write
36583663

36593664
```{rust}
36603665
{
@@ -4189,7 +4194,7 @@ the match:
41894194

41904195
```{rust,ignore}
41914196
let x = inverse(25.0f64);
4192-
println!("{}", x + 2.0f64); // error: binary operation `+` cannot be applied
4197+
println!("{}", x + 2.0f64); // error: binary operation `+` cannot be applied
41934198
// to type `core::result::Result<f64,collections::string::String>`
41944199
```
41954200

@@ -4700,4 +4705,3 @@ fail.
47004705
# Macros
47014706

47024707
# Unsafe
4703-

0 commit comments

Comments
 (0)