about summary refs log tree commit diff
path: root/src/libcore/fmt
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-01-15 10:07:52 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-01-16 11:03:10 -0800
commit9a4f43b9b6558ab74b3e849a7770dc193bc1847b (patch)
tree2bd3ab2adb8e8312ad3384b108f2ae8e1b589055 /src/libcore/fmt
parentc14b615534ebcd5667f594c86d18eebff6afc7cb (diff)
std: Stabilize APIs for the 1.7 release
This commit stabilizes and deprecates the FCP (final comment period) APIs for
the upcoming 1.7 beta release. The specific APIs which changed were:

Stabilized

* `Path::strip_prefix` (renamed from `relative_from`)
* `path::StripPrefixError` (new error type returned from `strip_prefix`)
* `Ipv4Addr::is_loopback`
* `Ipv4Addr::is_private`
* `Ipv4Addr::is_link_local`
* `Ipv4Addr::is_multicast`
* `Ipv4Addr::is_broadcast`
* `Ipv4Addr::is_documentation`
* `Ipv6Addr::is_unspecified`
* `Ipv6Addr::is_loopback`
* `Ipv6Addr::is_unique_local`
* `Ipv6Addr::is_multicast`
* `Vec::as_slice`
* `Vec::as_mut_slice`
* `String::as_str`
* `String::as_mut_str`
* `<[T]>::clone_from_slice` - the `usize` return value is removed
* `<[T]>::sort_by_key`
* `i32::checked_rem` (and other signed types)
* `i32::checked_neg` (and other signed types)
* `i32::checked_shl` (and other signed types)
* `i32::checked_shr` (and other signed types)
* `i32::saturating_mul` (and other signed types)
* `i32::overflowing_add` (and other signed types)
* `i32::overflowing_sub` (and other signed types)
* `i32::overflowing_mul` (and other signed types)
* `i32::overflowing_div` (and other signed types)
* `i32::overflowing_rem` (and other signed types)
* `i32::overflowing_neg` (and other signed types)
* `i32::overflowing_shl` (and other signed types)
* `i32::overflowing_shr` (and other signed types)
* `u32::checked_rem` (and other unsigned types)
* `u32::checked_neg` (and other unsigned types)
* `u32::checked_shl` (and other unsigned types)
* `u32::saturating_mul` (and other unsigned types)
* `u32::overflowing_add` (and other unsigned types)
* `u32::overflowing_sub` (and other unsigned types)
* `u32::overflowing_mul` (and other unsigned types)
* `u32::overflowing_div` (and other unsigned types)
* `u32::overflowing_rem` (and other unsigned types)
* `u32::overflowing_neg` (and other unsigned types)
* `u32::overflowing_shl` (and other unsigned types)
* `u32::overflowing_shr` (and other unsigned types)
* `ffi::IntoStringError`
* `CString::into_string`
* `CString::into_bytes`
* `CString::into_bytes_with_nul`
* `From<CString> for Vec<u8>`
* `From<CString> for Vec<u8>`
* `IntoStringError::into_cstring`
* `IntoStringError::utf8_error`
* `Error for IntoStringError`

Deprecated

* `Path::relative_from` - renamed to `strip_prefix`
* `Path::prefix` - use `components().next()` instead
* `os::unix::fs` constants - moved to the `libc` crate
* `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize
* `IntoCow` - conflicts with `Into` and may come back later
* `i32::{BITS, BYTES}` (and other integers) - not pulling their weight
* `DebugTuple::formatter` - will be removed
* `sync::Semaphore` - not used enough and confused with system semaphores

Closes #23284
cc #27709 (still lots more methods though)
Closes #27712
Closes #27722
Closes #27728
Closes #27735
Closes #27729
Closes #27755
Closes #27782
Closes #27798
Diffstat (limited to 'src/libcore/fmt')
-rw-r--r--src/libcore/fmt/builders.rs1
-rw-r--r--src/libcore/fmt/mod.rs10
-rw-r--r--src/libcore/fmt/num.rs5
3 files changed, 14 insertions, 2 deletions
diff --git a/src/libcore/fmt/builders.rs b/src/libcore/fmt/builders.rs
index 0d4c0bb6480..7c986131a52 100644
--- a/src/libcore/fmt/builders.rs
+++ b/src/libcore/fmt/builders.rs
@@ -181,6 +181,7 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
     /// Returns the wrapped `Formatter`.
     #[unstable(feature = "debug_builder_formatter", reason = "recently added",
                issue = "27782")]
+    #[rustc_deprecated(since = "1.7.0", reason = "will be removed")]
     pub fn formatter(&mut self) -> &mut fmt::Formatter<'b> {
         &mut self.fmt
     }
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index e2c7579a2b2..37f03d731dc 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -25,10 +25,16 @@ use str;
 use self::rt::v1::Alignment;
 
 #[unstable(feature = "fmt_radix", issue = "27728")]
+#[rustc_deprecated(since = "1.7.0", reason = "not used enough to stabilize")]
+#[allow(deprecated)]
 pub use self::num::radix;
 #[unstable(feature = "fmt_radix", issue = "27728")]
+#[rustc_deprecated(since = "1.7.0", reason = "not used enough to stabilize")]
+#[allow(deprecated)]
 pub use self::num::Radix;
 #[unstable(feature = "fmt_radix", issue = "27728")]
+#[rustc_deprecated(since = "1.7.0", reason = "not used enough to stabilize")]
+#[allow(deprecated)]
 pub use self::num::RadixFmt;
 #[stable(feature = "debug_builders", since = "1.2.0")]
 pub use self::builders::{DebugStruct, DebugTuple, DebugSet, DebugList, DebugMap};
@@ -1391,7 +1397,7 @@ impl<T> Pointer for *const T {
             f.flags |= 1 << (FlagV1::SignAwareZeroPad as u32);
 
             if let None = f.width {
-                f.width = Some((::usize::BITS/4) + 2);
+                f.width = Some(((mem::size_of::<usize>() * 8) / 4) + 2);
             }
         }
         f.flags |= 1 << (FlagV1::Alternate as u32);
@@ -1532,7 +1538,7 @@ macro_rules! tuple {
     ( $($name:ident,)+ ) => (
         #[stable(feature = "rust1", since = "1.0.0")]
         impl<$($name:Debug),*> Debug for ($($name,)*) {
-            #[allow(non_snake_case, unused_assignments)]
+            #[allow(non_snake_case, unused_assignments, deprecated)]
             fn fmt(&self, f: &mut Formatter) -> Result {
                 let mut builder = f.debug_tuple("");
                 let ($(ref $name,)*) = *self;
diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs
index fa085ec19e6..263e03dcc78 100644
--- a/src/libcore/fmt/num.rs
+++ b/src/libcore/fmt/num.rs
@@ -10,6 +10,8 @@
 
 //! Integer and floating-point number formatting
 
+#![allow(deprecated)]
+
 // FIXME: #6220 Implement floating point formatting
 
 use prelude::v1::*;
@@ -143,6 +145,7 @@ radix! { UpperHex, 16, "0x", x @  0 ...  9 => b'0' + x,
 #[unstable(feature = "fmt_radix",
            reason = "may be renamed or move to a different module",
            issue = "27728")]
+#[rustc_deprecated(since = "1.7.0", reason = "not used enough to stabilize")]
 pub struct Radix {
     base: u8,
 }
@@ -173,6 +176,7 @@ impl GenericRadix for Radix {
 #[unstable(feature = "fmt_radix",
            reason = "may be renamed or move to a different module",
            issue = "27728")]
+#[rustc_deprecated(since = "1.7.0", reason = "not used enough to stabilize")]
 #[derive(Copy, Clone)]
 pub struct RadixFmt<T, R>(T, R);
 
@@ -189,6 +193,7 @@ pub struct RadixFmt<T, R>(T, R);
 #[unstable(feature = "fmt_radix",
            reason = "may be renamed or move to a different module",
            issue = "27728")]
+#[rustc_deprecated(since = "1.7.0", reason = "not used enough to stabilize")]
 pub fn radix<T>(x: T, base: u8) -> RadixFmt<T, Radix> {
     RadixFmt(x, Radix::new(base))
 }