From cfc779190041e25505552a1013a364202255c203 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sun, 1 Feb 2015 18:33:13 -0800 Subject: [PATCH 1/2] std: Add some missing stability attributes * Display::fmt is stable * Debug::fmt is stable * FromIterator::from_iter is stable * Peekable::peek is stable --- src/libcore/fmt/mod.rs | 2 ++ src/libcore/iter.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 2ff67ebd550ab..3abf55a8f9050 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -298,6 +298,7 @@ pub trait Show { #[lang = "debug_trait"] pub trait Debug { /// Formats the value using the given formatter. + #[stable(feature = "rust1", since = "1.0.0")] fn fmt(&self, &mut Formatter) -> Result; } @@ -324,6 +325,7 @@ pub trait String { #[stable(feature = "rust1", since = "1.0.0")] pub trait Display { /// Formats the value using the given formatter. + #[stable(feature = "rust1", since = "1.0.0")] fn fmt(&self, &mut Formatter) -> Result; } diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index c782452d4cfca..b8f26ded6b3af 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -119,6 +119,7 @@ impl<'a, T> Iterator for &'a mut (Iterator + 'a) { built from an iterator over elements of type `{A}`"] pub trait FromIterator { /// Build a container with elements from an external iterator. + #[stable(feature = "rust1", since = "1.0.0")] fn from_iter>(iterator: T) -> Self; } @@ -1866,6 +1867,7 @@ impl Peekable where I: Iterator { /// Return a reference to the next element of the iterator with out advancing it, /// or None if the iterator is exhausted. #[inline] + #[stable(feature = "rust1", since = "1.0.0")] pub fn peek(&mut self) -> Option<&T> { if self.peeked.is_none() { self.peeked = self.iter.next(); From 2d788224f213a6d1a96a248838d280fd7e32b2e9 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sun, 1 Feb 2015 18:33:55 -0800 Subject: [PATCH 2/2] std: Mark the `IntoIterator` trait as stable This commit marks the trait `IntoIterator` as well as the associated type `Iter` and method `into_iter` all as stable. --- src/libcore/iter.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index b8f26ded6b3af..459256fd8f8ac 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -124,10 +124,13 @@ pub trait FromIterator { } /// Conversion into an `Iterator` +#[stable(feature = "rust1", since = "1.0.0")] pub trait IntoIterator { + #[stable(feature = "rust1", since = "1.0.0")] type Iter: Iterator; /// Consumes `Self` and returns an iterator over it + #[stable(feature = "rust1", since = "1.0.0")] fn into_iter(self) -> Self::Iter; }