summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-13 22:26:35 -0700
committerbors <bors@rust-lang.org>2014-03-13 22:26:35 -0700
commitb35e8fbfcb1ddf613184dbd512f1c896d99c77c9 (patch)
tree414de2b960bd9508b33deaebe14588d1ed76d37b /src/test/compile-fail
parent4443fb3cfa945cf7cb791cf8f2ec81b7faf25132 (diff)
parentadc357abe6de869159a6268dc14709a4dd19e008 (diff)
downloadrust-b35e8fbfcb1ddf613184dbd512f1c896d99c77c9.tar.gz
rust-b35e8fbfcb1ddf613184dbd512f1c896d99c77c9.zip
auto merge of #12861 : huonw/rust/lint-owned-vecs, r=thestinger
lint: add lint for use of a `~[T]`.

This is useless at the moment (since pretty much every crate uses
`~[]`), but should help avoid regressions once completely removed from a
crate.
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/issue-2150.rs1
-rw-r--r--src/test/compile-fail/issue-8727.rs1
-rw-r--r--src/test/compile-fail/lint-deprecated-owned-vector.rs17
-rw-r--r--src/test/compile-fail/lint-heap-memory.rs1
-rw-r--r--src/test/compile-fail/lint-unused-imports.rs1
-rw-r--r--src/test/compile-fail/lint-unused-mut-variables.rs1
-rw-r--r--src/test/compile-fail/lint-unused-unsafe.rs1
7 files changed, 23 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-2150.rs b/src/test/compile-fail/issue-2150.rs
index 2c54b622021..b5269519bb7 100644
--- a/src/test/compile-fail/issue-2150.rs
+++ b/src/test/compile-fail/issue-2150.rs
@@ -11,6 +11,7 @@
 #[deny(unreachable_code)];
 #[allow(unused_variable)];
 #[allow(dead_code)];
+#[allow(deprecated_owned_vector)];
 
 fn fail_len(v: ~[int]) -> uint {
     let mut i = 3;
diff --git a/src/test/compile-fail/issue-8727.rs b/src/test/compile-fail/issue-8727.rs
index fca59ed74ee..be676becd5a 100644
--- a/src/test/compile-fail/issue-8727.rs
+++ b/src/test/compile-fail/issue-8727.rs
@@ -8,6 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#[allow(deprecated_owned_vector)];
 
 // Verify the compiler fails with an error on infinite function
 // recursions.
diff --git a/src/test/compile-fail/lint-deprecated-owned-vector.rs b/src/test/compile-fail/lint-deprecated-owned-vector.rs
new file mode 100644
index 00000000000..c21ca87e244
--- /dev/null
+++ b/src/test/compile-fail/lint-deprecated-owned-vector.rs
@@ -0,0 +1,17 @@
+// Copyright 2014 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.
+
+#[deny(deprecated_owned_vector)];
+
+fn main() {
+    ~[1]; //~ ERROR use of deprecated `~[]`
+    //~^ ERROR use of deprecated `~[]`
+    std::vec::with_capacity::<int>(10); //~ ERROR use of deprecated `~[]`
+}
diff --git a/src/test/compile-fail/lint-heap-memory.rs b/src/test/compile-fail/lint-heap-memory.rs
index fa359dcd538..4c178cdf65c 100644
--- a/src/test/compile-fail/lint-heap-memory.rs
+++ b/src/test/compile-fail/lint-heap-memory.rs
@@ -11,6 +11,7 @@
 #[feature(managed_boxes)];
 #[forbid(heap_memory)];
 #[allow(dead_code)];
+#[allow(deprecated_owned_vector)];
 
 struct Foo {
     x: @int //~ ERROR type uses managed
diff --git a/src/test/compile-fail/lint-unused-imports.rs b/src/test/compile-fail/lint-unused-imports.rs
index 8d294af3e3e..c20546d8590 100644
--- a/src/test/compile-fail/lint-unused-imports.rs
+++ b/src/test/compile-fail/lint-unused-imports.rs
@@ -11,6 +11,7 @@
 #[feature(globs)];
 #[deny(unused_imports)];
 #[allow(dead_code)];
+#[allow(deprecated_owned_vector)];
 
 use cal = bar::c::cc;
 
diff --git a/src/test/compile-fail/lint-unused-mut-variables.rs b/src/test/compile-fail/lint-unused-mut-variables.rs
index 271aedd3f6a..6b6311739f0 100644
--- a/src/test/compile-fail/lint-unused-mut-variables.rs
+++ b/src/test/compile-fail/lint-unused-mut-variables.rs
@@ -13,6 +13,7 @@
 #[allow(dead_assignment)];
 #[allow(unused_variable)];
 #[allow(dead_code)];
+#[allow(deprecated_owned_vector)];
 #[deny(unused_mut)];
 
 fn main() {
diff --git a/src/test/compile-fail/lint-unused-unsafe.rs b/src/test/compile-fail/lint-unused-unsafe.rs
index 96a4c2adca3..de01a711a3e 100644
--- a/src/test/compile-fail/lint-unused-unsafe.rs
+++ b/src/test/compile-fail/lint-unused-unsafe.rs
@@ -12,6 +12,7 @@
 
 #[allow(dead_code)];
 #[deny(unused_unsafe)];
+#[allow(deprecated_owned_vector)];
 
 mod foo {
     extern {