Skip to content

Commit bd8875f

Browse files
committed
---
yaml --- r: 127934 b: refs/heads/master c: 604af3f h: refs/heads/master v: v3
1 parent 96777b4 commit bd8875f

File tree

110 files changed

+795
-430
lines changed

Some content is hidden

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

110 files changed

+795
-430
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: bf0a925dcde7a2c66df4e05661a9b1d1472435ab
2+
refs/heads/master: 604af3f6c0be6ea428a55cfcb303fa1cd1c7958d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: aa98b25c4f0c10729dff37c699904ad57b8fbda8
55
refs/heads/try: f1778314378f8951328206626b5ddf725898e0e6

trunk/src/compiletest/runtest.rs

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

2322
use std::io::File;
@@ -818,8 +817,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
818817
format!("{}:{}:", testfile.display(), ee.line)
819818
}).collect::<Vec<String> >();
820819

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

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

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

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

trunk/src/compiletest/util.rs

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

1111
use common::Config;
1212

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

1716
/// Conversion table from triple OS name to Rust SYSNAME
1817
static OS_TABLE: &'static [(&'static str, &'static str)] = &[
19-
("mingw32", "windows"),
20-
("win32", "windows"),
21-
("windows", "windows"),
18+
("mingw32", "win32"),
19+
("win32", "win32"),
2220
("darwin", "macos"),
2321
("android", "android"),
2422
("linux", "linux"),
@@ -35,8 +33,7 @@ pub fn get_os(triple: &str) -> &'static str {
3533
fail!("Cannot determine OS from triple");
3634
}
3735

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

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

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

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

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

trunk/src/doc/guide.md

Lines changed: 26 additions & 30 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,21 +1796,6 @@ 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-
18141799
## Processing a Guess
18151800

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

19501935
```{notrust,ignore}
1951-
$ ./target/guessing_game
1936+
$ ./target/guessing_game
19521937
Guess the number!
19531938
The secret number is: 7
19541939
Please input your guess.
19551940
4
19561941
You guessed: 4
1957-
$ ./target/guessing_game
1942+
$ ./target/guessing_game
19581943
Guess the number!
19591944
The secret number is: 83
19601945
Please input your guess.
19611946
5
19621947
You guessed: 5
1963-
$ ./target/guessing_game
1948+
$ ./target/guessing_game
19641949
Guess the number!
19651950
The secret number is: -29
19661951
Please input your guess.
@@ -2001,7 +1986,7 @@ And trying it out:
20011986
```{notrust,ignore}
20021987
$ cargo build
20031988
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2004-
$ ./target/guessing_game
1989+
$ ./target/guessing_game
20051990
Guess the number!
20061991
The secret number is: 57
20071992
Please input your guess.
@@ -2037,7 +2022,7 @@ fn main() {
20372022
20382023
println!("You guessed: {}", input);
20392024
2040-
match cmp(input, secret_number) {
2025+
match cmp(input, secret_number) {
20412026
Less => println!("Too small!"),
20422027
Greater => println!("Too big!"),
20432028
Equal => { println!("You win!"); },
@@ -2121,7 +2106,7 @@ a `String` instead! That's because our `input` variable is coming from the
21212106
standard input, and you can guess anything. Try it:
21222107

21232108
```{notrust,ignore}
2124-
$ ./target/guessing_game
2109+
$ ./target/guessing_game
21252110
Guess the number!
21262111
The secret number is: 73
21272112
Please input your guess.
@@ -2272,7 +2257,7 @@ print an error message and return. Let's give this a shot:
22722257
```{notrust,ignore}
22732258
$ cargo build
22742259
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2275-
$ ./target/guessing_game
2260+
$ ./target/guessing_game
22762261
Guess the number!
22772262
The secret number is: 17
22782263
Please input your guess.
@@ -2338,7 +2323,7 @@ Let's try it!
23382323
```{notrust,ignore}
23392324
$ cargo build
23402325
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2341-
$ ./target/guessing_game
2326+
$ ./target/guessing_game
23422327
Guess the number!
23432328
The secret number is: 58
23442329
Please input your guess.
@@ -2416,7 +2401,7 @@ that `return`? If we give a non-number answer, we'll `return` and quit. Observe:
24162401
```{notrust,ignore}
24172402
$ cargo build
24182403
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2419-
$ ./target/guessing_game
2404+
$ ./target/guessing_game
24202405
Guess the number!
24212406
The secret number is: 59
24222407
Please input your guess.
@@ -2549,7 +2534,7 @@ Now we should be good! Let's try:
25492534
```{rust,ignore}
25502535
$ cargo build
25512536
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2552-
$ ./target/guessing_game
2537+
$ ./target/guessing_game
25532538
Guess the number!
25542539
The secret number is: 61
25552540
Please input your guess.
@@ -2746,6 +2731,16 @@ mod hello {
27462731

27472732
This will work:
27482733

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+
27492744
```{notrust,ignore}
27502745
$ cargo run
27512746
Compiling modules v0.1.0 (file:/home/steve/tmp/modules)
@@ -3652,14 +3647,14 @@ In order to truly understand this error, we have to learn a few new concepts:
36523647
All of our references so far have been to variables we've created on the stack.
36533648
In Rust, the simplest way to allocate heap variables is using a *box*. To
36543649
create a box, use the `box` keyword:
3655-
3650+
36563651
```{rust}
36573652
let x = box 5i;
36583653
```
36593654

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

36643659
```{rust}
36653660
{
@@ -4194,7 +4189,7 @@ the match:
41944189

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

@@ -4705,3 +4700,4 @@ fail.
47054700
# Macros
47064701

47074702
# Unsafe
4703+

trunk/src/doc/rust.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ extern crate foo = "some/where/rust-foo#foo:1.0"; // a full crate ID for externa
919919
##### Use declarations
920920

921921
~~~~ {.ebnf .gram}
922-
use_decl : "pub" ? "use" [ path "as" ident
922+
use_decl : "pub" ? "use" [ ident '=' path
923923
| path_glob ] ;
924924
925925
path_glob : ident [ "::" [ path_glob
@@ -939,7 +939,7 @@ module item. These declarations may appear at the top of [modules](#modules) and
939939
940940
Use declarations support a number of convenient shortcuts:
941941

942-
* Rebinding the target name as a new local name, using the syntax `use p::q::r as x;`.
942+
* Rebinding the target name as a new local name, using the syntax `use x = p::q::r;`.
943943
* Simultaneously binding a list of paths differing only in their final element,
944944
using the glob-like brace syntax `use a::b::{c,d,e,f};`
945945
* Binding all paths matching a given prefix, using the asterisk wildcard syntax `use a::b::*;`

trunk/src/etc/mklldeps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,13 @@ def run(args):
6161
elif 'android' in os:
6262
os = 'android'
6363
elif 'win' in os or 'mingw' in os:
64-
os = 'windows'
64+
os = 'win32'
6565
cfg = [
6666
"target_arch = \"" + arch + "\"",
6767
"target_os = \"" + os + "\"",
6868
]
6969

7070
f.write("#[cfg(" + ', '.join(cfg) + ")]\n")
71-
if os == "windows": # NOTE: Remove after snapshot
72-
f.write("#[cfg(stage0, target_arch = \"%s\", target_os = \"win32\")]\n" % (arch,))
7371

7472
version = run([llconfig, '--version']).strip()
7573

trunk/src/etc/vim/after/syntax/rust.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ hi link rustNiceOperator Operator
2929
if !exists('g:rust_conceal_mod_path')
3030
hi! link Conceal Operator
3131
endif
32+
33+
setlocal conceallevel=2

trunk/src/etc/vim/ftplugin/rust.vim

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ if exists("g:loaded_delimitMate")
5656
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
5757
endif
5858

59-
if has('conceal') && exists('g:rust_conceal')
60-
let b:rust_set_conceallevel=1
61-
setlocal conceallevel=2
62-
endif
63-
6459
" Motion Commands {{{1
6560

6661
" Bind motion commands to support hanging indents
@@ -108,10 +103,6 @@ let b:undo_ftplugin = "
108103
\|else
109104
\|unlet! b:delimitMate_excluded_regions
110105
\|endif
111-
\|if exists('b:rust_set_conceallevel')
112-
\|setlocal conceallevel<
113-
\|unlet b:rust_set_conceallevel
114-
\|endif
115106
\|unlet! b:rust_last_rustc_args b:rust_last_args
116107
\|delcommand RustRun
117108
\|delcommand RustExpand

0 commit comments

Comments
 (0)