Skip to content

Commit e02778a

Browse files
committed
---
yaml --- r: 196504 b: refs/heads/auto c: 8ac622c h: refs/heads/master v: v3
1 parent e026bd8 commit e02778a

File tree

111 files changed

+805
-933
lines changed

Some content is hidden

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

111 files changed

+805
-933
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: ad3daa89f2b77aeba508188dd96bf0ffbe633806
13+
refs/heads/auto: 8ac622ce724d75505493e228037e17973546a5d6
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/configure

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,6 @@ opt verify-install 1 "verify installed binaries work"
545545
# This is used by the automation to produce single-target nightlies
546546
opt dist-host-only 0 "only install bins for the host architecture"
547547
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
548-
opt jemalloc 1 "build liballoc with jemalloc"
549548
opt llvm-version-check 1 "don't check if the LLVM version is supported, build anyway"
550549

551550
valopt localstatedir "/var/lib" "local state directory"
@@ -562,6 +561,7 @@ valopt android-cross-path "/opt/ndk_standalone" "Android NDK standalone path"
562561
# (others are conditionally saved).
563562
opt_nosave manage-submodules 1 "let the build manage the git submodules"
564563
opt_nosave clang 0 "prefer clang to gcc for building the runtime"
564+
opt_nosave jemalloc 1 "build liballoc with jemalloc"
565565

566566
valopt_nosave prefix "/usr/local" "set installation prefix"
567567
valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"
@@ -669,7 +669,6 @@ probe CFG_LD ld
669669
probe CFG_VALGRIND valgrind
670670
probe CFG_PERF perf
671671
probe CFG_ISCC iscc
672-
probe CFG_JAVAC javac
673672
probe CFG_ANTLR4 antlr4
674673
probe CFG_GRUN grun
675674
probe CFG_FLEX flex
@@ -679,6 +678,14 @@ probe CFG_XELATEX xelatex
679678
probe CFG_GDB gdb
680679
probe CFG_LLDB lldb
681680

681+
# On MacOS X, invoking `javac` pops up a dialog if the JDK is not
682+
# installed. Since `javac` is only used if `antlr4` is available,
683+
# probe for it only in this case.
684+
if [ ! -z "$CFG_ANTLR4" ]
685+
then
686+
probe CFG_JAVAC javac
687+
fi
688+
682689
if [ ! -z "$CFG_GDB" ]
683690
then
684691
# Store GDB's version
@@ -775,7 +782,7 @@ if [ $CFG_OSTYPE = unknown-bitrig ]
775782
then
776783
step_msg "on Bitrig, forcing use of clang, disabling jemalloc"
777784
CFG_ENABLE_CLANG=1
778-
CFG_ENABLE_JEMALLOC=0
785+
CFG_DISABLE_JEMALLOC=1
779786
fi
780787

781788
if [ -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
@@ -828,6 +835,12 @@ then
828835
putvar CFG_ENABLE_CLANG
829836
fi
830837

838+
# Same with jemalloc. save the setting here.
839+
if [ ! -z "$CFG_DISABLE_JEMALLOC" ]
840+
then
841+
putvar CFG_DISABLE_JEMALLOC
842+
fi
843+
831844
if [ ! -z "$CFG_LLVM_ROOT" -a -z "$CFG_DISABLE_LLVM_VERSION_CHECK" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
832845
then
833846
step_msg "using custom LLVM at $CFG_LLVM_ROOT"

branches/auto/src/libarena/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,16 @@ struct TyDesc {
192192
align: usize
193193
}
194194

195+
trait AllTypes { fn dummy(&self) { } }
196+
impl<T:?Sized> AllTypes for T { }
197+
195198
unsafe fn get_tydesc<T>() -> *const TyDesc {
196199
use std::raw::TraitObject;
197200

198201
let ptr = &*(1 as *const T);
199202

200203
// Can use any trait that is implemented for all types.
201-
let obj = mem::transmute::<&marker::MarkerTrait, TraitObject>(ptr);
204+
let obj = mem::transmute::<&AllTypes, TraitObject>(ptr);
202205
obj.vtable as *const TyDesc
203206
}
204207

branches/auto/src/libcollections/bit.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -190,17 +190,17 @@ fn blocks_for_bits(bits: usize) -> usize {
190190
//
191191
// Note that we can technically avoid this branch with the expression
192192
// `(nbits + u32::BITS - 1) / 32::BITS`, but if nbits is almost usize::MAX this will overflow.
193-
if bits % u32::BITS as usize == 0 {
194-
bits / u32::BITS as usize
193+
if bits % u32::BITS == 0 {
194+
bits / u32::BITS
195195
} else {
196-
bits / u32::BITS as usize + 1
196+
bits / u32::BITS + 1
197197
}
198198
}
199199

200200
/// Computes the bitmask for the final word of the vector
201201
fn mask_for_bits(bits: usize) -> u32 {
202202
// Note especially that a perfect multiple of u32::BITS should mask all 1s.
203-
!0 >> (u32::BITS as usize - bits % u32::BITS as usize) % u32::BITS as usize
203+
!0 >> (u32::BITS - bits % u32::BITS) % u32::BITS
204204
}
205205

206206
impl BitVec {
@@ -238,7 +238,7 @@ impl BitVec {
238238
/// An operation might screw up the unused bits in the last block of the
239239
/// `BitVec`. As per (3), it's assumed to be all 0s. This method fixes it up.
240240
fn fix_last_block(&mut self) {
241-
let extra_bits = self.len() % u32::BITS as usize;
241+
let extra_bits = self.len() % u32::BITS;
242242
if extra_bits > 0 {
243243
let mask = (1 << extra_bits) - 1;
244244
let storage_len = self.storage.len();
@@ -317,7 +317,7 @@ impl BitVec {
317317
/// false, false, true, false]));
318318
/// ```
319319
pub fn from_bytes(bytes: &[u8]) -> BitVec {
320-
let len = bytes.len().checked_mul(u8::BITS as usize).expect("capacity overflow");
320+
let len = bytes.len().checked_mul(u8::BITS).expect("capacity overflow");
321321
let mut bit_vec = BitVec::with_capacity(len);
322322
let complete_words = bytes.len() / 4;
323323
let extra_bytes = bytes.len() % 4;
@@ -386,8 +386,8 @@ impl BitVec {
386386
if i >= self.nbits {
387387
return None;
388388
}
389-
let w = i / u32::BITS as usize;
390-
let b = i % u32::BITS as usize;
389+
let w = i / u32::BITS;
390+
let b = i % u32::BITS;
391391
self.storage.get(w).map(|&block|
392392
(block & (1 << b)) != 0
393393
)
@@ -414,8 +414,8 @@ impl BitVec {
414414
reason = "panic semantics are likely to change in the future")]
415415
pub fn set(&mut self, i: usize, x: bool) {
416416
assert!(i < self.nbits);
417-
let w = i / u32::BITS as usize;
418-
let b = i % u32::BITS as usize;
417+
let w = i / u32::BITS;
418+
let b = i % u32::BITS;
419419
let flag = 1 << b;
420420
let val = if x { self.storage[w] | flag }
421421
else { self.storage[w] & !flag };
@@ -811,7 +811,7 @@ impl BitVec {
811811
#[inline]
812812
#[stable(feature = "rust1", since = "1.0.0")]
813813
pub fn capacity(&self) -> usize {
814-
self.storage.capacity().checked_mul(u32::BITS as usize).unwrap_or(usize::MAX)
814+
self.storage.capacity().checked_mul(u32::BITS).unwrap_or(usize::MAX)
815815
}
816816

817817
/// Grows the `BitVec` in-place, adding `n` copies of `value` to the `BitVec`.
@@ -842,7 +842,7 @@ impl BitVec {
842842

843843
// Correct the old tail word, setting or clearing formerly unused bits
844844
let num_cur_blocks = blocks_for_bits(self.nbits);
845-
if self.nbits % u32::BITS as usize > 0 {
845+
if self.nbits % u32::BITS > 0 {
846846
let mask = mask_for_bits(self.nbits);
847847
if value {
848848
self.storage[num_cur_blocks - 1] |= !mask;
@@ -892,7 +892,7 @@ impl BitVec {
892892
// (3)
893893
self.set(i, false);
894894
self.nbits = i;
895-
if self.nbits % u32::BITS as usize == 0 {
895+
if self.nbits % u32::BITS == 0 {
896896
// (2)
897897
self.storage.pop();
898898
}
@@ -915,7 +915,7 @@ impl BitVec {
915915
/// ```
916916
#[stable(feature = "rust1", since = "1.0.0")]
917917
pub fn push(&mut self, elem: bool) {
918-
if self.nbits % u32::BITS as usize == 0 {
918+
if self.nbits % u32::BITS == 0 {
919919
self.storage.push(0);
920920
}
921921
let insert_pos = self.nbits;
@@ -1433,7 +1433,7 @@ impl BitSet {
14331433
// Truncate
14341434
let trunc_len = cmp::max(old_len - n, 1);
14351435
bit_vec.storage.truncate(trunc_len);
1436-
bit_vec.nbits = trunc_len * u32::BITS as usize;
1436+
bit_vec.nbits = trunc_len * u32::BITS;
14371437
}
14381438

14391439
/// Iterator over each u32 stored in the `BitSet`.
@@ -1871,13 +1871,13 @@ impl<'a> Iterator for TwoBitPositions<'a> {
18711871
fn next(&mut self) -> Option<usize> {
18721872
while self.next_idx < self.set.bit_vec.len() ||
18731873
self.next_idx < self.other.bit_vec.len() {
1874-
let bit_idx = self.next_idx % u32::BITS as usize;
1874+
let bit_idx = self.next_idx % u32::BITS;
18751875
if bit_idx == 0 {
18761876
let s_bit_vec = &self.set.bit_vec;
18771877
let o_bit_vec = &self.other.bit_vec;
18781878
// Merging the two words is a bit of an awkward dance since
18791879
// one BitVec might be longer than the other
1880-
let word_idx = self.next_idx / u32::BITS as usize;
1880+
let word_idx = self.next_idx / u32::BITS;
18811881
let w1 = if word_idx < s_bit_vec.storage.len() {
18821882
s_bit_vec.storage[word_idx]
18831883
} else { 0 };

branches/auto/src/libcollections/borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned {
342342
}
343343

344344
#[stable(feature = "rust1", since = "1.0.0")]
345-
impl<'a, T: Clone> AsRef<T> for Cow<'a, T> {
345+
impl<'a, T: ?Sized + ToOwned> AsRef<T> for Cow<'a, T> {
346346
fn as_ref(&self) -> &T {
347347
self
348348
}

branches/auto/src/libcollections/enum_set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub trait CLike {
8686
fn bit<E:CLike>(e: &E) -> usize {
8787
use core::usize;
8888
let value = e.to_usize();
89-
assert!(value < usize::BITS as usize,
89+
assert!(value < usize::BITS,
9090
"EnumSet only supports up to {} variants.", usize::BITS - 1);
9191
1 << value
9292
}

branches/auto/src/libcollections/string.rs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -796,49 +796,51 @@ impl<'a, 'b> Pattern<'a> for &'b String {
796796
#[stable(feature = "rust1", since = "1.0.0")]
797797
impl PartialEq for String {
798798
#[inline]
799-
fn eq(&self, other: &String) -> bool { PartialEq::eq(&**self, &**other) }
799+
fn eq(&self, other: &String) -> bool { PartialEq::eq(&self[..], &other[..]) }
800800
#[inline]
801-
fn ne(&self, other: &String) -> bool { PartialEq::ne(&**self, &**other) }
801+
fn ne(&self, other: &String) -> bool { PartialEq::ne(&self[..], &other[..]) }
802802
}
803803

804804
macro_rules! impl_eq {
805805
($lhs:ty, $rhs: ty) => {
806806
#[stable(feature = "rust1", since = "1.0.0")]
807807
impl<'a> PartialEq<$rhs> for $lhs {
808808
#[inline]
809-
fn eq(&self, other: &$rhs) -> bool { PartialEq::eq(&**self, &**other) }
809+
fn eq(&self, other: &$rhs) -> bool { PartialEq::eq(&self[..], &other[..]) }
810810
#[inline]
811-
fn ne(&self, other: &$rhs) -> bool { PartialEq::ne(&**self, &**other) }
811+
fn ne(&self, other: &$rhs) -> bool { PartialEq::ne(&self[..], &other[..]) }
812812
}
813813

814814
#[stable(feature = "rust1", since = "1.0.0")]
815815
impl<'a> PartialEq<$lhs> for $rhs {
816816
#[inline]
817-
fn eq(&self, other: &$lhs) -> bool { PartialEq::eq(&**self, &**other) }
817+
fn eq(&self, other: &$lhs) -> bool { PartialEq::eq(&self[..], &other[..]) }
818818
#[inline]
819-
fn ne(&self, other: &$lhs) -> bool { PartialEq::ne(&**self, &**other) }
819+
fn ne(&self, other: &$lhs) -> bool { PartialEq::ne(&self[..], &other[..]) }
820820
}
821821

822822
}
823823
}
824824

825+
impl_eq! { String, str }
825826
impl_eq! { String, &'a str }
827+
impl_eq! { Cow<'a, str>, str }
826828
impl_eq! { Cow<'a, str>, String }
827829

828830
#[stable(feature = "rust1", since = "1.0.0")]
829831
impl<'a, 'b> PartialEq<&'b str> for Cow<'a, str> {
830832
#[inline]
831-
fn eq(&self, other: &&'b str) -> bool { PartialEq::eq(&**self, &**other) }
833+
fn eq(&self, other: &&'b str) -> bool { PartialEq::eq(&self[..], &other[..]) }
832834
#[inline]
833-
fn ne(&self, other: &&'b str) -> bool { PartialEq::ne(&**self, &**other) }
835+
fn ne(&self, other: &&'b str) -> bool { PartialEq::ne(&self[..], &other[..]) }
834836
}
835837

836838
#[stable(feature = "rust1", since = "1.0.0")]
837839
impl<'a, 'b> PartialEq<Cow<'a, str>> for &'b str {
838840
#[inline]
839-
fn eq(&self, other: &Cow<'a, str>) -> bool { PartialEq::eq(&**self, &**other) }
841+
fn eq(&self, other: &Cow<'a, str>) -> bool { PartialEq::eq(&self[..], &other[..]) }
840842
#[inline]
841-
fn ne(&self, other: &Cow<'a, str>) -> bool { PartialEq::ne(&**self, &**other) }
843+
fn ne(&self, other: &Cow<'a, str>) -> bool { PartialEq::ne(&self[..], &other[..]) }
842844
}
843845

844846
#[unstable(feature = "collections", reason = "waiting on Str stabilization")]

branches/auto/src/libcollectionstest/bit/set.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ mod bench {
407407
let mut bit_vec = BitSet::new();
408408
b.iter(|| {
409409
for _ in 0..100 {
410-
bit_vec.insert((r.next_u32() as usize) % u32::BITS as usize);
410+
bit_vec.insert((r.next_u32() as usize) % u32::BITS);
411411
}
412412
black_box(&bit_vec);
413413
});

0 commit comments

Comments
 (0)