Skip to content

Commit d03a7ca

Browse files
committed
---
yaml --- r: 127197 b: refs/heads/snap-stage3 c: 1a53c00 h: refs/heads/master i: 127195: 67cb4f6 v: v3
1 parent b8c23d0 commit d03a7ca

File tree

164 files changed

+2185
-1452
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

+2185
-1452
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 7be8f0af0393dcdb077c2f6b1653836fd3fba235
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 349afcfa74b46837d77d30fa373bb46d91d3b554
4+
refs/heads/snap-stage3: 1a53c001170f8084ce850498d5e8f22b5e7da72c
55
refs/heads/try: 502e4c045236682e9728539dc0d2b3d0b237f55c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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,$$(CXX_$(1))) \
644+
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(CC_$(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))

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

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,10 +1626,6 @@ 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"
16331629
```
16341630

16351631
Cargo gets this information from your environment. If it's not correct, go ahead
@@ -1651,14 +1647,14 @@ $ cargo build
16511647
$
16521648
```
16531649

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

16581654
## Processing a Guess
16591655

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

16631659
```{rust,no_run}
16641660
use std::io;
@@ -1738,9 +1734,9 @@ this using `cargo build`:
17381734
```{notrust,no_run}
17391735
$ cargo build
17401736
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
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-
^~~~~~~~
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+
^~~~~~~~
17441740
error: aborting due to previous error
17451741
```
17461742

@@ -1900,12 +1896,12 @@ If we try to compile, we'll get some errors:
19001896
```{notrust,ignore}
19011897
$ cargo build
19021898
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
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-
^~~~~~~~~~~~~
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+
^~~~~~~~~~~~~
19091905
error: aborting due to 2 previous errors
19101906
```
19111907

@@ -1954,9 +1950,9 @@ And try compiling again:
19541950
```{notrust,ignore}
19551951
$ cargo build
19561952
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
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-
^~~~~
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+
^~~~~
19601956
error: aborting due to previous error
19611957
```
19621958

@@ -2057,9 +2053,9 @@ Let's try it out!
20572053
```{notrust,ignore}
20582054
$ cargo build
20592055
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
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-
^~~~~~~~~
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+
^~~~~~~~~
20632059
error: aborting due to previous error
20642060
```
20652061

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

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

25772573
To make it public, we use the `pub` keyword:
@@ -3299,7 +3295,7 @@ fn times_four(x: int) -> int { x * 4 }
32993295
#[cfg(test)]
33003296
mod test {
33013297
use super::add_three;
3302-
use super::add_four;
3298+
use super::times_four;
33033299
33043300
#[test]
33053301
fn test_add_three() {
@@ -3348,7 +3344,7 @@ about yet, and that's these lines:
33483344

33493345
```{rust,ignore}
33503346
use super::add_three;
3351-
use super::add_four;
3347+
use super::times_four;
33523348
```
33533349

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

branches/snap-stage3/src/doc/intro.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,11 @@ 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, but will be replaced by
363-
// `numbers[num as uint] += 1` in the near future.
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.
364365
// See: https://github.com/rust-lang/rust/issues/6515
365-
*numbers.get_mut(num as uint) = *numbers.get_mut(num as uint) + 1;
366+
*numbers.get_mut(num as uint) += 1;
366367
367368
println!("{}", (*numbers)[num as uint]);
368369

branches/snap-stage3/src/doc/rust.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ 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,
116-
normalized to Unicode normalization form NFKC.
115+
Rust input is interpreted as a sequence of Unicode codepoints encoded in UTF-8.
117116
Most Rust grammar rules are defined in terms of printable ASCII-range codepoints,
118117
but a small number are defined in terms of Unicode properties or explicit
119118
codepoint lists. [^inputformat]

branches/snap-stage3/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

branches/snap-stage3/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_]+)/\3/i,impls,trait implementations/
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/
1111
--regex-Rust=/^[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\1/d,macros,macro definitions/

branches/snap-stage3/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
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"/>
2526
</styles>
2627

2728
<definitions>
@@ -251,6 +252,12 @@
251252
</match>
252253
</context>
253254

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

260267
<define-regex id="common_escape" extended="true">
261268
'|"|
262-
\\|n|r|t|
269+
\\|n|r|t|0|
263270
x\%{hex_digit}{2}|
264271
u\%{hex_digit}{4}|
265272
U\%{hex_digit}{8}
@@ -308,6 +315,7 @@
308315
<context ref="types"/>
309316
<context ref="ctypes"/>
310317
<context ref="self"/>
318+
<context ref="macro"/>
311319
<context ref="constants"/>
312320
<context ref="cconstants"/>
313321
<context ref="line-comment"/>

branches/snap-stage3/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-pc-mingw32"
56+
snap_triple = triple if triple != "x86_64-w64-mingw32" else "i686-w64-mingw32"
5757
snap = determine_curr_snapshot(snap_triple)
5858
dl = os.path.join(download_dir_base, snap)
5959
url = download_url_base + "/" + snap

branches/snap-stage3/src/etc/unicode.py

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,13 +464,26 @@ 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):
467+
def emit_norm_module(f, canon, compat, combine, norm_props):
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+
474487
f.write("pub mod normalization {\n")
475488

476489
def mkdata_fun(table):
@@ -494,6 +507,22 @@ def f(char):
494507
emit_table(f, "compatibility_table", compat_keys, "&'static [(char, &'static [char])]",
495508
pfun=mkdata_fun(compat))
496509

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+
497526
f.write("""
498527
fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 {
499528
use core::option::{Some, None};
@@ -579,6 +608,8 @@ def optimize_width_table(wtable):
579608
scripts = load_properties("Scripts.txt", [])
580609
props = load_properties("PropList.txt",
581610
["White_Space", "Join_Control", "Noncharacter_Code_Point"])
611+
norm_props = load_properties("DerivedNormalizationProps.txt",
612+
["Full_Composition_Exclusion"])
582613

583614
# grapheme cluster category from DerivedCoreProperties
584615
# the rest are defined below
@@ -612,7 +643,7 @@ def optimize_width_table(wtable):
612643
emit_regex_module(rf, allcats, perl_words)
613644

614645
# normalizations and conversions module
615-
emit_norm_module(rf, canon_decomp, compat_decomp, combines)
646+
emit_norm_module(rf, canon_decomp, compat_decomp, combines, norm_props)
616647
emit_conversions_module(rf, lowerupper, upperlower)
617648

618649
### character width module

0 commit comments

Comments
 (0)