Add new error code tests
diff --git a/src/test/compile-fail/E0201.rs b/src/test/compile-fail/E0201.rs
new file mode 100644
index 0000000..ff6cb55
--- /dev/null
+++ b/src/test/compile-fail/E0201.rs
@@ -0,0 +1,32 @@
+// 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(u8);
+
+impl Foo {
+    fn bar(&self) -> bool { self.0 > 5 }
+    fn bar() {} //~ ERROR E0201
+}
+
+trait Baz {
+    type Quux;
+    fn baz(&self) -> bool;
+}
+
+impl Baz for Foo {
+    type Quux = u32;
+
+    fn baz(&self) -> bool { true }
+    fn baz(&self) -> bool { self.0 > 5 } //~ ERROR E0201
+    type Quux = u32; //~ ERROR E0201
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0204.rs b/src/test/compile-fail/E0204.rs
new file mode 100644
index 0000000..2fa2afa
--- /dev/null
+++ b/src/test/compile-fail/E0204.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 <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 {
+    foo: Vec<u32>,
+}
+
+impl Copy for Foo { } //~ ERROR E0204
+
+#[derive(Copy)] //~ ERROR E0204
+struct Foo2<'a> {
+    ty: &'a mut bool,
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0205.rs b/src/test/compile-fail/E0205.rs
new file mode 100644
index 0000000..e4781bb
--- /dev/null
+++ b/src/test/compile-fail/E0205.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 <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.
+
+enum Foo {
+    Bar(Vec<u32>),
+    Baz,
+}
+
+impl Copy for Foo { } //~ ERROR E0205
+
+#[derive(Copy)] //~ ERROR E0205
+enum Foo2<'a> {
+    Bar(&'a mut bool),
+    Baz,
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0206.rs b/src/test/compile-fail/E0206.rs
new file mode 100644
index 0000000..31b01da
--- /dev/null
+++ b/src/test/compile-fail/E0206.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 <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 = i32;
+
+impl Copy for Foo { } //~ ERROR E0206
+                      //~^ ERROR E0117
+
+#[derive(Copy, Clone)]
+struct Bar;
+
+impl Copy for &'static Bar { } //~ ERROR E0206
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0207.rs b/src/test/compile-fail/E0207.rs
new file mode 100644
index 0000000..bd87dba
--- /dev/null
+++ b/src/test/compile-fail/E0207.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 <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;
+
+impl<T: Default> Foo { //~ ERROR E0207
+    fn get(&self) -> T {
+        <T as Default>::default()
+    }
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0214.rs b/src/test/compile-fail/E0214.rs
new file mode 100644
index 0000000..5960934
--- /dev/null
+++ b/src/test/compile-fail/E0214.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 <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 v: Vec(&str) = vec!["foo"]; //~ ERROR E0214
+}
diff --git a/src/test/compile-fail/E0220.rs b/src/test/compile-fail/E0220.rs
new file mode 100644
index 0000000..17e2b18
--- /dev/null
+++ b/src/test/compile-fail/E0220.rs
@@ -0,0 +1,19 @@
+// 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 Trait {
+    type Bar;
+}
+
+type Foo = Trait<F=i32>; //~ ERROR E0220
+                         //~^ ERROR E0191
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0221.rs b/src/test/compile-fail/E0221.rs
new file mode 100644
index 0000000..213ec5a
--- /dev/null
+++ b/src/test/compile-fail/E0221.rs
@@ -0,0 +1,26 @@
+// 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 T1 {}
+trait T2 {}
+
+trait Foo {
+    type A: T1;
+}
+
+trait Bar : Foo {
+    type A: T2;
+    fn do_something() {
+        let _: Self::A; //~ ERROR E0221
+    }
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0223.rs b/src/test/compile-fail/E0223.rs
new file mode 100644
index 0000000..bbf7d76
--- /dev/null
+++ b/src/test/compile-fail/E0223.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.
+
+trait MyTrait { type X; }
+
+fn main() {
+    let foo: MyTrait::X; //~ ERROR E0223
+}
diff --git a/src/test/compile-fail/E0225.rs b/src/test/compile-fail/E0225.rs
new file mode 100644
index 0000000..190350c
--- /dev/null
+++ b/src/test/compile-fail/E0225.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 <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 _: Box<std::io::Read + std::io::Write>; //~ ERROR E0225
+}
diff --git a/src/test/compile-fail/E0229.rs b/src/test/compile-fail/E0229.rs
new file mode 100644
index 0000000..45d5c59
--- /dev/null
+++ b/src/test/compile-fail/E0229.rs
@@ -0,0 +1,26 @@
+// 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.
+
+pub trait Foo {
+    type A;
+    fn boo(&self) -> <Self as Foo>::A;
+}
+
+struct Bar;
+
+impl Foo for isize {
+    type A = usize;
+    fn boo(&self) -> usize { 42 }
+}
+
+fn baz<I>(x: &<I as Foo<A=Bar>>::A) {} //~ ERROR E0229
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0232.rs b/src/test/compile-fail/E0232.rs
new file mode 100644
index 0000000..efeb869
--- /dev/null
+++ b/src/test/compile-fail/E0232.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(on_unimplemented)]
+
+#[rustc_on_unimplemented] //~ ERROR E0232
+trait Bar {}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0243.rs b/src/test/compile-fail/E0243.rs
new file mode 100644
index 0000000..8cc245c
--- /dev/null
+++ b/src/test/compile-fail/E0243.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.
+
+struct Foo<T> { x: T }
+struct Bar { x: Foo } //~ ERROR E0243
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0244.rs b/src/test/compile-fail/E0244.rs
new file mode 100644
index 0000000..4c57447
--- /dev/null
+++ b/src/test/compile-fail/E0244.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.
+
+struct Foo { x: bool }
+struct Bar<S, T> { x: Foo<S, T> } //~ ERROR E0244
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0248.rs b/src/test/compile-fail/E0248.rs
new file mode 100644
index 0000000..fdfd41a
--- /dev/null
+++ b/src/test/compile-fail/E0248.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.
+
+enum Foo {
+    Bar(u32),
+}
+
+fn do_something(x: Foo::Bar) { } //~ ERROR E0248
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0252.rs b/src/test/compile-fail/E0252.rs
new file mode 100644
index 0000000..6b353c8
--- /dev/null
+++ b/src/test/compile-fail/E0252.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 <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.
+
+use foo::baz;
+use bar::baz; //~ ERROR E0252
+
+mod foo {
+    pub struct baz;
+}
+
+mod bar {
+    pub mod baz {}
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0306.rs b/src/test/compile-fail/E0306.rs
new file mode 100644
index 0000000..61cc890
--- /dev/null
+++ b/src/test/compile-fail/E0306.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.
+
+const A: [u32; "hello"] = []; //~ ERROR E0306
+const B: [u32; true] = []; //~ ERROR E0306
+const C: [u32; 0.0] = []; //~ ERROR E0306
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0308-2.rs b/src/test/compile-fail/E0308-2.rs
new file mode 100644
index 0000000..8c9fc95
--- /dev/null
+++ b/src/test/compile-fail/E0308-2.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 <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.
+
+use std::rc::Rc;
+
+struct Foo;
+
+impl Foo {
+    fn x(self: Rc<Foo>) {} //~ ERROR E0308
+}
+
+fn main() {
+}
diff --git a/src/test/compile-fail/E0308-3.rs b/src/test/compile-fail/E0308-3.rs
new file mode 100644
index 0000000..d7dca05
--- /dev/null
+++ b/src/test/compile-fail/E0308-3.rs
@@ -0,0 +1,11 @@
+// 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() -> i32 { 0 } //~ ERROR E0308
diff --git a/src/test/compile-fail/E0308-4.rs b/src/test/compile-fail/E0308-4.rs
new file mode 100644
index 0000000..bb4cd14
--- /dev/null
+++ b/src/test/compile-fail/E0308-4.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.
+
+fn main() {
+    let x = 1u8;
+    match x {
+        0u8...3i8 => (), //~ ERROR E0308
+        _ => ()
+    }
+}
diff --git a/src/test/compile-fail/E0308.rs b/src/test/compile-fail/E0308.rs
new file mode 100644
index 0000000..078f1d3
--- /dev/null
+++ b/src/test/compile-fail/E0308.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.
+
+#![feature(intrinsics)]
+
+extern "rust-intrinsic" {
+    fn size_of<T>(); //~ ERROR E0308
+}
+
+fn main() {
+}