Skip to content

Commit a785583

Browse files
committed
---
yaml --- r: 60085 b: refs/heads/master c: 80061ec h: refs/heads/master i: 60083: de608c1 v: v3
1 parent a626a35 commit a785583

40 files changed

+669
-369
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: eb5fa061136a1f4eb4d7c3c58f396edea43c234d
2+
refs/heads/master: 80061ecb1d11afd7c450673676e7708f85b73f12
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2d28d645422c1617be58c8ca7ad9a457264ca850
55
refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589

trunk/mk/host.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,10 @@ $$(HLIB$(2)_H_$(4))/$(CFG_RUSTLLVM_$(4)): \
130130
$$(HBIN$(2)_H_$(4))/:
131131
mkdir -p $$@
132132

133+
ifneq ($(CFG_LIBDIR),bin)
133134
$$(HLIB$(2)_H_$(4))/:
134135
mkdir -p $$@
136+
endif
135137

136138
endef
137139

trunk/mk/install.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ ifeq ($(CFG_ADB_DEVICE_STATUS),true)
192192
ifdef VERBOSE
193193
ADB = adb $(1)
194194
ADB_PUSH = adb push $(1) $(2)
195-
ADB_SHELL = adb shell $(1) $(2)
195+
ADB_SHELL = adb shell $(1) $(2)
196196
else
197-
ADB = $(Q)$(call E, adb $(1)) && adb $(1) 1>/dev/null
197+
ADB = $(Q)$(call E, adb $(1)) && adb $(1) 1>/dev/null
198198
ADB_PUSH = $(Q)$(call E, adb push $(1)) && adb push $(1) $(2) 1>/dev/null
199199
ADB_SHELL = $(Q)$(call E, adb shell $(1) $(2)) && adb shell $(1) $(2) 1>/dev/null
200200
endif
@@ -222,8 +222,8 @@ install-runtime-target: \
222222
install-runtime-target-arm-linux-androideabi-cleanup \
223223
install-runtime-target-arm-linux-androideabi-host-$(CFG_BUILD_TRIPLE)
224224
else
225-
install-runtime-target:
225+
install-runtime-target:
226226
@echo "No device to install runtime library"
227-
@echo
227+
@echo
228228
endif
229229
endif

trunk/mk/rt.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@ endif
163163
ifdef CFG_WINDOWSY_$(1)
164164
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
165165
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
166-
CFLAGS="$$(CFG_GCCISH_CFLAGS)" \
167-
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS)" \
168166
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/libuv" \
169167
OS=mingw \
170168
V=$$(VERBOSE)

trunk/mk/target.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ endif
8686
$$(TBIN$(1)_T_$(2)_H_$(3))/:
8787
mkdir -p $$@
8888

89+
ifneq ($(CFG_LIBDIR),bin)
8990
$$(TLIB$(1)_T_$(2)_H_$(3))/:
9091
mkdir -p $$@
92+
endif
9193

9294
endef
9395

trunk/mk/tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ endef
9292
$(foreach target,$(CFG_TARGET_TRIPLES), \
9393
$(eval $(call DEF_TARGET_COMMANDS,$(target))))
9494

95-
# Target platform specific variables
95+
# Target platform specific variables
9696
# for arm-linux-androidabi
9797
define DEF_ADB_DEVICE_STATUS
9898
CFG_ADB_DEVICE_STATUS=$(1)
@@ -402,7 +402,7 @@ $(foreach host,$(CFG_HOST_TRIPLES), \
402402
$(eval $(call DEF_TEST_CRATE_RULES_null,$(stage),$(target),$(host),$(crate))) \
403403
), \
404404
$(eval $(call DEF_TEST_CRATE_RULES,$(stage),$(target),$(host),$(crate))) \
405-
))))))
405+
))))))
406406

407407

408408
######################################################################
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"Highlight the 100th text column
22
"Feature became available in v7.3
33
if version >= 703
4-
set colorcolumn=100
4+
setlocal colorcolumn=100
55
endif

trunk/src/etc/vim/after/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if exists('g:no_rust_conceal') || !has('conceal') || &enc != 'utf-8'
1+
if !exists('g:rust_conceal') || !has('conceal') || &enc != 'utf-8'
22
finish
33
endif
44

trunk/src/etc/vim/indent/rust.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ if exists("b:did_indent")
55
endif
66

77
let b:did_indent = 1
8-
setlocal smartindent
8+
9+
setlocal cindent
10+
setlocal cinoptions=L0,(0,Ws,JN
11+
setlocal cinkeys=0{,0},!^F,o,O

trunk/src/etc/vim/syntax/rust.vim

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

3131
" Reserved words
32-
syn keyword rustKeyword m32 m64 m128 f80 f16 f128 be
32+
"syn keyword rustKeyword m32 m64 m128 f80 f16 f128 be " These are obsolete
3333

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

trunk/src/libcore/hashmap.rs

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -352,16 +352,27 @@ impl<K:Hash + Eq,V> Map<K, V> for HashMap<K, V> {
352352
}
353353
354354
/// Return a mutable reference to the value corresponding to the key
355+
#[cfg(stage0)]
355356
fn find_mut<'a>(&'a mut self, k: &K) -> Option<&'a mut V> {
356357
let idx = match self.bucket_for_key(k) {
357358
FoundEntry(idx) => idx,
358359
TableFull | FoundHole(_) => return None
359360
};
360-
unsafe { // FIXME(#4903)---requires flow-sensitive borrow checker
361+
unsafe {
361362
Some(::cast::transmute_mut_region(self.mut_value_for_bucket(idx)))
362363
}
363364
}
364365
366+
/// Return a mutable reference to the value corresponding to the key
367+
#[cfg(not(stage0))]
368+
fn find_mut<'a>(&'a mut self, k: &K) -> Option<&'a mut V> {
369+
let idx = match self.bucket_for_key(k) {
370+
FoundEntry(idx) => idx,
371+
TableFull | FoundHole(_) => return None
372+
};
373+
Some(self.mut_value_for_bucket(idx))
374+
}
375+
365376
/// Insert a key-value pair into the map. An existing value for a
366377
/// key is replaced by the new value. Return true if the key did
367378
/// not already exist in the map.
@@ -424,6 +435,7 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
424435
425436
/// Return the value corresponding to the key in the map, or insert
426437
/// and return the value if it doesn't exist.
438+
#[cfg(stage0)]
427439
fn find_or_insert<'a>(&'a mut self, k: K, v: V) -> &'a V {
428440
if self.size >= self.resize_at {
429441
// n.b.: We could also do this after searching, so
@@ -447,13 +459,43 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
447459
},
448460
};
449461
450-
unsafe { // FIXME(#4903)---requires flow-sensitive borrow checker
462+
unsafe {
451463
::cast::transmute_region(self.value_for_bucket(idx))
452464
}
453465
}
454466
467+
/// Return the value corresponding to the key in the map, or insert
468+
/// and return the value if it doesn't exist.
469+
#[cfg(not(stage0))]
470+
fn find_or_insert<'a>(&'a mut self, k: K, v: V) -> &'a V {
471+
if self.size >= self.resize_at {
472+
// n.b.: We could also do this after searching, so
473+
// that we do not resize if this call to insert is
474+
// simply going to update a key in place. My sense
475+
// though is that it's worse to have to search through
476+
// buckets to find the right spot twice than to just
477+
// resize in this corner case.
478+
self.expand();
479+
}
480+
481+
let hash = k.hash_keyed(self.k0, self.k1) as uint;
482+
let idx = match self.bucket_for_key_with_hash(hash, &k) {
483+
TableFull => fail!(~"Internal logic error"),
484+
FoundEntry(idx) => idx,
485+
FoundHole(idx) => {
486+
self.buckets[idx] = Some(Bucket{hash: hash, key: k,
487+
value: v});
488+
self.size += 1;
489+
idx
490+
},
491+
};
492+
493+
self.value_for_bucket(idx)
494+
}
495+
455496
/// Return the value corresponding to the key in the map, or create,
456497
/// insert, and return a new value if it doesn't exist.
498+
#[cfg(stage0)]
457499
fn find_or_insert_with<'a>(&'a mut self, k: K, f: &fn(&K) -> V) -> &'a V {
458500
if self.size >= self.resize_at {
459501
// n.b.: We could also do this after searching, so
@@ -478,11 +520,41 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
478520
},
479521
};
480522
481-
unsafe { // FIXME(#4903)---requires flow-sensitive borrow checker
523+
unsafe {
482524
::cast::transmute_region(self.value_for_bucket(idx))
483525
}
484526
}
485527
528+
/// Return the value corresponding to the key in the map, or create,
529+
/// insert, and return a new value if it doesn't exist.
530+
#[cfg(not(stage0))]
531+
fn find_or_insert_with<'a>(&'a mut self, k: K, f: &fn(&K) -> V) -> &'a V {
532+
if self.size >= self.resize_at {
533+
// n.b.: We could also do this after searching, so
534+
// that we do not resize if this call to insert is
535+
// simply going to update a key in place. My sense
536+
// though is that it's worse to have to search through
537+
// buckets to find the right spot twice than to just
538+
// resize in this corner case.
539+
self.expand();
540+
}
541+
542+
let hash = k.hash_keyed(self.k0, self.k1) as uint;
543+
let idx = match self.bucket_for_key_with_hash(hash, &k) {
544+
TableFull => fail!(~"Internal logic error"),
545+
FoundEntry(idx) => idx,
546+
FoundHole(idx) => {
547+
let v = f(&k);
548+
self.buckets[idx] = Some(Bucket{hash: hash, key: k,
549+
value: v});
550+
self.size += 1;
551+
idx
552+
},
553+
};
554+
555+
self.value_for_bucket(idx)
556+
}
557+
486558
fn consume(&mut self, f: &fn(K, V)) {
487559
let mut buckets = ~[];
488560
self.buckets <-> buckets;

trunk/src/libcore/num/cmath.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ pub mod c_double_utils {
3333
unsafe fn erf(n: c_double) -> c_double;
3434
unsafe fn erfc(n: c_double) -> c_double;
3535
unsafe fn exp(n: c_double) -> c_double;
36-
unsafe fn expm1(n: c_double) -> c_double;
36+
// rename: for consistency with underscore usage elsewhere
37+
#[link_name="expm1"] unsafe fn exp_m1(n: c_double) -> c_double;
3738
unsafe fn exp2(n: c_double) -> c_double;
3839
#[link_name="fabs"] unsafe fn abs(n: c_double) -> c_double;
3940
// rename: for clarity and consistency with add/sub/mul/div
@@ -63,7 +64,7 @@ pub mod c_double_utils {
6364
// renamed: "logb" /often/ is confused for log2 by beginners
6465
#[link_name="logb"] unsafe fn log_radix(n: c_double) -> c_double;
6566
// renamed: to be consitent with log as ln
66-
#[link_name="log1p"] unsafe fn ln1p(n: c_double) -> c_double;
67+
#[link_name="log1p"] unsafe fn ln_1p(n: c_double) -> c_double;
6768
unsafe fn log10(n: c_double) -> c_double;
6869
unsafe fn log2(n: c_double) -> c_double;
6970
#[link_name="ilogb"] unsafe fn ilog_radix(n: c_double) -> c_int;
@@ -117,7 +118,7 @@ pub mod c_float_utils {
117118
#[link_name="erff"] unsafe fn erf(n: c_float) -> c_float;
118119
#[link_name="erfcf"] unsafe fn erfc(n: c_float) -> c_float;
119120
#[link_name="expf"] unsafe fn exp(n: c_float) -> c_float;
120-
#[link_name="expm1f"]unsafe fn expm1(n: c_float) -> c_float;
121+
#[link_name="expm1f"]unsafe fn exp_m1(n: c_float) -> c_float;
121122
#[link_name="exp2f"] unsafe fn exp2(n: c_float) -> c_float;
122123
#[link_name="fabsf"] unsafe fn abs(n: c_float) -> c_float;
123124
#[link_name="fdimf"]
@@ -148,7 +149,7 @@ pub mod c_float_utils {
148149

149150
#[link_name="logf"] unsafe fn ln(n: c_float) -> c_float;
150151
#[link_name="logbf"] unsafe fn log_radix(n: c_float) -> c_float;
151-
#[link_name="log1pf"] unsafe fn ln1p(n: c_float) -> c_float;
152+
#[link_name="log1pf"] unsafe fn ln_1p(n: c_float) -> c_float;
152153
#[link_name="log2f"] unsafe fn log2(n: c_float) -> c_float;
153154
#[link_name="log10f"] unsafe fn log10(n: c_float) -> c_float;
154155
#[link_name="ilogbf"] unsafe fn ilog_radix(n: c_float) -> c_int;

0 commit comments

Comments
 (0)