Skip to content

Commit d0b87be

Browse files
committed
---
yaml --- r: 62747 b: refs/heads/snap-stage3 c: c9c4d92 h: refs/heads/master i: 62745: 1d11303 62743: 149fcac v: v3
1 parent fc48a9c commit d0b87be

File tree

3 files changed

+25
-52
lines changed

3 files changed

+25
-52
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 77de84b4f629b63c784903ed7cc08c024b10496b
4+
refs/heads/snap-stage3: c9c4d92889ed1b147368a31127c0aa2e4db76cd5
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libextra/deque.rs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -125,31 +125,6 @@ pub impl<T> Deque<T> {
125125
self.hi = (self.hi + 1u) % self.elts.len();
126126
self.nelts += 1u;
127127
}
128-
129-
/// Reserve capacity for exactly `n` elements in the given deque,
130-
/// doing nothing if `self`'s capacity is already equal to or greater
131-
/// than the requested capacity
132-
///
133-
/// # Arguments
134-
///
135-
/// * n - The number of elements to reserve space for
136-
fn reserve(&mut self, n: uint) {
137-
vec::reserve(&mut self.elts, n);
138-
}
139-
140-
/// Reserve capacity for at least `n` elements in the given deque,
141-
/// over-allocating in case the caller needs to reserve additional
142-
/// space.
143-
///
144-
/// Do nothing if `self`'s capacity is already equal to or greater
145-
/// than the requested capacity.
146-
///
147-
/// # Arguments
148-
///
149-
/// * n - The number of elements to reserve space for
150-
fn reserve_at_least(&mut self, n: uint) {
151-
vec::reserve_at_least(&mut self.elts, n);
152-
}
153128
}
154129

155130
/// Grow is only called on full elts, so nelts is also len(elts), unlike
@@ -174,7 +149,6 @@ mod tests {
174149
use super::*;
175150
use core::cmp::Eq;
176151
use core::kinds::Copy;
177-
use core::vec::capacity;
178152

179153
#[test]
180154
fn test_simple() {
@@ -354,29 +328,4 @@ mod tests {
354328
}
355329

356330
}
357-
358-
#[test]
359-
fn test_reserve() {
360-
let mut d = Deque::new();
361-
d.add_back(0u64);
362-
d.reserve(50);
363-
assert_eq!(capacity(&mut d.elts), 50);
364-
let mut d = Deque::new();
365-
d.add_back(0u32);
366-
d.reserve(50);
367-
assert_eq!(capacity(&mut d.elts), 50);
368-
}
369-
370-
#[test]
371-
fn test_reserve_at_least() {
372-
let mut d = Deque::new();
373-
d.add_back(0u64);
374-
d.reserve_at_least(50);
375-
assert_eq!(capacity(&mut d.elts), 64);
376-
let mut d = Deque::new();
377-
d.add_back(0u32);
378-
d.reserve_at_least(50);
379-
assert_eq!(capacity(&mut d.elts), 64);
380-
}
381-
382331
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//xfail-test
2+
3+
// Creating a stack closure which references an owned pointer and then
4+
// transferring ownership of the owned box before invoking the stack
5+
// closure results in a crash.
6+
7+
fn twice(x: ~uint) -> uint
8+
{
9+
*x * 2
10+
}
11+
12+
fn invoke(f : &fn() -> uint)
13+
{
14+
f();
15+
}
16+
17+
fn main()
18+
{
19+
let x : ~uint = ~9;
20+
let sq : &fn() -> uint = || { *x * *x };
21+
22+
twice(x);
23+
invoke(sq);
24+
}

0 commit comments

Comments
 (0)