diff options
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/iter.rs | 2 | ||||
| -rw-r--r-- | src/libcore/ops.rs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index da7f026aed4..89b2f9cc853 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -2185,7 +2185,7 @@ pub type Iterate<'a, T> = Unfold<'a, T, IterateState<'a, T>>; /// Creates a new iterator that produces an infinite sequence of /// repeated applications of the given function `f`. #[allow(visible_private_types)] -pub fn iterate<'a, T: Clone>(f: |T|: 'a -> T, seed: T) -> Iterate<'a, T> { +pub fn iterate<'a, T: Clone>(seed: T, f: |T|: 'a -> T) -> Iterate<'a, T> { Unfold::new((f, Some(seed), true), |st| { let &(ref mut f, ref mut val, ref mut first) = st; if *first { diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 836285bc313..94febf03635 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -55,6 +55,8 @@ * */ +use kinds::Sized; + /** * * The `Drop` trait is used to run some code when a value goes out of scope. This @@ -700,7 +702,7 @@ pub trait IndexMut<Index,Result> { * ``` */ #[lang="deref"] -pub trait Deref<Result> { +pub trait Deref<Sized? Result> { /// The method called to dereference a value fn deref<'a>(&'a self) -> &'a Result; } @@ -740,7 +742,7 @@ pub trait Deref<Result> { * ``` */ #[lang="deref_mut"] -pub trait DerefMut<Result>: Deref<Result> { +pub trait DerefMut<Sized? Result>: Deref<Result> { /// The method called to mutably dereference a value fn deref_mut<'a>(&'a mut self) -> &'a mut Result; } |
