File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 9c68679f2ebd5b165694e9346e4ad96a3e32aceb
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 6faa4f33a42de32579e02a8d030db920d360e2b5
5
- refs/heads/try: 8bfbcddf5382ab156b442b08f3236800d0b6ccd8
5
+ refs/heads/try: 0c73e5fc5f212d30bb46b96cb45b51251217a199
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
Original file line number Diff line number Diff line change @@ -1618,6 +1618,19 @@ pub struct MoveItems<T> {
1618
1618
iter : Items < ' static , T >
1619
1619
}
1620
1620
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
+
1621
1634
impl < T > Iterator < T > for MoveItems < T > {
1622
1635
#[ inline]
1623
1636
fn next < ' a > ( & ' a mut self ) -> Option < T > {
@@ -2016,6 +2029,18 @@ mod tests {
2016
2029
assert_eq ! ( vec. swap_remove( 0 ) , None ) ;
2017
2030
}
2018
2031
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
+
2019
2044
#[ bench]
2020
2045
fn bench_new ( b : & mut Bencher ) {
2021
2046
b. iter ( || {
Original file line number Diff line number Diff line change @@ -1015,6 +1015,12 @@ fn link_args(cmd: &mut Command,
1015
1015
1016
1016
// Mark all dynamic libraries and executables as compatible with ASLR
1017
1017
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
+ }
1018
1024
}
1019
1025
1020
1026
if sess. targ_cfg . os == abi:: OsAndroid {
You can’t perform that action at this time.
0 commit comments