Skip to content

Commit afedc45

Browse files
committed
---
yaml --- r: 130866 b: refs/heads/auto c: 0c73e5f h: refs/heads/master v: v3
1 parent 088c586 commit afedc45

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 8bfbcddf5382ab156b442b08f3236800d0b6ccd8
16+
refs/heads/auto: 0c73e5fc5f212d30bb46b96cb45b51251217a199
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libcollections/vec.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,19 @@ pub struct MoveItems<T> {
16181618
iter: Items<'static, T>
16191619
}
16201620

1621+
impl<T> MoveItems<T> {
1622+
#[inline]
1623+
/// Drops all items that have not yet been moved and returns the empty vector.
1624+
pub fn unwrap(mut self) -> Vec<T> {
1625+
unsafe {
1626+
for _x in self { }
1627+
let MoveItems { allocation, cap, iter: _iter } = self;
1628+
mem::forget(self);
1629+
Vec { ptr: allocation, cap: cap, len: 0 }
1630+
}
1631+
}
1632+
}
1633+
16211634
impl<T> Iterator<T> for MoveItems<T> {
16221635
#[inline]
16231636
fn next<'a>(&'a mut self) -> Option<T> {
@@ -2016,6 +2029,18 @@ mod tests {
20162029
assert_eq!(vec.swap_remove(0), None);
20172030
}
20182031

2032+
#[test]
2033+
fn test_move_iter_unwrap() {
2034+
let mut vec: Vec<uint> = Vec::with_capacity(7);
2035+
vec.push(1);
2036+
vec.push(2);
2037+
let ptr = vec.as_ptr();
2038+
vec = vec.move_iter().unwrap();
2039+
assert_eq!(vec.as_ptr(), ptr);
2040+
assert_eq!(vec.capacity(), 7);
2041+
assert_eq!(vec.len(), 0);
2042+
}
2043+
20192044
#[bench]
20202045
fn bench_new(b: &mut Bencher) {
20212046
b.iter(|| {

branches/auto/src/librustc/back/link.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,12 @@ fn link_args(cmd: &mut Command,
10151015

10161016
// Mark all dynamic libraries and executables as compatible with ASLR
10171017
cmd.arg("-Wl,--dynamicbase");
1018+
1019+
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
1020+
// space available to x86 Windows binaries on x86_64.
1021+
if sess.targ_cfg.arch == abi::X86 {
1022+
cmd.arg("-Wl,--large-address-aware");
1023+
}
10181024
}
10191025

10201026
if sess.targ_cfg.os == abi::OsAndroid {

0 commit comments

Comments
 (0)