From 6d669b4f458a87cc5a1e4f26463edc805d7f9ead Mon Sep 17 00:00:00 2001 From: ggomez Date: Wed, 25 May 2016 13:58:07 +0200 Subject: [PATCH] Add new error code tests --- src/test/compile-fail/E0084.rs | 15 +++++++++++++++ src/test/compile-fail/E0087.rs | 15 +++++++++++++++ src/test/compile-fail/E0088.rs | 15 +++++++++++++++ src/test/compile-fail/E0089.rs | 15 +++++++++++++++ src/test/compile-fail/E0091.rs | 15 +++++++++++++++ src/test/compile-fail/E0092.rs | 17 +++++++++++++++++ src/test/compile-fail/E0093.rs | 17 +++++++++++++++++ src/test/compile-fail/E0094.rs | 17 +++++++++++++++++ src/test/compile-fail/E0101.rs | 13 +++++++++++++ src/test/compile-fail/E0102.rs | 13 +++++++++++++ src/test/compile-fail/E0106.rs | 21 +++++++++++++++++++++ src/test/compile-fail/E0107.rs | 25 +++++++++++++++++++++++++ src/test/compile-fail/E0109.rs | 14 ++++++++++++++ src/test/compile-fail/E0110.rs | 14 ++++++++++++++ src/test/compile-fail/E0116.rs | 14 ++++++++++++++ 15 files changed, 240 insertions(+) create mode 100644 src/test/compile-fail/E0084.rs create mode 100644 src/test/compile-fail/E0087.rs create mode 100644 src/test/compile-fail/E0088.rs create mode 100644 src/test/compile-fail/E0089.rs create mode 100644 src/test/compile-fail/E0091.rs create mode 100644 src/test/compile-fail/E0092.rs create mode 100644 src/test/compile-fail/E0093.rs create mode 100644 src/test/compile-fail/E0094.rs create mode 100644 src/test/compile-fail/E0101.rs create mode 100644 src/test/compile-fail/E0102.rs create mode 100644 src/test/compile-fail/E0106.rs create mode 100644 src/test/compile-fail/E0107.rs create mode 100644 src/test/compile-fail/E0109.rs create mode 100644 src/test/compile-fail/E0110.rs create mode 100644 src/test/compile-fail/E0116.rs diff --git a/src/test/compile-fail/E0084.rs b/src/test/compile-fail/E0084.rs new file mode 100644 index 00000000000..c579101325f --- /dev/null +++ b/src/test/compile-fail/E0084.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 or the MIT license +// , 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 index 00000000000..ec559fc8389 --- /dev/null +++ b/src/test/compile-fail/E0087.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo() {} + +fn main() { + foo::(); //~ ERROR E0087 +} diff --git a/src/test/compile-fail/E0088.rs b/src/test/compile-fail/E0088.rs new file mode 100644 index 00000000000..0b235aa240c --- /dev/null +++ b/src/test/compile-fail/E0088.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 or the MIT license +// , 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 index 00000000000..3b52f76bf09 --- /dev/null +++ b/src/test/compile-fail/E0089.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn foo() {} + +fn main() { + foo::(); //~ ERROR E0089 +} diff --git a/src/test/compile-fail/E0091.rs b/src/test/compile-fail/E0091.rs new file mode 100644 index 00000000000..da988dbf819 --- /dev/null +++ b/src/test/compile-fail/E0091.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +type Foo = u32; //~ ERROR E0091 +type Foo2 = Box; //~ ERROR E0091 + +fn main() { +} diff --git a/src/test/compile-fail/E0092.rs b/src/test/compile-fail/E0092.rs new file mode 100644 index 00000000000..b08164ac06d --- /dev/null +++ b/src/test/compile-fail/E0092.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 or the MIT license +// , 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 index 00000000000..9b23f6d984e --- /dev/null +++ b/src/test/compile-fail/E0093.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 or the MIT license +// , 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 index 00000000000..3a31874b244 --- /dev/null +++ b/src/test/compile-fail/E0094.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 or the MIT license +// , 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() -> 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 index 00000000000..7651626d44f --- /dev/null +++ b/src/test/compile-fail/E0101.rs @@ -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 or the MIT license +// , 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 index 00000000000..c4ddbab3e86 --- /dev/null +++ b/src/test/compile-fail/E0102.rs @@ -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 or the MIT license +// , 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 index 00000000000..f1cd530863d --- /dev/null +++ b/src/test/compile-fail/E0106.rs @@ -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 or the MIT license +// , 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 index 00000000000..d27b70865bb --- /dev/null +++ b/src/test/compile-fail/E0107.rs @@ -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 or the MIT license +// , 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 index 00000000000..9fc47842250 --- /dev/null +++ b/src/test/compile-fail/E0109.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +type X = u32; //~ ERROR E0109 + +fn main() { +} diff --git a/src/test/compile-fail/E0110.rs b/src/test/compile-fail/E0110.rs new file mode 100644 index 00000000000..fd169f4acc5 --- /dev/null +++ b/src/test/compile-fail/E0110.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 or the MIT license +// , 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 index 00000000000..4020aa9475a --- /dev/null +++ b/src/test/compile-fail/E0116.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +impl Vec {} //~ ERROR E0116 + +fn main() { +}