use core::marker::Sized;
use core::mem::size_of;
use core::mem;
-#[cfg(stage0)]
-use core::ops::{FnMut, FullRange};
-#[cfg(not(stage0))]
use core::ops::FnMut;
use core::option::Option::{self, Some, None};
use core::ptr::PtrExt;
use core::prelude::{Some, None, range, Clone};
use core::prelude::{Iterator, IteratorExt};
use core::prelude::{AsSlice};
- #[cfg(stage0)]
- use core::prelude::{Ord, FullRange};
- #[cfg(not(stage0))]
use core::prelude::Ord;
use core::default::Default;
use core::mem;
use core::iter::AdditiveIterator;
use core::iter::{Iterator, IteratorExt};
use core::ops::Index;
-#[cfg(stage0)]
-use core::ops::FullRange as RangeFull;
-#[cfg(stage0)]
-use core::ops::FullRange;
-#[cfg(not(stage0))]
use core::ops::RangeFull;
use core::option::Option::{self, Some, None};
use core::result::Result;
&self[][*index]
}
}
-#[cfg(stage0)]
-#[stable(feature = "rust1", since = "1.0.0")]
-impl ops::Index<ops::FullRange> for String {
- type Output = str;
- #[inline]
- fn index(&self, _index: &ops::FullRange) -> &str {
- unsafe { mem::transmute(self.vec.as_slice()) }
- }
-}
-#[cfg(not(stage0))]
#[stable(feature = "rust1", since = "1.0.0")]
impl ops::Index<ops::RangeFull> for String {
type Output = str;
use str::Utf8Error;
use core::iter::repeat;
use super::{as_string, CowString};
- #[cfg(stage0)]
- use core::ops::FullRange;
#[test]
fn test_as_string() {
self.as_slice().index(index)
}
}
-#[cfg(stage0)]
-#[stable(feature = "rust1", since = "1.0.0")]
-impl<T> ops::Index<ops::FullRange> for Vec<T> {
- type Output = [T];
- #[inline]
- fn index(&self, _index: &ops::FullRange) -> &[T] {
- self.as_slice()
- }
-}
-#[cfg(not(stage0))]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> ops::Index<ops::RangeFull> for Vec<T> {
type Output = [T];
self.as_mut_slice().index_mut(index)
}
}
-#[cfg(stage0)]
-#[stable(feature = "rust1", since = "1.0.0")]
-impl<T> ops::IndexMut<ops::FullRange> for Vec<T> {
- type Output = [T];
- #[inline]
- fn index_mut(&mut self, _index: &ops::FullRange) -> &mut [T] {
- self.as_mut_slice()
- }
-}
-#[cfg(not(stage0))]
#[stable(feature = "rust1", since = "1.0.0")]
impl<T> ops::IndexMut<ops::RangeFull> for Vec<T> {
type Output = [T];
use prelude::*;
use core::mem::size_of;
use core::iter::repeat;
- #[cfg(stage0)]
- use core::ops::FullRange;
use test::Bencher;
use super::as_vec;
use hash::{Hash, Hasher, self};
use iter::IntoIterator;
use marker::Copy;
-#[cfg(stage0)]
-use ops::{Deref, FullRange};
-#[cfg(not(stage0))]
use ops::Deref;
use option::Option;
use slice::{Iter, IterMut, SliceExt};
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(hidden)]
pub mod rt {
- #[cfg(stage0)] pub use self::v1::*;
pub mod v1;
}
}
}
- /// When using the format_args!() macro, this function is used to generate the
- /// Arguments structure.
- #[doc(hidden)] #[inline]
- #[cfg(stage0)]
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn new(pieces: &'a [&'a str],
- args: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
- Arguments {
- pieces: pieces,
- fmt: None,
- args: args
- }
- }
-
/// This function is used to specify nonstandard formatting parameters.
/// The `pieces` array must be at least as long as `fmt` to construct
/// a valid Arguments structure. Also, any `Count` within `fmt` that is
/// created with `argumentuint`. However, failing to do so doesn't cause
/// unsafety, but will ignore invalid .
#[doc(hidden)] #[inline]
- #[cfg(stage0)]
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn with_placeholders(pieces: &'a [&'a str],
- fmt: &'a [rt::v1::Argument],
- args: &'a [ArgumentV1<'a>]) -> Arguments<'a> {
- Arguments {
- pieces: pieces,
- fmt: Some(fmt),
- args: args
- }
- }
- /// This function is used to specify nonstandard formatting parameters.
- /// The `pieces` array must be at least as long as `fmt` to construct
- /// a valid Arguments structure. Also, any `Count` within `fmt` that is
- /// `CountIsParam` or `CountIsNextParam` has to point to an argument
- /// created with `argumentuint`. However, failing to do so doesn't cause
- /// unsafety, but will ignore invalid .
- #[doc(hidden)] #[inline]
- #[cfg(not(stage0))]
pub fn new_v1_formatted(pieces: &'a [&'a str],
args: &'a [ArgumentV1<'a>],
fmt: &'a [rt::v1::Argument]) -> Arguments<'a> {
}
}
-/// This is a function which calls are emitted to by the compiler itself to
-/// create the Argument structures that are passed into the `format` function.
-#[doc(hidden)] #[inline]
-#[cfg(stage0)]
-#[stable(feature = "rust1", since = "1.0.0")]
-pub fn argument<'a, T>(f: fn(&T, &mut Formatter) -> Result,
- t: &'a T) -> ArgumentV1<'a> {
- ArgumentV1::new(t, f)
-}
-
-/// When the compiler determines that the type of an argument *must* be a uint
-/// (such as for width and precision), then it invokes this method.
-#[doc(hidden)] #[inline]
-#[cfg(stage0)]
-#[stable(feature = "rust1", since = "1.0.0")]
-pub fn argumentuint<'a>(s: &'a uint) -> ArgumentV1<'a> {
- ArgumentV1::from_uint(s)
-}
-
// Implementations of the core formatting traits
macro_rules! fmt_refs {
#![stable(feature = "rust1", since = "1.0.0")]
-#[cfg(stage0)] pub use self::Position::*;
-
-#[cfg(stage0)] pub use self::Alignment::Left as AlignLeft;
-#[cfg(stage0)] pub use self::Alignment::Right as AlignRight;
-#[cfg(stage0)] pub use self::Alignment::Center as AlignCenter;
-#[cfg(stage0)] pub use self::Alignment::Unknown as AlignUnknown;
-#[cfg(stage0)] pub use self::Count::Is as CountIs;
-#[cfg(stage0)] pub use self::Count::Implied as CountImplied;
-#[cfg(stage0)] pub use self::Count::Param as CountIsParam;
-#[cfg(stage0)] pub use self::Count::NextParam as CountIsNextParam;
-#[cfg(stage0)] pub use self::Position::Next as ArgumentNext;
-#[cfg(stage0)] pub use self::Position::At as ArgumentIs;
-
#[derive(Copy)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Argument {
}
/// An unbounded range.
-#[cfg(stage0)]
-#[derive(Copy, Clone, PartialEq, Eq)]
-#[lang="full_range"]
-#[unstable(feature = "core", reason = "may be renamed to RangeFull")]
-pub struct FullRange;
-
-/// An unbounded range.
-#[cfg(not(stage0))]
#[derive(Copy, Clone, PartialEq, Eq)]
#[lang="range_full"]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct RangeFull;
-#[cfg(stage0)]
-#[stable(feature = "rust1", since = "1.0.0")]
-impl fmt::Debug for FullRange {
- fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
- fmt::Debug::fmt("..", fmt)
- }
-}
-
-#[cfg(not(stage0))]
#[stable(feature = "rust1", since = "1.0.0")]
impl fmt::Debug for RangeFull {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
// Reexported core operators
pub use marker::{Copy, Send, Sized, Sync};
-#[cfg(stage0)]
-pub use ops::{Drop, Fn, FnMut, FnOnce, FullRange};
-#[cfg(not(stage0))]
pub use ops::{Drop, Fn, FnMut, FnOnce};
// Reexported functions
use iter::*;
use num::Int;
use ops::{FnMut, self, Index};
-#[cfg(stage0)]
-use ops::FullRange as RangeFull;
-#[cfg(not(stage0))]
use ops::RangeFull;
use option::Option;
use option::Option::{None, Some};
}
}
-#[cfg(stage0)]
-#[unstable(feature = "core")]
-impl<'a, T> ops::Index<ops::FullRange> for Iter<'a, T> {
- type Output = [T];
- #[inline]
- fn index(&self, _index: &ops::FullRange) -> &[T] {
- self.as_slice()
- }
-}
-#[cfg(not(stage0))]
#[unstable(feature = "core")]
impl<'a, T> ops::Index<RangeFull> for Iter<'a, T> {
type Output = [T];
}
}
- #[cfg(stage0)]
- #[stable(feature = "rust1", since = "1.0.0")]
- impl ops::Index<ops::FullRange> for str {
- type Output = str;
- #[inline]
- fn index(&self, _index: &ops::FullRange) -> &str {
- self
- }
- }
- #[cfg(not(stage0))]
#[stable(feature = "rust1", since = "1.0.0")]
impl ops::Index<ops::RangeFull> for str {
type Output = str;
html_root_url = "http://doc.rust-lang.org/nightly/",
html_playground_url = "http://play.rust-lang.org/")]
-#![cfg_attr(stage0, feature(core))]
#![feature(int_uint)]
#![feature(slicing_syntax)]
#![feature(staged_api)]
}
}
-#[cfg(stage0)]
-impl ops::Index<ops::FullRange> for OsString {
- type Output = OsStr;
-
- #[inline]
- fn index(&self, _index: &ops::FullRange) -> &OsStr {
- unsafe { mem::transmute(self.inner.as_slice()) }
- }
-}
-
-#[cfg(not(stage0))]
impl ops::Index<ops::RangeFull> for OsString {
type Output = OsStr;
pub use core::fmt::Error;
pub use core::fmt::{ArgumentV1, Arguments, write, radix, Radix, RadixFmt};
-#[doc(hidden)]
-#[cfg(stage0)]
-pub use core::fmt::{argument, argumentuint};
-
/// The format function takes a precompiled format string and a list of
/// arguments, to return the resulting formatted string.
///
#![feature(staged_api)]
#![feature(unboxed_closures)]
#![feature(unicode)]
-#![cfg_attr(not(stage0), feature(macro_reexport))]
+#![feature(macro_reexport)]
#![cfg_attr(test, feature(test))]
// Don't link to std. We are std.
use iter::IteratorExt;
use option::Option;
use option::Option::{None, Some};
-#[cfg(stage0)]
-use ops::FullRange;
use str;
use str::StrExt;
use string::{String, CowString};
use iter::{Iterator, IteratorExt, Map, repeat};
use mem;
use option::Option::{self, Some, None};
-#[cfg(stage0)]
-use ops::FullRange;
use result::Result::{self, Ok, Err};
use slice::{SliceExt, SliceConcatExt};
use str::{SplitTerminator, FromStr, StrExt};
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)] pub use ops::{Drop, Fn, FnMut, FnOnce};
-#[cfg(stage0)]
-#[unstable(feature = "std_misc")]
-#[doc(no_inline)] pub use ops::FullRange;
-
// Reexported functions
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(no_inline)] pub use mem::drop;
// An uninlined, unmangled function upon which to slap yer breakpoints
#[inline(never)]
#[no_mangle]
-#[cfg_attr(not(stage0), allow(private_no_mangle_fns))]
+#[allow(private_no_mangle_fns)]
fn rust_panic(cause: Box<Any + Send>) -> ! {
rtdebug!("begin_unwind()");
#[lang="eh_personality"]
#[no_mangle] // referenced from rust_try.ll
- #[cfg_attr(not(stage0), allow(private_no_mangle_fns))]
+ #[allow(private_no_mangle_fns)]
extern fn rust_eh_personality(
version: c_int,
actions: uw::_Unwind_Action,
}
}
-#[cfg(stage0)]
-impl ops::Index<ops::FullRange> for Wtf8 {
- type Output = Wtf8;
-
- #[inline]
- fn index(&self, _range: &ops::FullRange) -> &Wtf8 {
- self
- }
-}
-
-#[cfg(not(stage0))]
impl ops::Index<ops::RangeFull> for Wtf8 {
type Output = Wtf8;
+S 2015-01-31 474b324
+ freebsd-x86_64 c5b55eb488790ff8425d74afa3b37c49517bc55f
+ linux-i386 319f2f3573c058cb2c4dfc75faaf8ea3ae86ef11
+ linux-x86_64 7e71108be890adfecc7644ab6ad183e8a657dc97
+ macos-i386 b0b2676681c6d8ec8cb85700428555761c7bdbb8
+ macos-x86_64 381dd1587920388e2f71e120a1eabac2648d9672
+ winnt-i386 5f99509f88355437824a746f7f90fc22233edb9b
+ winnt-x86_64 382aa20518b1a19d374f06a038025619ba00b77d
+
S 2015-01-28 a45e117
freebsd-x86_64 08a3ce7331fd1a52466acc0598cf745a009f86f6
linux-i386 66e36a3461c12e2102a7f7f241d1b0e242c704d0