Skip to content

Commit 633d71f

Browse files
committed
---
yaml --- r: 85919 b: refs/heads/dist-snap c: 188a9dd h: refs/heads/master i: 85917: 81daf2c 85915: 7ccf5ff 85911: b4620e1 85903: 82bf4bc 85887: f00e975 v: v3
1 parent 8b8c905 commit 633d71f

File tree

29 files changed

+696
-588
lines changed

29 files changed

+696
-588
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 7971c46c44420f2b72086ff0b8726b1ada308bcc
9+
refs/heads/dist-snap: 188a9dd210e5cbc1db6a31992dc298d143d80526
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/doc/tutorial-tasks.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ do spawn {
113113
}
114114
~~~
115115

116+
By default, the scheduler multiplexes tasks across the available cores, running
117+
in parallel. Thus, on a multicore machine, running the following code
118+
should interleave the output in vaguely random order.
119+
120+
~~~
121+
# use std::io::print;
122+
# use std::task::spawn;
123+
124+
for child_task_number in range(0, 20) {
125+
do spawn {
126+
print(fmt!("I am child number %d\n", child_task_number));
127+
}
128+
}
129+
~~~
130+
116131
## Communication
117132

118133
Now that we have spawned a new task, it would be nice if we could

branches/dist-snap/mk/rt.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ ifneq ($(strip $(findstring snap,$(MAKECMDGOALS))),)
4141
SNAP_DEFINES=-DRUST_SNAPSHOT
4242
endif
4343

44+
define DEF_LIBUV_ARCH_VAR
45+
LIBUV_ARCH_$(1) = $$(subst i386,ia32,$$(subst x86_64,x64,$$(HOST_$(1))))
46+
endef
47+
$(foreach t,$(CFG_TARGET_TRIPLES),$(eval $(call DEF_LIBUV_ARCH_VAR,$(t))))
48+
4449
define DEF_RUNTIME_TARGETS
4550

4651
######################################################################
@@ -170,7 +175,7 @@ LIBUV_NO_LOAD = run-benchmarks.target.mk run-tests.target.mk \
170175

171176
$$(LIBUV_MAKEFILE_$(1)_$(2)): $$(LIBUV_GYP)
172177
(cd $(S)src/libuv/ && \
173-
$$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(HOST_$(1)) -D ninja \
178+
$$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja \
174179
-Goutput_dir=$$(@D) --generator-output $$(@D))
175180

176181
# XXX: Shouldn't need platform-specific conditions here

branches/dist-snap/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:spac
3333
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
3434

3535
" reserved
36-
syn keyword rustKeyword be yield typeof
36+
syn keyword rustKeyword be
3737

3838
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32
3939
syn keyword rustType f64 i8 i16 i32 i64 str Self

branches/dist-snap/src/librustc/middle/trans/base.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2366,12 +2366,20 @@ pub fn create_entry_wrapper(ccx: @mut CrateContext,
23662366
&ccx.int_type);
23672367

23682368
// FIXME #4404 android JNI hacks
2369-
let main_name = if *ccx.sess.building_library {
2370-
"amain"
2369+
let llfn = if *ccx.sess.building_library {
2370+
decl_cdecl_fn(ccx.llmod, "amain", llfty)
23712371
} else {
2372-
"main"
2372+
let main_name = match ccx.sess.targ_cfg.os {
2373+
session::os_win32 => {
2374+
match ccx.sess.targ_cfg.arch {
2375+
X86 => ~"WinMain@16",
2376+
_ => ~"WinMain",
2377+
}
2378+
},
2379+
_ => ~"main",
2380+
};
2381+
decl_cdecl_fn(ccx.llmod, main_name, llfty)
23732382
};
2374-
let llfn = decl_cdecl_fn(ccx.llmod, main_name, llfty);
23752383
let llbb = do "top".with_c_str |buf| {
23762384
unsafe {
23772385
llvm::LLVMAppendBasicBlockInContext(ccx.llcx, llfn, buf)

branches/dist-snap/src/librustc/middle/trans/type_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub fn type_uses_for(ccx: @mut CrateContext, fn_id: def_id, n_tps: uint)
149149
"visit_tydesc" | "forget" | "frame_address" |
150150
"morestack_addr" => 0,
151151

152-
"offset" |
152+
"offset" | "offset_inbounds" |
153153
"memcpy32" | "memcpy64" | "memmove32" | "memmove64" |
154154
"memset32" | "memset64" => use_repr,
155155

branches/dist-snap/src/librustc/middle/typeck/astconv.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,6 @@ pub fn ast_ty_to_ty<AC:AstConv, RS:region_scope + Clone + 'static>(
517517
}
518518
}
519519
}
520-
ast::ty_typeof(_e) => {
521-
tcx.sess.span_bug(ast_ty.span, "typeof is reserved but unimplemented");
522-
}
523520
ast::ty_infer => {
524521
// ty_infer should only appear as the type of arguments or return
525522
// values in a fn_expr, or as the type of local variables. Both of

branches/dist-snap/src/librustc/middle/typeck/check/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3663,6 +3663,20 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
36633663
mutbl: ast::m_imm
36643664
}))
36653665
}
3666+
"offset_inbounds" => {
3667+
(1,
3668+
~[
3669+
ty::mk_ptr(tcx, ty::mt {
3670+
ty: param(ccx, 0),
3671+
mutbl: ast::m_imm
3672+
}),
3673+
ty::mk_int()
3674+
],
3675+
ty::mk_ptr(tcx, ty::mt {
3676+
ty: param(ccx, 0),
3677+
mutbl: ast::m_imm
3678+
}))
3679+
}
36663680
"memcpy32" => {
36673681
(1,
36683682
~[

branches/dist-snap/src/libstd/c_str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl<'self> ToCStr for &'self [u8] {
179179
do cs.with_mut_ref |buf| {
180180
for i in range(0, self.len()) {
181181
unsafe {
182-
let p = buf.offset(i as int);
182+
let p = buf.offset_inbounds(i as int);
183183
if *p == 0 {
184184
match null_byte::cond.raise(self.to_owned()) {
185185
Truncate => break,
@@ -222,7 +222,7 @@ impl<'self> Iterator<libc::c_char> for CStringIterator<'self> {
222222
if ch == 0 {
223223
None
224224
} else {
225-
self.ptr = unsafe { ptr::offset(self.ptr, 1) };
225+
self.ptr = ptr::offset(self.ptr, 1);
226226
Some(ch)
227227
}
228228
}

0 commit comments

Comments
 (0)