Skip to content

Commit bdb0630

Browse files
committed
---
yaml --- r: 128839 b: refs/heads/try c: 1d12b6d h: refs/heads/master i: 128837: 3d9f62c 128835: f3229da 128831: ebf7a8f v: v3
1 parent 8f9f037 commit bdb0630

File tree

174 files changed

+3795
-1924
lines changed

Some content is hidden

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

174 files changed

+3795
-1924
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: 07d86b46a949a94223da714e35b343243e4ecce4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a86d9ad15e339ab343a12513f9c90556f677b9ca
5-
refs/heads/try: 43c326ef6b93d12cc7355067b4770f668792e344
5+
refs/heads/try: 1d12b6d444ec083466020777be5bb9f19e9a6d3a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/compiletest/runtest.rs

Lines changed: 10 additions & 5 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;
@@ -817,7 +818,8 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
817818
format!("{}:{}:", testfile.display(), ee.line)
818819
}).collect::<Vec<String> >();
819820

820-
#[cfg(target_os = "win32")]
821+
#[cfg(target_os = "windows")]
822+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
821823
fn to_lower( s : &str ) -> String {
822824
let i = s.chars();
823825
let c : Vec<char> = i.map( |c| {
@@ -830,7 +832,8 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
830832
String::from_chars(c.as_slice())
831833
}
832834

833-
#[cfg(target_os = "win32")]
835+
#[cfg(target_os = "windows")]
836+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
834837
fn prefix_matches( line : &str, prefix : &str ) -> bool {
835838
to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice())
836839
}
@@ -1247,14 +1250,16 @@ fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String {
12471250
format!("{} {}", prog, args.connect(" "))
12481251
}
12491252

1250-
#[cfg(target_os = "win32")]
1253+
#[cfg(target_os = "windows")]
1254+
#[cfg(stage0, target_os = "win32")] // NOTE: Remove after snapshot
12511255
fn make_cmdline(libpath: &str, prog: &str, args: &[String]) -> String {
12521256
format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
12531257
}
12541258

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

branches/try/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/try/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/try/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)