Skip to content

Commit af5b73c

Browse files
committed
---
yaml --- r: 140537 b: refs/heads/try2 c: 9b09dce h: refs/heads/master i: 140535: c547550 v: v3
1 parent e6906b7 commit af5b73c

File tree

25 files changed

+116
-299
lines changed

25 files changed

+116
-299
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 3a34e93651cb84536a23f9cdb6290bdee6446264
8+
refs/heads/try2: 9b09dce3e1a9935bbe443a976e47ed9f71227883
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/host.mk

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

133-
ifneq ($(CFG_LIBDIR),bin)
134133
$$(HLIB$(2)_H_$(4))/:
135134
mkdir -p $$@
136-
endif
137135

138136
endef
139137

branches/try2/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

branches/try2/mk/rt.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ 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)" \
166168
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/libuv" \
167169
OS=mingw \
168170
V=$$(VERBOSE)

branches/try2/mk/target.mk

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

89-
ifneq ($(CFG_LIBDIR),bin)
9089
$$(TLIB$(1)_T_$(2)_H_$(3))/:
9190
mkdir -p $$@
92-
endif
9391

9492
endef
9593

branches/try2/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
######################################################################

branches/try2/src/libcore/cell.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ A dynamic, mutable location.
1919
Similar to a mutable option type, but friendlier.
2020
*/
2121

22-
#[mutable]
2322
pub struct Cell<T> {
2423
priv value: Option<T>
2524
}

branches/try2/src/libcore/hashmap.rs

Lines changed: 3 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -352,27 +352,16 @@ 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)]
356355
fn find_mut<'a>(&'a mut self, k: &K) -> Option<&'a mut V> {
357356
let idx = match self.bucket_for_key(k) {
358357
FoundEntry(idx) => idx,
359358
TableFull | FoundHole(_) => return None
360359
};
361-
unsafe {
360+
unsafe { // FIXME(#4903)---requires flow-sensitive borrow checker
362361
Some(::cast::transmute_mut_region(self.mut_value_for_bucket(idx)))
363362
}
364363
}
365364
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-
376365
/// Insert a key-value pair into the map. An existing value for a
377366
/// key is replaced by the new value. Return true if the key did
378367
/// not already exist in the map.
@@ -435,7 +424,6 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
435424
436425
/// Return the value corresponding to the key in the map, or insert
437426
/// and return the value if it doesn't exist.
438-
#[cfg(stage0)]
439427
fn find_or_insert<'a>(&'a mut self, k: K, v: V) -> &'a V {
440428
if self.size >= self.resize_at {
441429
// n.b.: We could also do this after searching, so
@@ -459,43 +447,13 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
459447
},
460448
};
461449
462-
unsafe {
450+
unsafe { // FIXME(#4903)---requires flow-sensitive borrow checker
463451
::cast::transmute_region(self.value_for_bucket(idx))
464452
}
465453
}
466454
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-
496455
/// Return the value corresponding to the key in the map, or create,
497456
/// insert, and return a new value if it doesn't exist.
498-
#[cfg(stage0)]
499457
fn find_or_insert_with<'a>(&'a mut self, k: K, f: &fn(&K) -> V) -> &'a V {
500458
if self.size >= self.resize_at {
501459
// n.b.: We could also do this after searching, so
@@ -520,41 +478,11 @@ pub impl<K: Hash + Eq, V> HashMap<K, V> {
520478
},
521479
};
522480
523-
unsafe {
481+
unsafe { // FIXME(#4903)---requires flow-sensitive borrow checker
524482
::cast::transmute_region(self.value_for_bucket(idx))
525483
}
526484
}
527485
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-
558486
fn consume(&mut self, f: &fn(K, V)) {
559487
let mut buckets = ~[];
560488
self.buckets <-> buckets;

branches/try2/src/libcore/num/f32.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,6 @@ pub mod consts {
195195
pub static ln_10: f32 = 2.30258509299404568401799145468436421_f32;
196196
}
197197

198-
#[inline(always)]
199-
pub fn logarithm(n: f32, b: f32) -> f32 {
200-
return log2(n) / log2(b);
201-
}
202-
203198
impl Num for f32 {}
204199

205200
#[cfg(notest)]
@@ -422,12 +417,19 @@ impl Exponential for f32 {
422417
#[inline(always)]
423418
fn expm1(&self) -> f32 { expm1(*self) }
424419

420+
/// Returns the natural logarithm of the number
425421
#[inline(always)]
426-
fn log(&self) -> f32 { ln(*self) }
422+
fn ln(&self) -> f32 { ln(*self) }
427423

424+
/// Returns the logarithm of the number with respect to an arbitrary base
425+
#[inline(always)]
426+
fn log(&self, base: f32) -> f32 { self.ln() / base.ln() }
427+
428+
/// Returns the base 2 logarithm of the number
428429
#[inline(always)]
429430
fn log2(&self) -> f32 { log2(*self) }
430431

432+
/// Returns the base 10 logarithm of the number
431433
#[inline(always)]
432434
fn log10(&self) -> f32 { log10(*self) }
433435
}
@@ -504,13 +506,13 @@ impl Real for f32 {
504506
#[inline(always)]
505507
fn log10_e() -> f32 { 0.434294481903251827651128918916605082 }
506508

507-
/// log(2.0)
509+
/// ln(2.0)
508510
#[inline(always)]
509-
fn log_2() -> f32 { 0.693147180559945309417232121458176568 }
511+
fn ln_2() -> f32 { 0.693147180559945309417232121458176568 }
510512

511-
/// log(10.0)
513+
/// ln(10.0)
512514
#[inline(always)]
513-
fn log_10() -> f32 { 2.30258509299404568401799145468436421 }
515+
fn ln_10() -> f32 { 2.30258509299404568401799145468436421 }
514516

515517
/// Converts to degrees, assuming the number is in radians
516518
#[inline(always)]
@@ -938,8 +940,8 @@ mod tests {
938940
assert_approx_eq!(Real::frac_1_sqrt2::<f32>(), 1f32 / 2f32.sqrt());
939941
assert_approx_eq!(Real::log2_e::<f32>(), Real::e::<f32>().log2());
940942
assert_approx_eq!(Real::log10_e::<f32>(), Real::e::<f32>().log10());
941-
assert_approx_eq!(Real::log_2::<f32>(), 2f32.log());
942-
assert_approx_eq!(Real::log_10::<f32>(), 10f32.log());
943+
assert_approx_eq!(Real::ln_2::<f32>(), 2f32.ln());
944+
assert_approx_eq!(Real::ln_10::<f32>(), 10f32.ln());
943945
}
944946

945947
#[test]

branches/try2/src/libcore/num/f64.rs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,6 @@ pub mod consts {
218218
pub static ln_10: f64 = 2.30258509299404568401799145468436421_f64;
219219
}
220220

221-
#[inline(always)]
222-
pub fn logarithm(n: f64, b: f64) -> f64 {
223-
return log2(n) / log2(b);
224-
}
225-
226221
impl Num for f64 {}
227222

228223
#[cfg(notest)]
@@ -435,12 +430,19 @@ impl Exponential for f64 {
435430
#[inline(always)]
436431
fn expm1(&self) -> f64 { expm1(*self) }
437432

433+
/// Returns the natural logarithm of the number
438434
#[inline(always)]
439-
fn log(&self) -> f64 { ln(*self) }
435+
fn ln(&self) -> f64 { ln(*self) }
440436

437+
/// Returns the logarithm of the number with respect to an arbitrary base
438+
#[inline(always)]
439+
fn log(&self, base: f64) -> f64 { self.ln() / base.ln() }
440+
441+
/// Returns the base 2 logarithm of the number
441442
#[inline(always)]
442443
fn log2(&self) -> f64 { log2(*self) }
443444

445+
/// Returns the base 10 logarithm of the number
444446
#[inline(always)]
445447
fn log10(&self) -> f64 { log10(*self) }
446448
}
@@ -517,13 +519,13 @@ impl Real for f64 {
517519
#[inline(always)]
518520
fn log10_e() -> f64 { 0.434294481903251827651128918916605082 }
519521

520-
/// log(2.0)
522+
/// ln(2.0)
521523
#[inline(always)]
522-
fn log_2() -> f64 { 0.693147180559945309417232121458176568 }
524+
fn ln_2() -> f64 { 0.693147180559945309417232121458176568 }
523525

524-
/// log(10.0)
526+
/// ln(10.0)
525527
#[inline(always)]
526-
fn log_10() -> f64 { 2.30258509299404568401799145468436421 }
528+
fn ln_10() -> f64 { 2.30258509299404568401799145468436421 }
527529

528530
/// Converts to degrees, assuming the number is in radians
529531
#[inline(always)]
@@ -985,8 +987,8 @@ mod tests {
985987
assert_approx_eq!(Real::frac_1_sqrt2::<f64>(), 1f64 / 2f64.sqrt());
986988
assert_approx_eq!(Real::log2_e::<f64>(), Real::e::<f64>().log2());
987989
assert_approx_eq!(Real::log10_e::<f64>(), Real::e::<f64>().log10());
988-
assert_approx_eq!(Real::log_2::<f64>(), 2f64.log());
989-
assert_approx_eq!(Real::log_10::<f64>(), 10f64.log());
990+
assert_approx_eq!(Real::ln_2::<f64>(), 2f64.ln());
991+
assert_approx_eq!(Real::ln_10::<f64>(), 10f64.ln());
990992
}
991993

992994
#[test]

0 commit comments

Comments
 (0)