about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-30 11:00:05 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-31 15:49:57 -0700
commitd4a2c941809f303b97d153e06ba07e95cd245f88 (patch)
treef876f056ff60aeac3f0098deb2dbe1fabfd13091 /src/test/compile-fail
parentd754722a04b99fdcae0fd97fa2a4395521145ef2 (diff)
downloadrust-d4a2c941809f303b97d153e06ba07e95cd245f88.tar.gz
rust-d4a2c941809f303b97d153e06ba07e95cd245f88.zip
std: Clean out #[deprecated] APIs
This commit cleans out a large amount of deprecated APIs from the standard
library and some of the facade crates as well, updating all users in the
compiler and in tests as it goes along.
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/dropck_arr_cycle_checked.rs4
-rw-r--r--src/test/compile-fail/dropck_tarena_cycle_checked.rs4
-rw-r--r--src/test/compile-fail/dropck_vec_cycle_checked.rs4
-rw-r--r--src/test/compile-fail/estr-subtyping.rs2
-rw-r--r--src/test/compile-fail/issue-13058.rs4
-rw-r--r--src/test/compile-fail/issue-17651.rs2
-rw-r--r--src/test/compile-fail/lifetime-inference-give-expl-lifetime-param-2.rs4
-rw-r--r--src/test/compile-fail/variance-deprecated-markers.rs35
-rw-r--r--src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs4
-rw-r--r--src/test/compile-fail/vec_refs_data_with_early_death.rs2
10 files changed, 15 insertions, 50 deletions
diff --git a/src/test/compile-fail/dropck_arr_cycle_checked.rs b/src/test/compile-fail/dropck_arr_cycle_checked.rs
index 3aa2fae2826..40d992fe21f 100644
--- a/src/test/compile-fail/dropck_arr_cycle_checked.rs
+++ b/src/test/compile-fail/dropck_arr_cycle_checked.rs
@@ -20,9 +20,9 @@ use id::Id;
 
 mod s {
     #![allow(unstable)]
-    use std::sync::atomic::{AtomicUint, ATOMIC_UINT_INIT, Ordering};
+    use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
 
-    static S_COUNT: AtomicUint = ATOMIC_UINT_INIT;
+    static S_COUNT: AtomicUsize = ATOMIC_USIZE_INIT;
 
     pub fn next_count() -> usize {
         S_COUNT.fetch_add(1, Ordering::SeqCst) + 1
diff --git a/src/test/compile-fail/dropck_tarena_cycle_checked.rs b/src/test/compile-fail/dropck_tarena_cycle_checked.rs
index 74e3c724b67..9488882ca94 100644
--- a/src/test/compile-fail/dropck_tarena_cycle_checked.rs
+++ b/src/test/compile-fail/dropck_tarena_cycle_checked.rs
@@ -27,9 +27,9 @@ use id::Id;
 
 mod s {
     #![allow(unstable)]
-    use std::sync::atomic::{AtomicUint, ATOMIC_UINT_INIT, Ordering};
+    use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
 
-    static S_COUNT: AtomicUint = ATOMIC_UINT_INIT;
+    static S_COUNT: AtomicUsize = ATOMIC_USIZE_INIT;
 
     pub fn next_count() -> usize {
         S_COUNT.fetch_add(1, Ordering::SeqCst) + 1
diff --git a/src/test/compile-fail/dropck_vec_cycle_checked.rs b/src/test/compile-fail/dropck_vec_cycle_checked.rs
index 3f69c7d1a9c..9d92552244f 100644
--- a/src/test/compile-fail/dropck_vec_cycle_checked.rs
+++ b/src/test/compile-fail/dropck_vec_cycle_checked.rs
@@ -19,9 +19,9 @@ use id::Id;
 
 mod s {
     #![allow(unstable)]
-    use std::sync::atomic::{AtomicUint, ATOMIC_UINT_INIT, Ordering};
+    use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
 
-    static S_COUNT: AtomicUint = ATOMIC_UINT_INIT;
+    static S_COUNT: AtomicUsize = ATOMIC_USIZE_INIT;
 
     pub fn next_count() -> usize {
         S_COUNT.fetch_add(1, Ordering::SeqCst) + 1
diff --git a/src/test/compile-fail/estr-subtyping.rs b/src/test/compile-fail/estr-subtyping.rs
index 6e64e01d741..b5c6db0cea9 100644
--- a/src/test/compile-fail/estr-subtyping.rs
+++ b/src/test/compile-fail/estr-subtyping.rs
@@ -18,7 +18,7 @@ fn has_uniq(x: String) {
 
 fn has_slice(x: &str) {
    wants_uniq(x); //~ ERROR mismatched types
-   wants_slice(x.as_slice());
+   wants_slice(x);
 }
 
 fn main() {
diff --git a/src/test/compile-fail/issue-13058.rs b/src/test/compile-fail/issue-13058.rs
index 50c4ac94d90..8886dd80be5 100644
--- a/src/test/compile-fail/issue-13058.rs
+++ b/src/test/compile-fail/issue-13058.rs
@@ -8,14 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::iter::{Range,range};
+use std::ops::Range;
 
 trait Itble<'r, T, I: Iterator<Item=T>> { fn iter(&'r self) -> I; }
 
 impl<'r> Itble<'r, usize, Range<usize>> for (usize, usize) {
     fn iter(&'r self) -> Range<usize> {
         let &(min, max) = self;
-        range(min, max)
+        min..max
     }
 }
 
diff --git a/src/test/compile-fail/issue-17651.rs b/src/test/compile-fail/issue-17651.rs
index 8ebf80a8db0..9e49abc463f 100644
--- a/src/test/compile-fail/issue-17651.rs
+++ b/src/test/compile-fail/issue-17651.rs
@@ -13,6 +13,6 @@
 
 fn main() {
     // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
-    (|| Box::new(*[0].as_slice()))();
+    (|| Box::new(*(&[0][..])))();
     //~^ ERROR the trait `core::marker::Sized` is not implemented for the type `[_]`
 }
diff --git a/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param-2.rs b/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param-2.rs
index 0a8e4514b43..d2d0dbf3e98 100644
--- a/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param-2.rs
+++ b/src/test/compile-fail/lifetime-inference-give-expl-lifetime-param-2.rs
@@ -10,14 +10,14 @@
 
 // ignore-tidy-linelength
 
-use std::iter::{Range,range};
+use std::ops::Range;
 
 trait Itble<'r, T, I: Iterator<Item=T>> { fn iter(&'r self) -> I; }
 
 impl<'r> Itble<'r, usize, Range<usize>> for (usize, usize) {
     fn iter(&'r self) -> Range<usize> {
         let &(min, max) = self;
-        range(min, max)
+        min..max
     }
 }
 
diff --git a/src/test/compile-fail/variance-deprecated-markers.rs b/src/test/compile-fail/variance-deprecated-markers.rs
deleted file mode 100644
index 8f9d24cb132..00000000000
--- a/src/test/compile-fail/variance-deprecated-markers.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test that the deprecated markers still have their old effect.
-
-#![feature(rustc_attrs)]
-
-use std::marker;
-
-#[rustc_variance]
-struct A<T>(marker::CovariantType<T>); //~ ERROR types=[[+];[];[]]
-
-#[rustc_variance]
-struct B<T>(marker::ContravariantType<T>); //~ ERROR types=[[-];[];[]]
-
-#[rustc_variance]
-struct C<T>(marker::InvariantType<T>); //~ ERROR types=[[o];[];[]]
-
-#[rustc_variance]
-struct D<'a>(marker::CovariantLifetime<'a>); //~ ERROR regions=[[+];[];[]]
-
-#[rustc_variance]
-struct E<'a>(marker::ContravariantLifetime<'a>); //~ ERROR regions=[[-];[];[]]
-
-#[rustc_variance]
-struct F<'a>(marker::InvariantLifetime<'a>); //~ ERROR regions=[[o];[];[]]
-
-fn main() { }
diff --git a/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs b/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs
index 6aaf51278af..44a3f716e3e 100644
--- a/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs
+++ b/src/test/compile-fail/vec-must-not-hide-type-from-dropck.rs
@@ -30,9 +30,9 @@ use id::Id;
 
 mod s {
     #![allow(unstable)]
-    use std::sync::atomic::{AtomicUint, ATOMIC_UINT_INIT, Ordering};
+    use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
 
-    static S_COUNT: AtomicUint = ATOMIC_UINT_INIT;
+    static S_COUNT: AtomicUsize = ATOMIC_USIZE_INIT;
 
     /// generates globally unique count (global across the current
     /// process, that is)
diff --git a/src/test/compile-fail/vec_refs_data_with_early_death.rs b/src/test/compile-fail/vec_refs_data_with_early_death.rs
index a191b3e56c4..0025449a3db 100644
--- a/src/test/compile-fail/vec_refs_data_with_early_death.rs
+++ b/src/test/compile-fail/vec_refs_data_with_early_death.rs
@@ -27,5 +27,5 @@ fn main() {
     v.push(&x); //~ ERROR `x` does not live long enough
     v.push(&y); //~ ERROR `y` does not live long enough
 
-    assert_eq!(v.as_slice(), [&3, &4]);
+    assert_eq!(v, [&3, &4]);
 }