about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/test/compile-fail/E0117.rs14
-rw-r--r--src/test/compile-fail/E0118.rs18
-rw-r--r--src/test/compile-fail/E0119.rs28
-rw-r--r--src/test/compile-fail/E0120.rs18
-rw-r--r--src/test/compile-fail/E0121.rs16
-rw-r--r--src/test/compile-fail/E0124.rs17
-rw-r--r--src/test/compile-fail/E0128.rs17
-rw-r--r--src/test/compile-fail/E0130.rs16
-rw-r--r--src/test/compile-fail/E0131.rs12
-rw-r--r--src/test/compile-fail/E0132.rs17
-rw-r--r--src/test/compile-fail/E0133.rs15
-rw-r--r--src/test/compile-fail/E0137.rs17
-rw-r--r--src/test/compile-fail/E0138.rs17
-rw-r--r--src/test/compile-fail/E0152.rs17
-rw-r--r--src/test/compile-fail/E0161.rs16
15 files changed, 255 insertions, 0 deletions
diff --git a/src/test/compile-fail/E0117.rs b/src/test/compile-fail/E0117.rs
new file mode 100644
index 00000000000..16d713bba92
--- /dev/null
+++ b/src/test/compile-fail/E0117.rs
@@ -0,0 +1,14 @@
+// Copyright 2016 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.
+
+impl Drop for u32 {} //~ ERROR E0117
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0118.rs b/src/test/compile-fail/E0118.rs
new file mode 100644
index 00000000000..d37ff34b861
--- /dev/null
+++ b/src/test/compile-fail/E0118.rs
@@ -0,0 +1,18 @@
+// Copyright 2016 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.
+
+impl (u8, u8) { //~ ERROR E0118
+    fn get_state(&self) -> String {
+        String::new()
+    }
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0119.rs b/src/test/compile-fail/E0119.rs
new file mode 100644
index 00000000000..9528631b304
--- /dev/null
+++ b/src/test/compile-fail/E0119.rs
@@ -0,0 +1,28 @@
+// Copyright 2016 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.
+
+trait MyTrait {
+    fn get(&self) -> usize;
+}
+
+impl<T> MyTrait for T {
+    fn get(&self) -> usize { 0 }
+}
+
+struct Foo {
+    value: usize
+}
+
+impl MyTrait for Foo { //~ ERROR E0119
+    fn get(&self) -> usize { self.value }
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0120.rs b/src/test/compile-fail/E0120.rs
new file mode 100644
index 00000000000..de084274f6f
--- /dev/null
+++ b/src/test/compile-fail/E0120.rs
@@ -0,0 +1,18 @@
+// Copyright 2016 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.
+
+trait MyTrait {}
+
+impl Drop for MyTrait { //~ ERROR E0120
+    fn drop(&mut self) {}
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0121.rs b/src/test/compile-fail/E0121.rs
new file mode 100644
index 00000000000..b26b5f41bfe
--- /dev/null
+++ b/src/test/compile-fail/E0121.rs
@@ -0,0 +1,16 @@
+// Copyright 2016 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 foo() -> _ { 5 } //~ ERROR E0121
+
+static BAR: _ = "test"; //~ ERROR E0121
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0124.rs b/src/test/compile-fail/E0124.rs
new file mode 100644
index 00000000000..414b19ead62
--- /dev/null
+++ b/src/test/compile-fail/E0124.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 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.
+
+struct Foo {
+    field1: i32,
+    field1: i32, //~ ERROR E0124
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0128.rs b/src/test/compile-fail/E0128.rs
new file mode 100644
index 00000000000..37071012825
--- /dev/null
+++ b/src/test/compile-fail/E0128.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 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.
+
+struct Foo<T=U, U=()> { //~ ERROR E0128
+    field1: T,
+    field2: U,
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0130.rs b/src/test/compile-fail/E0130.rs
new file mode 100644
index 00000000000..ef5961e1338
--- /dev/null
+++ b/src/test/compile-fail/E0130.rs
@@ -0,0 +1,16 @@
+// Copyright 2016 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.
+
+extern {
+    fn foo((a, b): (u32, u32)); //~ ERROR E0130
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0131.rs b/src/test/compile-fail/E0131.rs
new file mode 100644
index 00000000000..aa11577ccdf
--- /dev/null
+++ b/src/test/compile-fail/E0131.rs
@@ -0,0 +1,12 @@
+// Copyright 2016 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<T>() { //~ ERROR E0131
+}
diff --git a/src/test/compile-fail/E0132.rs b/src/test/compile-fail/E0132.rs
new file mode 100644
index 00000000000..ff19a577f90
--- /dev/null
+++ b/src/test/compile-fail/E0132.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 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.
+
+#![feature(start)]
+
+#[start]
+fn f<T>() {} //~ ERROR E0132
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0133.rs b/src/test/compile-fail/E0133.rs
new file mode 100644
index 00000000000..630ee851d0a
--- /dev/null
+++ b/src/test/compile-fail/E0133.rs
@@ -0,0 +1,15 @@
+// Copyright 2016 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.
+
+unsafe fn f() { return; }
+
+fn main() {
+    f(); //~ ERROR E0133
+}
diff --git a/src/test/compile-fail/E0137.rs b/src/test/compile-fail/E0137.rs
new file mode 100644
index 00000000000..695ce7995a9
--- /dev/null
+++ b/src/test/compile-fail/E0137.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 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.
+
+#![feature(main)]
+
+#[main]
+fn foo() {}
+
+#[main]
+fn f() {} //~ ERROR E0137
diff --git a/src/test/compile-fail/E0138.rs b/src/test/compile-fail/E0138.rs
new file mode 100644
index 00000000000..97d85e5e71e
--- /dev/null
+++ b/src/test/compile-fail/E0138.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 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.
+
+#![feature(start)]
+
+#[start]
+fn foo(argc: isize, argv: *const *const u8) -> isize {}
+
+#[start]
+fn f(argc: isize, argv: *const *const u8) -> isize {} //~ ERROR E0138
diff --git a/src/test/compile-fail/E0152.rs b/src/test/compile-fail/E0152.rs
new file mode 100644
index 00000000000..ae501b94e3f
--- /dev/null
+++ b/src/test/compile-fail/E0152.rs
@@ -0,0 +1,17 @@
+// Copyright 2016 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.
+
+#![feature(lang_items)]
+
+#[lang = "panic_fmt"]
+struct Foo; //~ ERROR E0152
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0161.rs b/src/test/compile-fail/E0161.rs
new file mode 100644
index 00000000000..81adf908302
--- /dev/null
+++ b/src/test/compile-fail/E0161.rs
@@ -0,0 +1,16 @@
+// Copyright 2016 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.
+
+#![feature(box_syntax)]
+
+fn main() {
+    let _x: Box<str> = box *"hello"; //~ ERROR E0161
+                                     //~^ ERROR E0507
+}