about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-10-03 07:38:12 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-10-03 07:38:12 -0700
commit2a11f2b5440444181e20c3b4f2b0a01eb9fec385 (patch)
tree77b87ee2f622bd04e6904d35dd784a4f807a52d2 /src/test
parent9a2286d3a13c4a97340c99c86c718654f6cb2ed6 (diff)
parenta667a6917b2be3bad44a625badcc11293a97910b (diff)
downloadrust-2a11f2b5440444181e20c3b4f2b0a01eb9fec385.tar.gz
rust-2a11f2b5440444181e20c3b4f2b0a01eb9fec385.zip
rollup merge of #17215 : P1start/lints
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail-fulldeps/syntax-extension-regex-unused-static.rs1
-rw-r--r--src/test/compile-fail/asm-misplaced-option.rs2
-rw-r--r--src/test/compile-fail/dst-bad-coerce1.rs2
-rw-r--r--src/test/compile-fail/dst-bad-coerce4.rs2
-rw-r--r--src/test/compile-fail/issue-13482.rs2
-rw-r--r--src/test/compile-fail/issue-14845.rs4
-rw-r--r--src/test/compile-fail/issue-15914.rs14
-rw-r--r--src/test/compile-fail/issue-17337.rs23
-rw-r--r--src/test/compile-fail/issue-17441.rs4
-rw-r--r--src/test/compile-fail/issue-2149.rs2
-rw-r--r--src/test/compile-fail/issue-4517.rs2
-rw-r--r--src/test/compile-fail/issue-6804.rs2
-rw-r--r--src/test/compile-fail/lint-dead-code-1.rs1
-rw-r--r--src/test/compile-fail/lint-directives-on-use-items-issue-10534.rs1
-rw-r--r--src/test/compile-fail/lint-non-snake-case-functions.rs5
15 files changed, 55 insertions, 12 deletions
diff --git a/src/test/compile-fail-fulldeps/syntax-extension-regex-unused-static.rs b/src/test/compile-fail-fulldeps/syntax-extension-regex-unused-static.rs
index 095acf56e48..1d14da73b7e 100644
--- a/src/test/compile-fail-fulldeps/syntax-extension-regex-unused-static.rs
+++ b/src/test/compile-fail-fulldeps/syntax-extension-regex-unused-static.rs
@@ -17,6 +17,7 @@ extern crate regex;
 
 #[deny(unused_variable)]
 #[deny(dead_code)]
+#[allow(non_uppercase_statics)]
 
 // Tests to make sure that extraneous dead code warnings aren't emitted from
 // the code generated by regex!.
diff --git a/src/test/compile-fail/asm-misplaced-option.rs b/src/test/compile-fail/asm-misplaced-option.rs
index 8006789d440..74bfc6e6ffc 100644
--- a/src/test/compile-fail/asm-misplaced-option.rs
+++ b/src/test/compile-fail/asm-misplaced-option.rs
@@ -12,7 +12,7 @@
 
 #![feature(asm)]
 
-#![allow(dead_code)]
+#![allow(dead_code, non_uppercase_statics)]
 
 #[cfg(any(target_arch = "x86",
           target_arch = "x86_64"))]
diff --git a/src/test/compile-fail/dst-bad-coerce1.rs b/src/test/compile-fail/dst-bad-coerce1.rs
index 4247f91a4fc..59499ac070d 100644
--- a/src/test/compile-fail/dst-bad-coerce1.rs
+++ b/src/test/compile-fail/dst-bad-coerce1.rs
@@ -22,7 +22,7 @@ pub fn main() {
     let f1 = Fat { ptr: [1, 2, 3] };
     let f2: &Fat<[int, ..3]> = &f1;
     let f3: &Fat<[uint]> = f2;
-    //~^ ERROR mismatched types: expected `&Fat<[uint]>`, found `&Fat<[int, .. 3]>`
+    //~^ ERROR mismatched types: expected `&Fat<[uint]>`, found `&Fat<[int, ..3]>`
 
     // With a trait.
     let f1 = Fat { ptr: Foo };
diff --git a/src/test/compile-fail/dst-bad-coerce4.rs b/src/test/compile-fail/dst-bad-coerce4.rs
index 9a192334997..9010185f76b 100644
--- a/src/test/compile-fail/dst-bad-coerce4.rs
+++ b/src/test/compile-fail/dst-bad-coerce4.rs
@@ -18,5 +18,5 @@ pub fn main() {
     // With a vec of ints.
     let f1: &Fat<[int]> = &Fat { ptr: [1, 2, 3] };
     let f2: &Fat<[int, ..3]> = f1;
-    //~^ ERROR mismatched types: expected `&Fat<[int, .. 3]>`, found `&Fat<[int]>`
+    //~^ ERROR mismatched types: expected `&Fat<[int, ..3]>`, found `&Fat<[int]>`
 }
diff --git a/src/test/compile-fail/issue-13482.rs b/src/test/compile-fail/issue-13482.rs
index 2d745894426..e5d87395286 100644
--- a/src/test/compile-fail/issue-13482.rs
+++ b/src/test/compile-fail/issue-13482.rs
@@ -12,7 +12,7 @@ fn main() {
   let x = [1,2];
   let y = match x {
     [] => None,
-//~^ ERROR expected `[<generic integer #0>, .. 2]`, found a fixed vector pattern of size 0
+//~^ ERROR expected `[<generic integer #0>, ..2]`, found a fixed vector pattern of size 0
     [a,_] => Some(a)
   };
 }
diff --git a/src/test/compile-fail/issue-14845.rs b/src/test/compile-fail/issue-14845.rs
index fc5a591ebd6..bc606d8139f 100644
--- a/src/test/compile-fail/issue-14845.rs
+++ b/src/test/compile-fail/issue-14845.rs
@@ -16,9 +16,9 @@ struct X {
 fn main() {
     let x = X { a: [0] };
     let _f = &x.a as *mut u8;
-    //~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, .. 1]`
+    //~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, ..1]`
 
     let local = [0u8];
     let _v = &local as *mut u8;
-    //~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, .. 1]`
+    //~^ ERROR mismatched types: expected `*mut u8`, found `&[u8, ..1]`
 }
diff --git a/src/test/compile-fail/issue-15914.rs b/src/test/compile-fail/issue-15914.rs
new file mode 100644
index 00000000000..45b3abfddfb
--- /dev/null
+++ b/src/test/compile-fail/issue-15914.rs
@@ -0,0 +1,14 @@
+// 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.
+
+fn main() {
+    let ref
+        (); //~ ERROR expected identifier, found `(`
+}
diff --git a/src/test/compile-fail/issue-17337.rs b/src/test/compile-fail/issue-17337.rs
new file mode 100644
index 00000000000..e0f655084ff
--- /dev/null
+++ b/src/test/compile-fail/issue-17337.rs
@@ -0,0 +1,23 @@
+// 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)]
+
+struct Foo;
+
+impl Foo {
+    #[deprecated]
+    fn foo(self) {}
+}
+
+fn main() {
+    Foo
+    .foo(); //~ ERROR use of deprecated item
+}
diff --git a/src/test/compile-fail/issue-17441.rs b/src/test/compile-fail/issue-17441.rs
index da548ca5ffe..da5590971bc 100644
--- a/src/test/compile-fail/issue-17441.rs
+++ b/src/test/compile-fail/issue-17441.rs
@@ -10,7 +10,7 @@
 
 fn main() {
     let _foo = &[1u, 2] as [uint];
-    //~^ ERROR cast to unsized type: `&[uint, .. 2]` as `[uint]`
+    //~^ ERROR cast to unsized type: `&[uint, ..2]` as `[uint]`
     //~^^ NOTE consider using an implicit coercion to `&[uint]` instead
     let _bar = box 1u as std::fmt::Show;
     //~^ ERROR cast to unsized type: `Box<uint>` as `core::fmt::Show`
@@ -19,6 +19,6 @@ fn main() {
     //~^ ERROR cast to unsized type: `uint` as `core::fmt::Show`
     //~^^ NOTE consider using a box or reference as appropriate
     let _quux = [1u, 2] as [uint];
-    //~^ ERROR cast to unsized type: `[uint, .. 2]` as `[uint]`
+    //~^ ERROR cast to unsized type: `[uint, ..2]` as `[uint]`
     //~^^ NOTE consider using a box or reference as appropriate
 }
diff --git a/src/test/compile-fail/issue-2149.rs b/src/test/compile-fail/issue-2149.rs
index 5d07472afbb..81f57dd9640 100644
--- a/src/test/compile-fail/issue-2149.rs
+++ b/src/test/compile-fail/issue-2149.rs
@@ -22,5 +22,5 @@ impl<A> vec_monad<A> for Vec<A> {
 }
 fn main() {
     ["hi"].bind(|x| [x] );
-    //~^ ERROR type `[&str, .. 1]` does not implement any method in scope named `bind`
+    //~^ ERROR type `[&str, ..1]` does not implement any method in scope named `bind`
 }
diff --git a/src/test/compile-fail/issue-4517.rs b/src/test/compile-fail/issue-4517.rs
index d80f2d1263d..f61ed35fca3 100644
--- a/src/test/compile-fail/issue-4517.rs
+++ b/src/test/compile-fail/issue-4517.rs
@@ -13,6 +13,6 @@ fn bar(int_param: int) {}
 fn main() {
     let foo: [u8, ..4] = [1u8, ..4u];
     bar(foo);
-    //~^ ERROR mismatched types: expected `int`, found `[u8, .. 4]`
+    //~^ ERROR mismatched types: expected `int`, found `[u8, ..4]`
     //         (expected int, found vector)
 }
diff --git a/src/test/compile-fail/issue-6804.rs b/src/test/compile-fail/issue-6804.rs
index 600b28048b4..30d3ab17a46 100644
--- a/src/test/compile-fail/issue-6804.rs
+++ b/src/test/compile-fail/issue-6804.rs
@@ -30,4 +30,4 @@ fn main() {
 
 // At least one error is needed so that compilation fails
 #[static_assert]
-static b: bool = false; //~ ERROR static assertion failed
+static B: bool = false; //~ ERROR static assertion failed
diff --git a/src/test/compile-fail/lint-dead-code-1.rs b/src/test/compile-fail/lint-dead-code-1.rs
index b7feea775cb..45380235a2a 100644
--- a/src/test/compile-fail/lint-dead-code-1.rs
+++ b/src/test/compile-fail/lint-dead-code-1.rs
@@ -11,6 +11,7 @@
 #![no_std]
 #![allow(unused_variable)]
 #![allow(non_camel_case_types)]
+#![allow(non_uppercase_statics)]
 #![deny(dead_code)]
 #![feature(lang_items)]
 
diff --git a/src/test/compile-fail/lint-directives-on-use-items-issue-10534.rs b/src/test/compile-fail/lint-directives-on-use-items-issue-10534.rs
index e920bfd412d..bbd88f1f0aa 100644
--- a/src/test/compile-fail/lint-directives-on-use-items-issue-10534.rs
+++ b/src/test/compile-fail/lint-directives-on-use-items-issue-10534.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 #![deny(unused_imports)]
+#![allow(non_uppercase_statics)]
 
 // The aim of this test is to ensure that deny/allow/warn directives
 // are applied to individual "use" statements instead of silently
diff --git a/src/test/compile-fail/lint-non-snake-case-functions.rs b/src/test/compile-fail/lint-non-snake-case-functions.rs
index ccbe1f006e3..6cfdc6ad90b 100644
--- a/src/test/compile-fail/lint-non-snake-case-functions.rs
+++ b/src/test/compile-fail/lint-non-snake-case-functions.rs
@@ -23,11 +23,14 @@ impl Foo {
 
     pub fn xyZ(&mut self) {}
     //~^ ERROR method `xyZ` should have a snake case name such as `xy_z`
+
+    fn render_HTML() {}
+    //~^ ERROR method `render_HTML` should have a snake case name such as `render_html`
 }
 
 trait X {
     fn ABC();
-    //~^ ERROR trait method `ABC` should have a snake case name such as `a_b_c`
+    //~^ ERROR trait method `ABC` should have a snake case name such as `abc`
 
     fn a_b_C(&self) {}
     //~^ ERROR trait method `a_b_C` should have a snake case name such as `a_b_c`