diff --git a/src/test/compile-fail/E0162.rs b/src/test/compile-fail/E0162.rs new file mode 100644 index 0000000000000..e13b0af6f7977 --- /dev/null +++ b/src/test/compile-fail/E0162.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Irrefutable(i32); + +fn main() { + let irr = Irrefutable(0); + if let Irrefutable(x) = irr { //~ ERROR E0162 + println!("{}", x); + } +} diff --git a/src/test/compile-fail/E0163.rs b/src/test/compile-fail/E0163.rs new file mode 100644 index 0000000000000..5cb6f4d2803e1 --- /dev/null +++ b/src/test/compile-fail/E0163.rs @@ -0,0 +1,20 @@ +// 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. + +enum Foo { B(u32) } + +fn bar(foo: Foo) -> u32 { + match foo { + Foo::B { i } => i, //~ ERROR E0163 + } +} + +fn main() { +} diff --git a/src/test/compile-fail/E0164.rs b/src/test/compile-fail/E0164.rs new file mode 100644 index 0000000000000..491b2e9e5b246 --- /dev/null +++ b/src/test/compile-fail/E0164.rs @@ -0,0 +1,20 @@ +// 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. + +enum Foo { B { i: u32 } } + +fn bar(foo: Foo) -> u32 { + match foo { + Foo::B(i) => i, //~ ERROR E0164 + } +} + +fn main() { +} diff --git a/src/test/compile-fail/E0165.rs b/src/test/compile-fail/E0165.rs new file mode 100644 index 0000000000000..cca714bbcc1bf --- /dev/null +++ b/src/test/compile-fail/E0165.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Irrefutable(i32); + +fn main() { + let irr = Irrefutable(0); + while let Irrefutable(x) = irr { //~ ERROR E0165 + // ... + } +} diff --git a/src/test/compile-fail/E0166.rs b/src/test/compile-fail/E0166.rs new file mode 100644 index 0000000000000..9fa41249aa50b --- /dev/null +++ b/src/test/compile-fail/E0166.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. + +fn foo() -> ! { return; } //~ ERROR E0166 + +fn main() { +} diff --git a/src/test/compile-fail/E0172.rs b/src/test/compile-fail/E0172.rs new file mode 100644 index 0000000000000..7011bf0e93734 --- /dev/null +++ b/src/test/compile-fail/E0172.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. + +fn foo(bar: i32+std::fmt::Display) {} //~ ERROR E0172 + +fn main() { +} diff --git a/src/test/compile-fail/E0178.rs b/src/test/compile-fail/E0178.rs new file mode 100644 index 0000000000000..f34f3834e05b1 --- /dev/null +++ b/src/test/compile-fail/E0178.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. + +trait Foo {} + +struct Bar<'a> { + w: &'a Foo + Copy, //~ ERROR E0178 + x: &'a Foo + 'a, //~ ERROR E0178 + y: &'a mut Foo + 'a, //~ ERROR E0178 + z: fn() -> Foo + 'a, //~ ERROR E0178 +} + +fn main() { +} diff --git a/src/test/compile-fail/E0184.rs b/src/test/compile-fail/E0184.rs new file mode 100644 index 0000000000000..5d72d00ffe876 --- /dev/null +++ b/src/test/compile-fail/E0184.rs @@ -0,0 +1,20 @@ +// 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. + +#[derive(Copy)] //~ ERROR E0184 +struct Foo; + +impl Drop for Foo { + fn drop(&mut self) { + } +} + +fn main() { +} diff --git a/src/test/compile-fail/E0185.rs b/src/test/compile-fail/E0185.rs new file mode 100644 index 0000000000000..0e33687a84dfb --- /dev/null +++ b/src/test/compile-fail/E0185.rs @@ -0,0 +1,22 @@ +// 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. + +trait Foo { + fn foo(); +} + +struct Bar; + +impl Foo for Bar { + fn foo(&self) {} //~ ERROR E0185 +} + +fn main() { +} diff --git a/src/test/compile-fail/E0186.rs b/src/test/compile-fail/E0186.rs new file mode 100644 index 0000000000000..aa0a38bedcb54 --- /dev/null +++ b/src/test/compile-fail/E0186.rs @@ -0,0 +1,22 @@ +// 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. + +trait Foo { + fn foo(&self); +} + +struct Bar; + +impl Foo for Bar { + fn foo() {} //~ ERROR E0186 +} + +fn main() { +} diff --git a/src/test/compile-fail/E0191.rs b/src/test/compile-fail/E0191.rs new file mode 100644 index 0000000000000..489ebb033f84e --- /dev/null +++ b/src/test/compile-fail/E0191.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +trait Trait { + type Bar; +} + +type Foo = Trait; //~ ERROR E0191 + +fn main() { +} diff --git a/src/test/compile-fail/E0192.rs b/src/test/compile-fail/E0192.rs new file mode 100644 index 0000000000000..92f5876ee04d5 --- /dev/null +++ b/src/test/compile-fail/E0192.rs @@ -0,0 +1,22 @@ +// 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(optin_builtin_traits)] + +trait Trait { + type Bar; +} + +struct Foo; + +impl !Trait for Foo { } //~ ERROR E0192 + +fn main() { +} diff --git a/src/test/compile-fail/E0194.rs b/src/test/compile-fail/E0194.rs new file mode 100644 index 0000000000000..96b3062cacb78 --- /dev/null +++ b/src/test/compile-fail/E0194.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. + +trait Foo { + fn do_something(&self) -> T; + fn do_something_else(&self, bar: T); //~ ERROR E0194 +} + +fn main() { +} diff --git a/src/test/compile-fail/E0195.rs b/src/test/compile-fail/E0195.rs new file mode 100644 index 0000000000000..0630dfea5e64b --- /dev/null +++ b/src/test/compile-fail/E0195.rs @@ -0,0 +1,23 @@ +// 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. + +trait Trait { + fn bar<'a,'b:'a>(x: &'a str, y: &'b str); +} + +struct Foo; + +impl Trait for Foo { + fn bar<'a,'b>(x: &'a str, y: &'b str) { //~ ERROR E0195 + } +} + +fn main() { +} diff --git a/src/test/compile-fail/E0197.rs b/src/test/compile-fail/E0197.rs new file mode 100644 index 0000000000000..f25fa9b92b9a0 --- /dev/null +++ b/src/test/compile-fail/E0197.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo; + +unsafe impl Foo { } //~ ERROR E0197 + +fn main() { +} diff --git a/src/test/compile-fail/E0199.rs b/src/test/compile-fail/E0199.rs new file mode 100644 index 0000000000000..8bd3ffdf6f6ee --- /dev/null +++ b/src/test/compile-fail/E0199.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(optin_builtin_traits)] + +struct Foo; + +unsafe impl !Clone for Foo { } //~ ERROR E0199 + +fn main() { +} diff --git a/src/test/compile-fail/E0200.rs b/src/test/compile-fail/E0200.rs new file mode 100644 index 0000000000000..6bfea0e59d76e --- /dev/null +++ b/src/test/compile-fail/E0200.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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo; + +unsafe trait Bar { } + +impl Bar for Foo { } //~ ERROR E0200 + +fn main() { +}