Skip to content

Commit 651f6b9

Browse files
committed
---
yaml --- r: 81737 b: refs/heads/master c: 55f528f h: refs/heads/master i: 81735: 2e3966e v: v3
1 parent 48e7800 commit 651f6b9

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: db78fdc10c0cf6c02005c0b8daefe9cf47aa806f
2+
refs/heads/master: 55f528f5af84769b178dd0ff075d1c1fa2329f5a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/src/libstd/util.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,6 @@ pub fn id<T>(x: T) -> T { x }
2323
#[inline]
2424
pub fn ignore<T>(_x: T) { }
2525

26-
/// Sets `*ptr` to `new_value`, invokes `op()`, and then restores the
27-
/// original value of `*ptr`.
28-
///
29-
/// NB: This function accepts `@mut T` and not `&mut T` to avoid
30-
/// an obvious borrowck hazard. Typically passing in `&mut T` will
31-
/// cause borrow check errors because it freezes whatever location
32-
/// that `&mut T` is stored in (either statically or dynamically).
33-
#[inline]
34-
pub fn with<T,R>(
35-
ptr: @mut T,
36-
value: T,
37-
op: &fn() -> R) -> R
38-
{
39-
let prev = replace(ptr, value);
40-
let result = op();
41-
*ptr = prev;
42-
return result;
43-
}
44-
4526
/**
4627
* Swap the values at two mutable locations of the same type, without
4728
* deinitialising or copying either one.

0 commit comments

Comments
 (0)