]> git.lizzy.rs Git - rust.git/commitdiff
Add new error code tests
authorggomez <guillaume1.gomez@gmail.com>
Wed, 25 May 2016 11:58:07 +0000 (13:58 +0200)
committerggomez <guillaume1.gomez@gmail.com>
Wed, 25 May 2016 11:58:07 +0000 (13:58 +0200)
15 files changed:
src/test/compile-fail/E0084.rs [new file with mode: 0644]
src/test/compile-fail/E0087.rs [new file with mode: 0644]
src/test/compile-fail/E0088.rs [new file with mode: 0644]
src/test/compile-fail/E0089.rs [new file with mode: 0644]
src/test/compile-fail/E0091.rs [new file with mode: 0644]
src/test/compile-fail/E0092.rs [new file with mode: 0644]
src/test/compile-fail/E0093.rs [new file with mode: 0644]
src/test/compile-fail/E0094.rs [new file with mode: 0644]
src/test/compile-fail/E0101.rs [new file with mode: 0644]
src/test/compile-fail/E0102.rs [new file with mode: 0644]
src/test/compile-fail/E0106.rs [new file with mode: 0644]
src/test/compile-fail/E0107.rs [new file with mode: 0644]
src/test/compile-fail/E0109.rs [new file with mode: 0644]
src/test/compile-fail/E0110.rs [new file with mode: 0644]
src/test/compile-fail/E0116.rs [new file with mode: 0644]

diff --git a/src/test/compile-fail/E0084.rs b/src/test/compile-fail/E0084.rs
new file mode 100644 (file)
index 0000000..c579101
--- /dev/null
@@ -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.
+
+#[repr(i32)]
+enum Foo {} //~ ERROR E0084
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0087.rs b/src/test/compile-fail/E0087.rs
new file mode 100644 (file)
index 0000000..ec559fc
--- /dev/null
@@ -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.
+
+fn foo<T>() {}
+
+fn main() {
+    foo::<f64, bool>(); //~ ERROR E0087
+}
diff --git a/src/test/compile-fail/E0088.rs b/src/test/compile-fail/E0088.rs
new file mode 100644 (file)
index 0000000..0b235aa
--- /dev/null
@@ -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.
+
+fn f() {}
+
+fn main() {
+    f::<'static>(); //~ ERROR E0088
+}
diff --git a/src/test/compile-fail/E0089.rs b/src/test/compile-fail/E0089.rs
new file mode 100644 (file)
index 0000000..3b52f76
--- /dev/null
@@ -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.
+
+fn foo<T, U>() {}
+
+fn main() {
+    foo::<f64>(); //~ ERROR E0089
+}
diff --git a/src/test/compile-fail/E0091.rs b/src/test/compile-fail/E0091.rs
new file mode 100644 (file)
index 0000000..da988db
--- /dev/null
@@ -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.
+
+type Foo<T> = u32; //~ ERROR E0091
+type Foo2<A, B> = Box<A>; //~ ERROR E0091
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0092.rs b/src/test/compile-fail/E0092.rs
new file mode 100644 (file)
index 0000000..b08164a
--- /dev/null
@@ -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(intrinsics)]
+extern "rust-intrinsic" {
+    fn atomic_foo(); //~ ERROR E0092
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0093.rs b/src/test/compile-fail/E0093.rs
new file mode 100644 (file)
index 0000000..9b23f6d
--- /dev/null
@@ -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(intrinsics)]
+extern "rust-intrinsic" {
+    fn foo(); //~ ERROR E0093
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0094.rs b/src/test/compile-fail/E0094.rs
new file mode 100644 (file)
index 0000000..3a31874
--- /dev/null
@@ -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(intrinsics)]
+extern "rust-intrinsic" {
+    fn size_of<T, U>() -> usize; //~ ERROR E0094
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0101.rs b/src/test/compile-fail/E0101.rs
new file mode 100644 (file)
index 0000000..7651626
--- /dev/null
@@ -0,0 +1,13 @@
+// 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() {
+    let x = |_| {}; //~ ERROR E0101
+}
diff --git a/src/test/compile-fail/E0102.rs b/src/test/compile-fail/E0102.rs
new file mode 100644 (file)
index 0000000..c4ddbab
--- /dev/null
@@ -0,0 +1,13 @@
+// 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() {
+    let x = []; //~ ERROR E0102
+}
diff --git a/src/test/compile-fail/E0106.rs b/src/test/compile-fail/E0106.rs
new file mode 100644 (file)
index 0000000..f1cd530
--- /dev/null
@@ -0,0 +1,21 @@
+// 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 {
+    x: &bool, //~ ERROR E0106
+}
+enum Bar {
+    A(u8),
+    B(&bool), //~ ERROR E0106
+}
+type MyStr = &str; //~ ERROR E0106
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0107.rs b/src/test/compile-fail/E0107.rs
new file mode 100644 (file)
index 0000000..d27b708
--- /dev/null
@@ -0,0 +1,25 @@
+// 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<'a>(&'a str);
+
+enum Bar {
+    A,
+    B,
+    C,
+}
+
+struct Baz<'a> {
+    foo: Foo, //~ ERROR E0107
+    bar: Bar<'a>, //~ ERROR E0107
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0109.rs b/src/test/compile-fail/E0109.rs
new file mode 100644 (file)
index 0000000..9fc4784
--- /dev/null
@@ -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.
+
+type X = u32<i32>; //~ ERROR E0109
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0110.rs b/src/test/compile-fail/E0110.rs
new file mode 100644 (file)
index 0000000..fd169f4
--- /dev/null
@@ -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.
+
+type X = u32<'static>; //~ ERROR E0110
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0116.rs b/src/test/compile-fail/E0116.rs
new file mode 100644 (file)
index 0000000..4020aa9
--- /dev/null
@@ -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 Vec<u8> {} //~ ERROR E0116
+
+fn main() {
+}