Skip to content

Commit a28a0e0

Browse files
committed
---
yaml --- r: 127209 b: refs/heads/master c: 349afcf h: refs/heads/master i: 127207: 859327c v: v3
1 parent c2a705d commit a28a0e0

File tree

164 files changed

+1453
-2186
lines changed

Some content is hidden

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

164 files changed

+1453
-2186
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: e9c5c4c9bd3f9ed73a549c978a8cafe449587663
2+
refs/heads/master: 349afcfa74b46837d77d30fa373bb46d91d3b554
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 12e0f72f517516ac4fce2aed85e6142e9b874bce
55
refs/heads/try: 502e4c045236682e9728539dc0d2b3d0b237f55c

trunk/mk/platform.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ RUSTC_CROSS_FLAGS_arm-unknown-linux-gnueabi :=
377377
# mipsel-linux configuration
378378
CC_mipsel-linux=mipsel-linux-gcc
379379
CXX_mipsel-linux=mipsel-linux-g++
380-
CPP_mipsel-linux=mipsel-linux-gcc
380+
CPP_mipsel-linux=mipsel-linux-gcc
381381
AR_mipsel-linux=mipsel-linux-ar
382382
CFG_LIB_NAME_mipsel-linux=lib$(1).so
383383
CFG_STATIC_LIB_NAME_mipsel-linux=lib$(1).a
@@ -641,7 +641,7 @@ define CFG_MAKE_TOOLCHAIN
641641
CXX_$(1)=$(CROSS_PREFIX_$(1))$(CXX_$(1))
642642
CPP_$(1)=$(CROSS_PREFIX_$(1))$(CPP_$(1))
643643
AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1))
644-
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(CC_$(1))) \
644+
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(CXX_$(1))) \
645645
-C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1))
646646

647647
RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1))

trunk/src/doc/guide.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,6 +1626,10 @@ Check out the generated `Cargo.toml`:
16261626
name = "guessing_game"
16271627
version = "0.1.0"
16281628
authors = ["Your Name <[email protected]>"]
1629+
1630+
[[bin]]
1631+
1632+
name = "guessing_game"
16291633
```
16301634

16311635
Cargo gets this information from your environment. If it's not correct, go ahead
@@ -1647,14 +1651,14 @@ $ cargo build
16471651
$
16481652
```
16491653

1650-
Excellent! Open up your `src/main.rs` again. We'll be writing all of
1654+
Excellent! Open up your `src/guessing_game.rs` again. We'll be writing all of
16511655
our code in this file. We'll talk about multiple-file projects later on in the
16521656
guide.
16531657

16541658
## Processing a Guess
16551659

16561660
Let's get to it! The first thing we need to do for our guessing game is
1657-
allow our player to input a guess. Put this in your `src/main.rs`:
1661+
allow our player to input a guess. Put this in your `src/guessing_game.rs`:
16581662

16591663
```{rust,no_run}
16601664
use std::io;
@@ -1734,9 +1738,9 @@ this using `cargo build`:
17341738
```{notrust,no_run}
17351739
$ cargo build
17361740
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1737-
src/main.rs:7:26: 7:34 error: the type of this value must be known in this context
1738-
src/main.rs:7 let secret_number = (rand::random() % 100i) + 1i;
1739-
^~~~~~~~
1741+
src/guessing_game.rs:7:26: 7:34 error: the type of this value must be known in this context
1742+
src/guessing_game.rs:7 let secret_number = (rand::random() % 100i) + 1i;
1743+
^~~~~~~~
17401744
error: aborting due to previous error
17411745
```
17421746

@@ -1896,12 +1900,12 @@ If we try to compile, we'll get some errors:
18961900
```{notrust,ignore}
18971901
$ cargo build
18981902
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1899-
src/main.rs:20:15: 20:20 error: mismatched types: expected `int` but found `collections::string::String` (expected int but found struct collections::string::String)
1900-
src/main.rs:20 match cmp(input, secret_number) {
1901-
^~~~~
1902-
src/main.rs:20:22: 20:35 error: mismatched types: expected `int` but found `uint` (expected int but found uint)
1903-
src/main.rs:20 match cmp(input, secret_number) {
1904-
^~~~~~~~~~~~~
1903+
src/guessing_game.rs:20:15: 20:20 error: mismatched types: expected `int` but found `collections::string::String` (expected int but found struct collections::string::String)
1904+
src/guessing_game.rs:20 match cmp(input, secret_number) {
1905+
^~~~~
1906+
src/guessing_game.rs:20:22: 20:35 error: mismatched types: expected `int` but found `uint` (expected int but found uint)
1907+
src/guessing_game.rs:20 match cmp(input, secret_number) {
1908+
^~~~~~~~~~~~~
19051909
error: aborting due to 2 previous errors
19061910
```
19071911

@@ -1950,9 +1954,9 @@ And try compiling again:
19501954
```{notrust,ignore}
19511955
$ cargo build
19521956
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1953-
src/main.rs:20:15: 20:20 error: mismatched types: expected `uint` but found `collections::string::String` (expected uint but found struct collections::string::String)
1954-
src/main.rs:20 match cmp(input, secret_number) {
1955-
^~~~~
1957+
src/guessing_game.rs:20:15: 20:20 error: mismatched types: expected `uint` but found `collections::string::String` (expected uint but found struct collections::string::String)
1958+
src/guessing_game.rs:20 match cmp(input, secret_number) {
1959+
^~~~~
19561960
error: aborting due to previous error
19571961
```
19581962

@@ -2053,9 +2057,9 @@ Let's try it out!
20532057
```{notrust,ignore}
20542058
$ cargo build
20552059
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2056-
src/main.rs:22:15: 22:24 error: mismatched types: expected `uint` but found `core::option::Option<uint>` (expected uint but found enum core::option::Option)
2057-
src/main.rs:22 match cmp(input_num, secret_number) {
2058-
^~~~~~~~~
2060+
src/guessing_game.rs:22:15: 22:24 error: mismatched types: expected `uint` but found `core::option::Option<uint>` (expected uint but found enum core::option::Option)
2061+
src/guessing_game.rs:22 match cmp(input_num, secret_number) {
2062+
^~~~~~~~~
20592063
error: aborting due to previous error
20602064
```
20612065

@@ -2565,9 +2569,9 @@ It gives an error:
25652569

25662570
```{notrust,ignore}
25672571
Compiling modules v0.1.0 (file:/home/you/projects/modules)
2568-
src/main.rs:2:5: 2:23 error: function `print_hello` is private
2569-
src/main.rs:2 hello::print_hello();
2570-
^~~~~~~~~~~~~~~~~~
2572+
src/modules.rs:2:5: 2:23 error: function `print_hello` is private
2573+
src/modules.rs:2 hello::print_hello();
2574+
^~~~~~~~~~~~~~~~~~
25712575
```
25722576

25732577
To make it public, we use the `pub` keyword:
@@ -3295,7 +3299,7 @@ fn times_four(x: int) -> int { x * 4 }
32953299
#[cfg(test)]
32963300
mod test {
32973301
use super::add_three;
3298-
use super::times_four;
3302+
use super::add_four;
32993303
33003304
#[test]
33013305
fn test_add_three() {
@@ -3344,7 +3348,7 @@ about yet, and that's these lines:
33443348

33453349
```{rust,ignore}
33463350
use super::add_three;
3347-
use super::times_four;
3351+
use super::add_four;
33483352
```
33493353

33503354
Because we've made a nested module, we can import functions from the parent

trunk/src/doc/intro.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,10 @@ fn main() {
359359
// Take the lock, along with exclusive access to the underlying array
360360
let mut numbers = numbers_lock.lock();
361361
362-
// This is ugly for now because of the need for `get_mut`, but
363-
// will be replaced by `numbers[num as uint] += 1`
364-
// in the near future.
362+
// This is ugly for now, but will be replaced by
363+
// `numbers[num as uint] += 1` in the near future.
365364
// See: https://github.com/rust-lang/rust/issues/6515
366-
*numbers.get_mut(num as uint) += 1;
365+
*numbers.get_mut(num as uint) = *numbers.get_mut(num as uint) + 1;
367366
368367
println!("{}", (*numbers)[num as uint]);
369368

trunk/src/doc/rust.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ production. See [tokens](#tokens) for more information.
112112

113113
## Input format
114114

115-
Rust input is interpreted as a sequence of Unicode codepoints encoded in UTF-8.
115+
Rust input is interpreted as a sequence of Unicode codepoints encoded in UTF-8,
116+
normalized to Unicode normalization form NFKC.
116117
Most Rust grammar rules are defined in terms of printable ASCII-range codepoints,
117118
but a small number are defined in terms of Unicode properties or explicit
118119
codepoint lists. [^inputformat]

trunk/src/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2196,7 +2196,7 @@ and may not be overridden:
21962196
Types are sendable
21972197
unless they contain references.
21982198

2199-
* `Share` - Types that are *threadsafe*.
2199+
* `Share` - Types that are *threadsafe*
22002200
These are types that are safe to be used across several threads with access to
22012201
a `&T` pointer. `Mutex<T>` is an example of a *sharable* type with internal mutable data.
22022202

trunk/src/etc/ctags.rust

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
--regex-Rust=/^[ \t]*(pub[ \t]+)?mod[ \t]+([a-zA-Z0-9_]+)/\2/m,modules,module names/
88
--regex-Rust=/^[ \t]*(pub[ \t]+)?static[ \t]+([a-zA-Z0-9_]+)/\2/c,consts,static constants/
99
--regex-Rust=/^[ \t]*(pub[ \t]+)?trait[ \t]+([a-zA-Z0-9_]+)/\2/t,traits,traits/
10-
--regex-Rust=/^[ \t]*(pub[ \t]+)?impl([ \t\n]*<[^>]*>)?[ \t]+(([a-zA-Z0-9_:]+)[ \t]*(<[^>]*>)?[ \t]+(for)[ \t]+)?([a-zA-Z0-9_]+)/\4 \6 \7/i,impls,trait implementations/
10+
--regex-Rust=/^[ \t]*(pub[ \t]+)?impl([ \t\n]+<.*>)?[ \t]+([a-zA-Z0-9_]+)/\3/i,impls,trait implementations/
1111
--regex-Rust=/^[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\1/d,macros,macro definitions/

trunk/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<style id="number" _name="Number" map-to="def:number"/>
2323
<style id="scope" _name="Scope" map-to="def:preprocessor"/>
2424
<style id="attribute" _name="Attribute" map-to="def:preprocessor"/>
25-
<style id="macro" _name="Macro" map-to="def:preprocessor"/>
2625
</styles>
2726

2827
<definitions>
@@ -252,12 +251,6 @@
252251
</match>
253252
</context>
254253

255-
<context id="macro" style-ref="macro">
256-
<match extended="true">
257-
\%{ident}!
258-
</match>
259-
</context>
260-
261254
<context id="lifetime" style-ref="keyword">
262255
<match extended="true">
263256
'\%{ident}
@@ -266,7 +259,7 @@
266259

267260
<define-regex id="common_escape" extended="true">
268261
'|"|
269-
\\|n|r|t|0|
262+
\\|n|r|t|
270263
x\%{hex_digit}{2}|
271264
u\%{hex_digit}{4}|
272265
U\%{hex_digit}{8}
@@ -315,7 +308,6 @@
315308
<context ref="types"/>
316309
<context ref="ctypes"/>
317310
<context ref="self"/>
318-
<context ref="macro"/>
319311
<context ref="constants"/>
320312
<context ref="cconstants"/>
321313
<context ref="line-comment"/>

trunk/src/etc/get-snapshot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def unpack_snapshot(triple, dl_path):
5353
dl_path = sys.argv[2]
5454
else:
5555
# There are no 64-bit Windows snapshots yet, so we'll use 32-bit ones instead, for now
56-
snap_triple = triple if triple != "x86_64-w64-mingw32" else "i686-w64-mingw32"
56+
snap_triple = triple if triple != "x86_64-w64-mingw32" else "i686-pc-mingw32"
5757
snap = determine_curr_snapshot(snap_triple)
5858
dl = os.path.join(download_dir_base, snap)
5959
url = download_url_base + "/" + snap

trunk/src/etc/unicode.py

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -464,26 +464,13 @@ def emit_charwidth_module(f, width_table):
464464
pfun=lambda x: "(%s,%s,%s,%s)" % (escape_char(x[0]), escape_char(x[1]), x[2], x[3]))
465465
f.write("}\n\n")
466466

467-
def emit_norm_module(f, canon, compat, combine, norm_props):
467+
def emit_norm_module(f, canon, compat, combine):
468468
canon_keys = canon.keys()
469469
canon_keys.sort()
470470

471471
compat_keys = compat.keys()
472472
compat_keys.sort()
473473

474-
canon_comp = {}
475-
comp_exclusions = norm_props["Full_Composition_Exclusion"]
476-
for char in canon_keys:
477-
if True in map(lambda (lo, hi): lo <= char <= hi, comp_exclusions):
478-
continue
479-
decomp = canon[char]
480-
if len(decomp) == 2:
481-
if not canon_comp.has_key(decomp[0]):
482-
canon_comp[decomp[0]] = []
483-
canon_comp[decomp[0]].append( (decomp[1], char) )
484-
canon_comp_keys = canon_comp.keys()
485-
canon_comp_keys.sort()
486-
487474
f.write("pub mod normalization {\n")
488475

489476
def mkdata_fun(table):
@@ -507,22 +494,6 @@ def f(char):
507494
emit_table(f, "compatibility_table", compat_keys, "&'static [(char, &'static [char])]",
508495
pfun=mkdata_fun(compat))
509496

510-
def comp_pfun(char):
511-
data = "(%s,&[" % escape_char(char)
512-
canon_comp[char].sort(lambda x, y: x[0] - y[0])
513-
first = True
514-
for pair in canon_comp[char]:
515-
if not first:
516-
data += ","
517-
first = False
518-
data += "(%s,%s)" % (escape_char(pair[0]), escape_char(pair[1]))
519-
data += "])"
520-
return data
521-
522-
f.write(" // Canonical compositions\n")
523-
emit_table(f, "composition_table", canon_comp_keys,
524-
"&'static [(char, &'static [(char, char)])]", pfun=comp_pfun)
525-
526497
f.write("""
527498
fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 {
528499
use core::option::{Some, None};
@@ -608,8 +579,6 @@ def optimize_width_table(wtable):
608579
scripts = load_properties("Scripts.txt", [])
609580
props = load_properties("PropList.txt",
610581
["White_Space", "Join_Control", "Noncharacter_Code_Point"])
611-
norm_props = load_properties("DerivedNormalizationProps.txt",
612-
["Full_Composition_Exclusion"])
613582

614583
# grapheme cluster category from DerivedCoreProperties
615584
# the rest are defined below
@@ -643,7 +612,7 @@ def optimize_width_table(wtable):
643612
emit_regex_module(rf, allcats, perl_words)
644613

645614
# normalizations and conversions module
646-
emit_norm_module(rf, canon_decomp, compat_decomp, combines, norm_props)
615+
emit_norm_module(rf, canon_decomp, compat_decomp, combines)
647616
emit_conversions_module(rf, lowerupper, upperlower)
648617

649618
### character width module

0 commit comments

Comments
 (0)