Skip to content

Commit b8195a3

Browse files
committed
---
yaml --- r: 126333 b: refs/heads/auto c: f5ac411 h: refs/heads/master i: 126331: a2ac5d9 v: v3
1 parent a24da73 commit b8195a3

File tree

52 files changed

+1000
-263
lines changed

Some content is hidden

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

52 files changed

+1000
-263
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: a9979ada477c74be567f8df47ae8bd9a8b75f192
16+
refs/heads/auto: f5ac41185a821681f4bfaf93ef0569955d24ef4a
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/guide.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,14 +1647,14 @@ $ cargo build
16471647
$
16481648
```
16491649

1650-
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
16511651
our code in this file. We'll talk about multiple-file projects later on in the
16521652
guide.
16531653

16541654
## Processing a Guess
16551655

16561656
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/guessing_game.rs`:
1657+
allow our player to input a guess. Put this in your `src/main.rs`:
16581658

16591659
```{rust,no_run}
16601660
use std::io;
@@ -1734,9 +1734,9 @@ this using `cargo build`:
17341734
```{notrust,no_run}
17351735
$ cargo build
17361736
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1737-
src/guessing_game.rs:7:26: 7:34 error: the type of this value must be known in this context
1738-
src/guessing_game.rs:7 let secret_number = (rand::random() % 100i) + 1i;
1739-
^~~~~~~~
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+
^~~~~~~~
17401740
error: aborting due to previous error
17411741
```
17421742

@@ -1896,12 +1896,12 @@ If we try to compile, we'll get some errors:
18961896
```{notrust,ignore}
18971897
$ cargo build
18981898
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1899-
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)
1900-
src/guessing_game.rs:20 match cmp(input, secret_number) {
1901-
^~~~~
1902-
src/guessing_game.rs:20:22: 20:35 error: mismatched types: expected `int` but found `uint` (expected int but found uint)
1903-
src/guessing_game.rs:20 match cmp(input, secret_number) {
1904-
^~~~~~~~~~~~~
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+
^~~~~~~~~~~~~
19051905
error: aborting due to 2 previous errors
19061906
```
19071907

@@ -1950,9 +1950,9 @@ And try compiling again:
19501950
```{notrust,ignore}
19511951
$ cargo build
19521952
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
1953-
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)
1954-
src/guessing_game.rs:20 match cmp(input, secret_number) {
1955-
^~~~~
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+
^~~~~
19561956
error: aborting due to previous error
19571957
```
19581958

@@ -2053,9 +2053,9 @@ Let's try it out!
20532053
```{notrust,ignore}
20542054
$ cargo build
20552055
Compiling guessing_game v0.1.0 (file:/home/you/projects/guessing_game)
2056-
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)
2057-
src/guessing_game.rs:22 match cmp(input_num, secret_number) {
2058-
^~~~~~~~~
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+
^~~~~~~~~
20592059
error: aborting due to previous error
20602060
```
20612061

branches/auto/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/auto/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/auto/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 8 additions & 0 deletions
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}
@@ -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/auto/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

branches/auto/src/liballoc/heap.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ mod imp {
136136
use libc::{c_char, c_int, c_void, size_t};
137137

138138
#[link(name = "jemalloc", kind = "static")]
139+
#[cfg(not(test))]
140+
extern {}
141+
139142
extern {
140143
fn je_mallocx(size: size_t, flags: c_int) -> *mut c_void;
141144
fn je_rallocx(ptr: *mut c_void, size: size_t,

0 commit comments

Comments
 (0)