diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-10-02 11:37:37 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-10-02 14:31:39 -0700 |
| commit | f78cdcb6364cf938bfeb71da0c7eca62e257d537 (patch) | |
| tree | cb3f93224e4757b5f77709e576ca6f24ce0981ec /src/libcore/util.rs | |
| parent | a5042d58ee86af13b6910fa1884b7c1fe9423ae7 (diff) | |
| download | rust-f78cdcb6364cf938bfeb71da0c7eca62e257d537.tar.gz rust-f78cdcb6364cf938bfeb71da0c7eca62e257d537.zip | |
Removing explicit uses of + mode
This removes most explicit uses of the + argument mode. Pending a snapshot, I had to remove the forbid(deprecated_modes) pragma from a bunch of files. I'll put it back! + mode still has to be used in a few places for functions that get moved (see task.rs) The changes outside core and std are due to the to_bytes trait and making the compiler (with legacy modes on) agree with the libraries (with legacy modes off) about modes.
Diffstat (limited to 'src/libcore/util.rs')
| -rw-r--r-- | src/libcore/util.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libcore/util.rs b/src/libcore/util.rs index 9ba8b52f5da..aa1fe14ba88 100644 --- a/src/libcore/util.rs +++ b/src/libcore/util.rs @@ -5,25 +5,25 @@ Miscellaneous helpers for common patterns. */ // NB: transitionary, de-mode-ing. -#[forbid(deprecated_mode)]; +// tjc: re-forbid deprecated modes after snapshot #[forbid(deprecated_pattern)]; use cmp::Eq; /// The identity function. #[inline(always)] -pub pure fn id<T>(+x: T) -> T { move x } +pub pure fn id<T>(x: T) -> T { move x } /// Ignores a value. #[inline(always)] -pub pure fn ignore<T>(+_x: T) { } +pub pure fn ignore<T>(_x: T) { } /// Sets `*ptr` to `new_value`, invokes `op()`, and then restores the /// original value of `*ptr`. #[inline(always)] pub fn with<T: Copy, R>( ptr: &mut T, - +new_value: T, + new_value: T, op: &fn() -> R) -> R { // NDM: if swap operator were defined somewhat differently, @@ -50,7 +50,7 @@ pub fn swap<T>(x: &mut T, y: &mut T) { * value, without deinitialising or copying either one. */ #[inline(always)] -pub fn replace<T>(dest: &mut T, +src: T) -> T { +pub fn replace<T>(dest: &mut T, src: T) -> T { let mut tmp <- src; swap(dest, &mut tmp); move tmp |
