about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-01-17 17:25:47 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-01-17 17:25:47 +0530
commit80e21d1958b4dd04687cac101dc19db95d8e85d5 (patch)
treea477606b125c9cc98f42dd94faef7c6f0b115611 /src/test
parentfbf3e96e56677d64711ee5bbe925dd447c73f167 (diff)
parent9a4f43b9b6558ab74b3e849a7770dc193bc1847b (diff)
downloadrust-80e21d1958b4dd04687cac101dc19db95d8e85d5.tar.gz
rust-80e21d1958b4dd04687cac101dc19db95d8e85d5.zip
Rollup merge of #30943 - alexcrichton:stabilize-1.7, r=aturon
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_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/test')
-rw-r--r--src/test/compile-fail/lint-exceeding-bitshifts.rs11
-rw-r--r--src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs6
2 files changed, 11 insertions, 6 deletions
diff --git a/src/test/compile-fail/lint-exceeding-bitshifts.rs b/src/test/compile-fail/lint-exceeding-bitshifts.rs
index ce1406e8010..e1ed21877c9 100644
--- a/src/test/compile-fail/lint-exceeding-bitshifts.rs
+++ b/src/test/compile-fail/lint-exceeding-bitshifts.rs
@@ -11,7 +11,7 @@
 #![deny(exceeding_bitshifts)]
 #![allow(unused_variables)]
 #![allow(dead_code)]
-#![feature(num_bits_bytes, const_indexing)]
+#![feature(const_indexing)]
 
 fn main() {
       let n = 1u8 << 7;
@@ -57,8 +57,13 @@ fn main() {
       let n = 1u8 << (4+3);
       let n = 1u8 << (4+4); //~ ERROR: bitshift exceeds the type's number of bits
 
-      let n = 1_isize << std::isize::BITS; //~ ERROR: bitshift exceeds the type's number of bits
-      let n = 1_usize << std::usize::BITS; //~ ERROR: bitshift exceeds the type's number of bits
+      #[cfg(target_pointer_width = "32")]
+      const BITS: usize = 32;
+      #[cfg(target_pointer_width = "64")]
+      const BITS: usize = 64;
+
+      let n = 1_isize << BITS; //~ ERROR: bitshift exceeds the type's number of bits
+      let n = 1_usize << BITS; //~ ERROR: bitshift exceeds the type's number of bits
 
 
       let n = 1i8<<(1isize+-1);
diff --git a/src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs b/src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs
index 562cfbe7a14..c729f736115 100644
--- a/src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs
+++ b/src/test/run-pass/method-mut-self-modifies-mut-slice-lvalue.rs
@@ -12,9 +12,8 @@
 // type is `&mut [u8]`, passes in a pointer to the lvalue and not a
 // temporary. Issue #19147.
 
-#![feature(clone_from_slice)]
-
 use std::slice;
+use std::cmp;
 
 trait MyWriter {
     fn my_write(&mut self, buf: &[u8]) -> Result<(), ()>;
@@ -22,7 +21,8 @@ trait MyWriter {
 
 impl<'a> MyWriter for &'a mut [u8] {
     fn my_write(&mut self, buf: &[u8]) -> Result<(), ()> {
-        self.clone_from_slice(buf);
+        let amt = cmp::min(self.len(), buf.len());
+        self[..amt].clone_from_slice(&buf[..amt]);
 
         let write_len = buf.len();
         unsafe {