Skip to content

Commit c0cbd4f

Browse files
committed
---
yaml --- r: 57697 b: refs/heads/incoming c: 3830040 h: refs/heads/master i: 57695: 9bfafff v: v3
1 parent 1bde0af commit c0cbd4f

File tree

291 files changed

+13542
-9504
lines changed

Some content is hidden

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

291 files changed

+13542
-9504
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: bf67eb2362b7d0f37012f2d6dac604c3bbacd2c6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 5cc6a0bf327e84569166d0ae7c07615e5afd5238
9+
refs/heads/incoming: 3830040a89297dd55f920ec26ab97fb2e33c7a00
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,4 @@ config.stamp
8686
.DS_Store
8787
src/etc/dl
8888
.settings/
89+
build/

branches/incoming/doc/rust.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,10 +1467,10 @@ A complete list of the built-in language items follows:
14671467
: Elements can be subtracted.
14681468
`mul`
14691469
: Elements can be multiplied.
1470-
`div`
1471-
: Elements can be divided.
1472-
`mod`
1473-
: Elements have a modulo operation.
1470+
`quot`
1471+
: Elements have a quotient operation.
1472+
`rem`
1473+
: Elements have a remainder operation.
14741474
`neg`
14751475
: Elements can be negated arithmetically.
14761476
`not`
@@ -1856,11 +1856,11 @@ The default meaning of the operators on standard types is given here.
18561856
: Multiplication.
18571857
Calls the `mul` method on the `core::ops::Mul` trait.
18581858
`/`
1859-
: Division.
1860-
Calls the `div` method on the `core::ops::Div` trait.
1859+
: Quotient.
1860+
Calls the `quot` method on the `core::ops::Quot` trait.
18611861
`%`
1862-
: Modulo (a.k.a. "remainder").
1863-
Calls the `modulo` method on the `core::ops::Modulo` trait.
1862+
: Remainder.
1863+
Calls the `rem` method on the `core::ops::Rem` trait.
18641864

18651865
#### Bitwise operators
18661866

branches/incoming/doc/tutorial-tasks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ Instead we can use a `SharedChan`, a type that allows a single
236236
use core::comm::{stream, SharedChan};
237237
238238
let (port, chan) = stream();
239-
let chan = SharedChan(chan);
239+
let chan = SharedChan::new(chan);
240240
241241
for uint::range(0, 3) |init_val| {
242242
// Create a new channel handle to distribute to the child task

branches/incoming/doc/tutorial.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ The nil type, written `()`, has a single value, also written `()`.
362362
## Operators
363363

364364
Rust's set of operators contains very few surprises. Arithmetic is done with
365-
`*`, `/`, `%`, `+`, and `-` (multiply, divide, take remainder, add, and subtract). `-` is
365+
`*`, `/`, `%`, `+`, and `-` (multiply, quotient, remainder, add, and subtract). `-` is
366366
also a unary prefix operator that negates numbers. As in C, the bitwise operators
367367
`>>`, `<<`, `&`, `|`, and `^` are also supported.
368368

@@ -1669,6 +1669,9 @@ do spawn {
16691669
}
16701670
~~~~
16711671

1672+
If you want to see the output of `debug!` statements, you will need to turn on `debug!` logging.
1673+
To enable `debug!` logging, set the RUST_LOG environment variable to the name of your crate, which, for a file named `foo.rs`, will be `foo` (e.g., with bash, `export RUST_LOG=foo`).
1674+
16721675
## For loops
16731676

16741677
The most common way to express iteration in Rust is with a `for`

branches/incoming/mk/rt.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ RUNTIME_CXXS_$(1) := \
7676
rt/boxed_region.cpp \
7777
rt/arch/$$(HOST_$(1))/context.cpp \
7878
rt/arch/$$(HOST_$(1))/gpr.cpp \
79-
rt/rust_android_dummy.cpp
79+
rt/rust_android_dummy.cpp \
80+
rt/rust_test_helpers.cpp
8081

8182
RUNTIME_CS_$(1) := rt/linenoise/linenoise.c rt/linenoise/utf8.c
8283

branches/incoming/src/compiletest/procsrv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub fn run(lib_path: ~str,
7373
7474
7575
writeclose(pipe_in.out, input);
76-
let p = comm::PortSet();
76+
let p = comm::PortSet::new();
7777
let ch = p.chan();
7878
do task::spawn_sched(task::SingleThreaded) || {
7979
let errput = readclose(pipe_err.in);

branches/incoming/src/etc/kate/rust.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
<item> Add </item>
5858
<item> Sub </item>
5959
<item> Mul </item>
60-
<item> Div </item>
61-
<item> Modulo </item>
60+
<item> Quot </item>
61+
<item> Rem </item>
6262
<item> Neg </item>
6363
<item> BitAnd </item>
6464
<item> BitOr </item>

branches/incoming/src/etc/unicode.py

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,49 @@ def escape_char(c):
112112
return "'\\u%4.4x'" % c
113113
return "'\\U%8.8x'" % c
114114

115+
def ch_prefix(ix):
116+
if ix == 0:
117+
return " "
118+
if ix % 2 == 0:
119+
return ",\n "
120+
else:
121+
return ", "
122+
123+
def emit_bsearch_range_table(f):
124+
f.write("""
125+
pure fn bsearch_range_table(c: char, r: &[(char,char)]) -> bool {
126+
use cmp::{EQ, LT, GT};
127+
use vec::bsearch;
128+
use option::None;
129+
(do bsearch(r) |&(lo,hi)| {
130+
if lo <= c && c <= hi { EQ }
131+
else if hi < c { LT }
132+
else { GT }
133+
}) != None
134+
}\n\n
135+
""");
136+
115137
def emit_property_module(f, mod, tbl):
138+
f.write("pub mod %s {\n" % mod)
139+
keys = tbl.keys()
140+
keys.sort()
141+
emit_bsearch_range_table(f);
142+
for cat in keys:
143+
f.write(" const %s_table : &[(char,char)] = &[\n" % cat)
144+
ix = 0
145+
for pair in tbl[cat]:
146+
f.write(ch_prefix(ix))
147+
f.write("(%s, %s)" % (escape_char(pair[0]), escape_char(pair[1])))
148+
ix += 1
149+
f.write("\n ];\n\n")
150+
151+
f.write(" pub pure fn %s(c: char) -> bool {\n" % cat)
152+
f.write(" bsearch_range_table(c, %s_table)\n" % cat)
153+
f.write(" }\n\n")
154+
f.write("}\n")
155+
156+
157+
def emit_property_module_old(f, mod, tbl):
116158
f.write("mod %s {\n" % mod)
117159
keys = tbl.keys()
118160
keys.sort()
@@ -193,8 +235,9 @@ def emit_decomp_module(f, canon, compat):
193235
rf = open(r, "w")
194236

195237
(canon_decomp, compat_decomp, gencats) = load_unicode_data("UnicodeData.txt")
196-
emit_decomp_module(rf, canon_decomp, compat_decomp)
197238
emit_property_module(rf, "general_category", gencats)
198239

240+
#emit_decomp_module(rf, canon_decomp, compat_decomp)
241+
199242
derived = load_derived_core_properties("DerivedCoreProperties.txt")
200243
emit_property_module(rf, "derived_property", derived)

branches/incoming/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ syn keyword rustType off_t dev_t ino_t pid_t mode_t ssize_t
4646

4747
syn keyword rustTrait Const Copy Send Owned " inherent traits
4848
syn keyword rustTrait Eq Ord Num Ptr
49-
syn keyword rustTrait Drop Add Sub Mul Div Modulo Neg BitAnd BitOr
49+
syn keyword rustTrait Drop Add Sub Mul Quot Rem Neg BitAnd BitOr
5050
syn keyword rustTrait BitXor Shl Shr Index
5151

5252
syn keyword rustSelf self

branches/incoming/src/etc/x86.supp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@
583583
{
584584
llvm-optimization-reads-uninitialized-memory-3
585585
Memcheck:Cond
586-
fun:_ZN4test9run_tests4anon13expr_fn_*
586+
fun:_ZN4test9run_tests*
587587
...
588588
}
589589

@@ -654,3 +654,11 @@
654654
fun:_ZN5visit30visit_struct_dtor_helper_*
655655
...
656656
}
657+
658+
{
659+
llvm-optimization-reads-uninitialized-memory-16
660+
Memcheck:Cond
661+
fun:_ZN7ast_map6map_fn*
662+
fun:_ZN5visit30visit_struct_dtor_helper*
663+
...
664+
}

branches/incoming/src/libcore/at_vec.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ pub mod rustrt {
4141
pub fn capacity<T>(v: @[T]) -> uint {
4242
unsafe {
4343
let repr: **raw::VecRepr =
44-
::cast::reinterpret_cast(&addr_of(&v));
44+
::cast::transmute(addr_of(&v));
4545
(**repr).unboxed.alloc / sys::size_of::<T>()
4646
}
4747
}
@@ -208,7 +208,7 @@ pub mod raw {
208208
*/
209209
#[inline(always)]
210210
pub unsafe fn set_len<T>(v: @[T], new_len: uint) {
211-
let repr: **mut VecRepr = ::cast::reinterpret_cast(&addr_of(&v));
211+
let repr: **mut VecRepr = ::cast::transmute(addr_of(&v));
212212
(**repr).unboxed.fill = new_len * sys::size_of::<T>();
213213
}
214214

@@ -226,7 +226,7 @@ pub mod raw {
226226

227227
#[inline(always)] // really pretty please
228228
pub unsafe fn push_fast<T>(v: &mut @[T], initval: T) {
229-
let repr: **mut VecRepr = ::cast::reinterpret_cast(&v);
229+
let repr: **mut VecRepr = ::cast::transmute(v);
230230
let fill = (**repr).unboxed.fill;
231231
(**repr).unboxed.fill += sys::size_of::<T>();
232232
let p = addr_of(&((**repr).unboxed.data));
@@ -322,4 +322,4 @@ mod test {
322322
assert!(from_slice([@"abc", @"123"]) == @[@"abc", @"123"]);
323323
assert!(from_slice([@[42]]) == @[@[42]]);
324324
}
325-
}
325+
}

0 commit comments

Comments
 (0)