Skip to content

Rolling up PRs in the queue #13443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d3c831b
std: use a `match` in `assert_eq!` to extend the lifetime of the args.
huonw Apr 7, 2014
4b9a7a2
collections: replace all ~[T] with Vec<T>.
huonw Apr 5, 2014
5bcb761
auto merge of #13350 : huonw/rust/devec-collections, r=alexcrichton
bors Apr 10, 2014
43e8ace
debuginfo: Improve source code position assignment for inlined functi…
michaelwoerister Mar 27, 2014
c26d254
debuginfo: Implement discriminator type metadata re-use.
michaelwoerister Mar 27, 2014
5099b8c
debuginfo: Don't create debuginfo for statics inlined from other crates.
michaelwoerister Apr 10, 2014
8135032
Remove references to @Trait from a compiler error message
lilyball Apr 9, 2014
342e8b5
Fix outdated lint warning about inner attribute
milibopp Apr 9, 2014
a65411e
std,serialize: remove some internal uses of ~[].
huonw Apr 9, 2014
3015949
std,native,green,rustuv: make readdir return `Vec`.
huonw Apr 9, 2014
1403b35
std,syntax: make std::fmt::parse use `Vec`s.
huonw Apr 9, 2014
8ec16e1
green: de-~[].
huonw Apr 9, 2014
32cf4a1
native: remove some internal ~[].
huonw Apr 9, 2014
6e63b12
Remove some internal ~[] from several libraries.
huonw Apr 9, 2014
b994828
Stop using transmute_mut in RefCell
sfackler Apr 9, 2014
a70f8d9
Remove an unnecessary file.
omasanori Apr 9, 2014
da25539
Generalized the pretty-print entry points to support `-o <file>`.
pnkfelix Apr 8, 2014
6d6d4c9
test: Add a test for #7663
alexcrichton Apr 8, 2014
dd00bf3
mk: Add a dummy CFG_COMPILER_HOST_TRIPLE to rustdoc invocation.
lifthrasiir Apr 8, 2014
34ece7a
rustdoc: Clean the `initSearch` routine up.
lifthrasiir Apr 8, 2014
85299e3
rustdoc: Prune the paths that do not appear in the index.
lifthrasiir Apr 8, 2014
ec99673
rustc: Remove absolute rpaths
alexcrichton Apr 7, 2014
f9e17e1
rustc: Don't rpath to librustrt.dylib
alexcrichton Apr 8, 2014
25a6b6e
rustc: Add a realpath utility function
alexcrichton Apr 8, 2014
3f2c55f
rustc: Use realpath() for sysroot/rpath
alexcrichton Apr 8, 2014
0bf4e90
Renamed ast::Purity to ast::FnStyle and ast::ImpureFn to ast::NormalF…
kaseyc Apr 7, 2014
83d2c0b
rustc: Disallow importing through use statements
alexcrichton Apr 8, 2014
df533c6
rustc: Don't succeed on shadowed nonexistent import
alexcrichton Apr 8, 2014
1f2c18a
rustc: Don't allow priv use to shadow pub use
alexcrichton Apr 8, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mk/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ LIB_DOC_DEP_$(1) = $$(CRATEFILE_$(1)) $$(RSINPUTS_$(1))
endif

$(2) += doc/$(1)/index.html
doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET)
doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1))
@$$(call E, rustdoc $$@)
$$(Q)$$(RUSTDOC) --cfg dox --cfg stage2 $$<
Expand Down
4 changes: 0 additions & 4 deletions mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,13 @@ CFGFLAG$(1)_T_$(2)_H_$(3) = stage1
endif
endif

ifdef CFG_DISABLE_RPATH
ifeq ($$(OSTYPE_$(3)),apple-darwin)
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
DYLD_LIBRARY_PATH="$$$$DYLD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
else
RPATH_VAR$(1)_T_$(2)_H_$(3) := \
LD_LIBRARY_PATH="$$$$LD_LIBRARY_PATH:$$(CURDIR)/$$(HLIB$(1)_H_$(3))"
endif
else
RPATH_VAR$(1)_T_$(2)_H_$(3) :=
endif

STAGE$(1)_T_$(2)_H_$(3) := \
$$(Q)$$(RPATH_VAR$(1)_T_$(2)_H_$(3)) \
Expand Down
2 changes: 1 addition & 1 deletion src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
let options_to_remove = [~"-O", ~"-g", ~"--debuginfo"];
let new_options = split_maybe_args(options).move_iter()
.filter(|x| !options_to_remove.contains(x))
.collect::<~[~str]>()
.collect::<Vec<~str>>()
.connect(" ");
Some(new_options)
}
Expand Down
67 changes: 33 additions & 34 deletions src/libcollections/bitv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl SmallBitv {

#[deriving(Clone)]
struct BigBitv {
storage: ~[uint]
storage: Vec<uint>
}

/**
Expand All @@ -131,7 +131,7 @@ fn big_mask(nbits: uint, elem: uint) -> uint {
}

impl BigBitv {
pub fn new(storage: ~[uint]) -> BigBitv {
pub fn new(storage: Vec<uint>) -> BigBitv {
BigBitv {storage: storage}
}

Expand Down Expand Up @@ -193,7 +193,7 @@ impl BigBitv {
pub fn get(&self, i: uint) -> bool {
let w = i / uint::BITS;
let b = i % uint::BITS;
let x = 1 & self.storage[w] >> b;
let x = 1 & self.storage.get(w) >> b;
x == 1
}

Expand All @@ -202,15 +202,15 @@ impl BigBitv {
let w = i / uint::BITS;
let b = i % uint::BITS;
let flag = 1 << b;
self.storage[w] = if x { self.storage[w] | flag }
else { self.storage[w] & !flag };
*self.storage.get_mut(w) = if x { *self.storage.get(w) | flag }
else { *self.storage.get(w) & !flag };
}

#[inline]
pub fn equals(&self, b: &BigBitv, nbits: uint) -> bool {
for (i, elt) in b.storage.iter().enumerate() {
let mask = big_mask(nbits, i);
if mask & self.storage[i] != mask & *elt {
if mask & *self.storage.get(i) != mask & *elt {
return false;
}
}
Expand Down Expand Up @@ -278,13 +278,13 @@ impl Bitv {
let s =
if init {
if exact {
slice::from_elem(nelems, !0u)
Vec::from_elem(nelems, !0u)
} else {
let mut v = slice::from_elem(nelems-1, !0u);
let mut v = Vec::from_elem(nelems-1, !0u);
v.push((1<<nbits % uint::BITS)-1);
v
}
} else { slice::from_elem(nelems, 0u)};
} else { Vec::from_elem(nelems, 0u)};
Big(BigBitv::new(s))
};
Bitv {rep: rep, nbits: nbits}
Expand Down Expand Up @@ -451,8 +451,8 @@ impl Bitv {
*
* Each `uint` in the resulting vector has either value `0u` or `1u`.
*/
pub fn to_vec(&self) -> ~[uint] {
slice::from_fn(self.nbits, |x| self.init_to_vec(x))
pub fn to_vec(&self) -> Vec<uint> {
Vec::from_fn(self.nbits, |x| self.init_to_vec(x))
}

/**
Expand All @@ -461,7 +461,7 @@ impl Bitv {
* size of the `Bitv` is not a multiple of 8 then trailing bits
* will be filled-in with false/0
*/
pub fn to_bytes(&self) -> ~[u8] {
pub fn to_bytes(&self) -> Vec<u8> {
fn bit (bitv: &Bitv, byte: uint, bit: uint) -> u8 {
let offset = byte * 8 + bit;
if offset >= bitv.nbits {
Expand All @@ -473,7 +473,7 @@ impl Bitv {

let len = self.nbits/8 +
if self.nbits % 8 == 0 { 0 } else { 1 };
slice::from_fn(len, |i|
Vec::from_fn(len, |i|
bit(self, i, 0) |
bit(self, i, 1) |
bit(self, i, 2) |
Expand All @@ -486,10 +486,10 @@ impl Bitv {
}

/**
* Transform `self` into a `[bool]` by turning each bit into a `bool`.
* Transform `self` into a `Vec<bool>` by turning each bit into a `bool`.
*/
pub fn to_bools(&self) -> ~[bool] {
slice::from_fn(self.nbits, |i| self[i])
pub fn to_bools(&self) -> Vec<bool> {
Vec::from_fn(self.nbits, |i| self[i])
}

/**
Expand Down Expand Up @@ -659,7 +659,7 @@ pub struct BitvSet {
impl BitvSet {
/// Creates a new bit vector set with initially no contents
pub fn new() -> BitvSet {
BitvSet{ size: 0, bitv: BigBitv::new(~[0]) }
BitvSet{ size: 0, bitv: BigBitv::new(vec!(0)) }
}

/// Creates a new bit vector set from the given bit vector
Expand All @@ -673,7 +673,7 @@ impl BitvSet {
match rep {
Big(b) => BitvSet{ size: size, bitv: b },
Small(SmallBitv{bits}) =>
BitvSet{ size: size, bitv: BigBitv{ storage: ~[bits] } },
BitvSet{ size: size, bitv: BigBitv{ storage: vec!(bits) } },
}
}

Expand Down Expand Up @@ -705,9 +705,9 @@ impl BitvSet {
self.bitv.storage.grow(other.capacity() / uint::BITS, &0);
}
for (i, &w) in other.bitv.storage.iter().enumerate() {
let old = self.bitv.storage[i];
let old = *self.bitv.storage.get(i);
let new = f(old, w);
self.bitv.storage[i] = new;
*self.bitv.storage.get_mut(i) = new;
self.size += nbits(new) - nbits(old);
}
}
Expand Down Expand Up @@ -863,7 +863,7 @@ impl MutableSet<uint> for BitvSet {

// Attempt to truncate our storage
let mut i = self.bitv.storage.len();
while i > 1 && self.bitv.storage[i - 1] == 0 {
while i > 1 && *self.bitv.storage.get(i - 1) == 0 {
i -= 1;
}
self.bitv.storage.truncate(i);
Expand All @@ -878,12 +878,12 @@ impl BitvSet {
/// w1, w2) where the bit location is the number of bits offset so far,
/// and w1/w2 are the words coming from the two vectors self, other.
fn commons<'a>(&'a self, other: &'a BitvSet)
-> Map<'static, ((uint, &'a uint), &'a ~[uint]), (uint, uint, uint),
Zip<Enumerate<slice::Items<'a, uint>>, Repeat<&'a ~[uint]>>> {
-> Map<'static, ((uint, &'a uint), &'a Vec<uint>), (uint, uint, uint),
Zip<Enumerate<slice::Items<'a, uint>>, Repeat<&'a Vec<uint>>>> {
let min = cmp::min(self.bitv.storage.len(), other.bitv.storage.len());
self.bitv.storage.slice(0, min).iter().enumerate()
.zip(Repeat::new(&other.bitv.storage))
.map(|((i, &w), o_store)| (i * uint::BITS, w, o_store[i]))
.map(|((i, &w), o_store)| (i * uint::BITS, w, *o_store.get(i)))
}

/// Visits each word in `self` or `other` that extends beyond the other. This
Expand Down Expand Up @@ -946,7 +946,6 @@ mod tests {
use bitv;

use std::uint;
use std::slice;
use rand;
use rand::Rng;

Expand All @@ -964,8 +963,8 @@ mod tests {
#[test]
fn test_0_elements() {
let act = Bitv::new(0u, false);
let exp = slice::from_elem::<bool>(0u, false);
assert!(act.eq_vec(exp));
let exp = Vec::from_elem(0u, false);
assert!(act.eq_vec(exp.as_slice()));
}

#[test]
Expand Down Expand Up @@ -1299,12 +1298,12 @@ mod tests {
fn test_to_bytes() {
let mut bv = Bitv::new(3, true);
bv.set(1, false);
assert_eq!(bv.to_bytes(), ~[0b10100000]);
assert_eq!(bv.to_bytes(), vec!(0b10100000));

let mut bv = Bitv::new(9, false);
bv.set(2, true);
bv.set(8, true);
assert_eq!(bv.to_bytes(), ~[0b00100000, 0b10000000]);
assert_eq!(bv.to_bytes(), vec!(0b00100000, 0b10000000));
}

#[test]
Expand All @@ -1315,7 +1314,7 @@ mod tests {

#[test]
fn test_to_bools() {
let bools = ~[false, false, true, false, false, true, true, false];
let bools = vec!(false, false, true, false, false, true, true, false);
assert_eq!(from_bytes([0b00100110]).to_bools(), bools);
}

Expand All @@ -1334,8 +1333,8 @@ mod tests {
let bools = [true, false, true, true];
let bitv = BitvSet::from_bitv(from_bools(bools));

let idxs: ~[uint] = bitv.iter().collect();
assert_eq!(idxs, ~[0, 2, 3]);
let idxs: Vec<uint> = bitv.iter().collect();
assert_eq!(idxs, vec!(0, 2, 3));
}

#[test]
Expand Down Expand Up @@ -1579,7 +1578,7 @@ mod tests {
#[bench]
fn bench_big_bitv_small(b: &mut BenchHarness) {
let mut r = rng();
let mut bitv = BigBitv::new(~[0]);
let mut bitv = BigBitv::new(vec!(0));
b.iter(|| {
bitv.set((r.next_u32() as uint) % uint::BITS, true);
&bitv
Expand All @@ -1589,7 +1588,7 @@ mod tests {
#[bench]
fn bench_big_bitv_big(b: &mut BenchHarness) {
let mut r = rng();
let mut storage = ~[];
let mut storage = vec!();
storage.grow(BENCH_BITS / uint::BITS, &0u);
let mut bitv = BigBitv::new(storage);
b.iter(|| {
Expand Down
Loading