about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-08-25 13:00:20 +0000
committerbors <bors@rust-lang.org>2018-08-25 13:00:20 +0000
commit545f22340f72ee0efaf6463efb43a2840e3d35db (patch)
treee114bcc012808faa5d0355d596b3d4307eb8c1a2
parentaf2be23fd156fe93ca4db2f2a0f047f1ad5c6533 (diff)
parent79afc6e9e880244bf841ae85d02505b257a28343 (diff)
downloadrust-545f22340f72ee0efaf6463efb43a2840e3d35db.tar.gz
rust-545f22340f72ee0efaf6463efb43a2840e3d35db.zip
Auto merge of #53584 - mcr431:Fix-#53525, r=varkor
Fix #53525  - Unify E0243, E0244, E0087, E0088, E0089, and E0090 into E0107

Fix #53525

This pr merges all errors related to too many or too few generic arguments in types and functions. E0243, E0244, E0087, E0088, E0089, E0090 errors will no longer be emitted and E0107 will be used instead.
-rw-r--r--src/librustc_typeck/astconv.rs28
-rw-r--r--src/librustc_typeck/diagnostics.rs56
-rw-r--r--src/test/ui/bad/bad-mid-path-type-params.stderr9
-rw-r--r--src/test/ui/constructor-lifetime-args.stderr11
-rw-r--r--src/test/ui/error-codes/E0087.rs18
-rw-r--r--src/test/ui/error-codes/E0087.stderr15
-rw-r--r--src/test/ui/error-codes/E0088.rs17
-rw-r--r--src/test/ui/error-codes/E0088.stderr15
-rw-r--r--src/test/ui/error-codes/E0089.rs15
-rw-r--r--src/test/ui/error-codes/E0089.stderr9
-rw-r--r--src/test/ui/error-codes/E0090.rs15
-rw-r--r--src/test/ui/error-codes/E0090.stderr9
-rw-r--r--src/test/ui/error-codes/E0243.rs16
-rw-r--r--src/test/ui/error-codes/E0243.stderr9
-rw-r--r--src/test/ui/error-codes/E0244.rs17
-rw-r--r--src/test/ui/error-codes/E0244.stderr9
-rw-r--r--src/test/ui/generic/generic-arg-mismatch-recover.stderr10
-rw-r--r--src/test/ui/generic/generic-impl-less-params-with-defaults.stderr4
-rw-r--r--src/test/ui/generic/generic-impl-more-params-with-defaults.stderr4
-rw-r--r--src/test/ui/generic/generic-type-less-params-with-defaults.rs2
-rw-r--r--src/test/ui/generic/generic-type-less-params-with-defaults.stderr4
-rw-r--r--src/test/ui/generic/generic-type-more-params-with-defaults.rs2
-rw-r--r--src/test/ui/generic/generic-type-more-params-with-defaults.stderr4
-rw-r--r--src/test/ui/issue-53251.stderr4
-rw-r--r--src/test/ui/issues/issue-14092.rs2
-rw-r--r--src/test/ui/issues/issue-14092.stderr4
-rw-r--r--src/test/ui/issues/issue-23024.rs2
-rw-r--r--src/test/ui/issues/issue-23024.stderr6
-rw-r--r--src/test/ui/issues/issue-3214.stderr6
-rw-r--r--src/test/ui/methods/method-call-lifetime-args-fail.stderr11
-rw-r--r--src/test/ui/seq-args.stderr6
-rw-r--r--src/test/ui/structs/structure-constructor-type-mismatch.stderr8
-rw-r--r--src/test/ui/tag-type-args.stderr4
-rw-r--r--src/test/ui/traits/trait-object-vs-lifetime.stderr4
-rw-r--r--src/test/ui/traits/trait-test-2.stderr6
-rw-r--r--src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs10
-rw-r--r--src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr11
-rw-r--r--src/test/ui/typeck/typeck_type_placeholder_lifetime_1.rs2
-rw-r--r--src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr4
-rw-r--r--src/test/ui/typeck/typeck_type_placeholder_lifetime_2.rs2
-rw-r--r--src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr4
-rw-r--r--src/test/ui/ufcs/ufcs-qpath-missing-params.stderr4
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr6
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr6
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.rs2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr6
46 files changed, 127 insertions, 291 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index 9d4481ce6d4..3c9452835fd 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -99,12 +99,6 @@ enum GenericArgPosition {
     MethodCall,
 }
 
-// FIXME(#53525): these error codes should all be unified.
-struct GenericArgMismatchErrorCode {
-    lifetimes: (&'static str, &'static str),
-    types: (&'static str, &'static str),
-}
-
 /// Dummy type used for the `Self` of a `TraitRef` created for converting
 /// a trait object, and which gets removed in `ExistentialTraitRef`.
 /// This type must not appear anywhere in other converted types.
@@ -262,10 +256,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
             },
             def.parent.is_none() && def.has_self, // `has_self`
             seg.infer_types || suppress_mismatch, // `infer_types`
-            GenericArgMismatchErrorCode {
-                lifetimes: ("E0090", "E0088"),
-                types: ("E0089", "E0087"),
-            },
         )
     }
 
@@ -279,7 +269,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
         position: GenericArgPosition,
         has_self: bool,
         infer_types: bool,
-        error_codes: GenericArgMismatchErrorCode,
     ) -> bool {
         // At this stage we are guaranteed that the generic arguments are in the correct order, e.g.
         // that lifetimes will proceed types. So it suffices to check the number of each generic
@@ -325,8 +314,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
             }
         }
 
-        let check_kind_count = |error_code: (&str, &str),
-                                kind,
+        let check_kind_count = |kind,
                                 required,
                                 permitted,
                                 provided,
@@ -384,13 +372,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
                     bound,
                     provided,
                 ),
-                DiagnosticId::Error({
-                    if provided <= permitted {
-                        error_code.0
-                    } else {
-                        error_code.1
-                    }
-                }.into())
+                DiagnosticId::Error("E0107".into())
             ).span_label(span, label).emit();
 
             provided > required // `suppress_error`
@@ -398,7 +380,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
 
         if !infer_lifetimes || arg_counts.lifetimes > param_counts.lifetimes {
             check_kind_count(
-                error_codes.lifetimes,
                 "lifetime",
                 param_counts.lifetimes,
                 param_counts.lifetimes,
@@ -409,7 +390,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
         if !infer_types
             || arg_counts.types > param_counts.types - defaults.types - has_self as usize {
             check_kind_count(
-                error_codes.types,
                 "type",
                 param_counts.types - defaults.types - has_self as usize,
                 param_counts.types - has_self as usize,
@@ -587,10 +567,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
             GenericArgPosition::Type,
             has_self,
             infer_types,
-            GenericArgMismatchErrorCode {
-                lifetimes: ("E0107", "E0107"),
-                types: ("E0243", "E0244"),
-            },
         );
 
         let is_object = self_ty.map_or(false, |ty| ty.sty == TRAIT_OBJECT_DUMMY_SELF);
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index cae7b4a2862..80c1ca944bb 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -1041,9 +1041,11 @@ enum NightsWatch {}
 "##,
 
 E0087: r##"
+#### Note: this error code is no longer emitted by the compiler.
+
 Too many type arguments were supplied for a function. For example:
 
-```compile_fail,E0087
+```compile_fail,E0107
 fn foo<T>() {}
 
 fn main() {
@@ -1057,9 +1059,11 @@ parameters.
 "##,
 
 E0088: r##"
+#### Note: this error code is no longer emitted by the compiler.
+
 You gave too many lifetime arguments. Erroneous code example:
 
-```compile_fail,E0088
+```compile_fail,E0107
 fn f() {}
 
 fn main() {
@@ -1103,9 +1107,11 @@ fn main() {
 "##,
 
 E0089: r##"
+#### Note: this error code is no longer emitted by the compiler.
+
 Too few type arguments were supplied for a function. For example:
 
-```compile_fail,E0089
+```compile_fail,E0107
 fn foo<T, U>() {}
 
 fn main() {
@@ -1116,7 +1122,7 @@ fn main() {
 Note that if a function takes multiple type arguments but you want the compiler
 to infer some of them, you can use type placeholders:
 
-```compile_fail,E0089
+```compile_fail,E0107
 fn foo<T, U>(x: T) {}
 
 fn main() {
@@ -1129,9 +1135,11 @@ fn main() {
 "##,
 
 E0090: r##"
+#### Note: this error code is no longer emitted by the compiler.
+
 You gave too few lifetime arguments. Example:
 
-```compile_fail,E0090
+```compile_fail,E0107
 fn foo<'a: 'b, 'b: 'a>() {}
 
 fn main() {
@@ -1258,18 +1266,34 @@ extern "rust-intrinsic" {
 "##,
 
 E0107: r##"
-This error means that an incorrect number of lifetime parameters were provided
-for a type (like a struct or enum) or trait:
+This error means that an incorrect number of generic arguments were provided:
 
 ```compile_fail,E0107
-struct Foo<'a, 'b>(&'a str, &'b str);
-enum Bar { A, B, C }
+struct Foo<T> { x: T }
+
+struct Bar { x: Foo }             // error: wrong number of type arguments:
+                                  //        expected 1, found 0
+struct Baz<S, T> { x: Foo<S, T> } // error: wrong number of type arguments:
+                                  //        expected 1, found 2
 
-struct Baz<'a> {
-    foo: Foo<'a>, // error: expected 2, found 1
-    bar: Bar<'a>, // error: expected 0, found 1
+fn foo<T, U>(x: T, y: U) {}
+
+fn main() {
+    let x: bool = true;
+    foo::<bool>(x);                 // error: wrong number of type arguments:
+                                    //        expected 2, found 1
+    foo::<bool, i32, i32>(x, 2, 4); // error: wrong number of type arguments:
+                                    //        expected 2, found 3
+}
+
+fn f() {}
+
+fn main() {
+    f::<'static>(); // error: wrong number of lifetime arguments:
+                    //        expected 0, found 1
 }
 ```
+
 "##,
 
 E0109: r##"
@@ -2397,13 +2421,15 @@ fn baz<I>(x: &<I as Foo>::A) where I: Foo<A=Bar> {}
 "##,
 
 E0243: r##"
+#### Note: this error code is no longer emitted by the compiler.
+
 This error indicates that not enough type parameters were found in a type or
 trait.
 
 For example, the `Foo` struct below is defined to be generic in `T`, but the
 type parameter is missing in the definition of `Bar`:
 
-```compile_fail,E0243
+```compile_fail,E0107
 struct Foo<T> { x: T }
 
 struct Bar { x: Foo }
@@ -2411,13 +2437,15 @@ struct Bar { x: Foo }
 "##,
 
 E0244: r##"
+#### Note: this error code is no longer emitted by the compiler.
+
 This error indicates that too many type parameters were found in a type or
 trait.
 
 For example, the `Foo` struct below has no type parameters, but is supplied
 with two in the definition of `Bar`:
 
-```compile_fail,E0244
+```compile_fail,E0107
 struct Foo { x: bool }
 
 struct Bar<S, T> { x: Foo<S, T> }
diff --git a/src/test/ui/bad/bad-mid-path-type-params.stderr b/src/test/ui/bad/bad-mid-path-type-params.stderr
index 7901f1f0fba..2f2a74e4721 100644
--- a/src/test/ui/bad/bad-mid-path-type-params.stderr
+++ b/src/test/ui/bad/bad-mid-path-type-params.stderr
@@ -1,4 +1,4 @@
-error[E0087]: wrong number of type arguments: expected 1, found 2
+error[E0107]: wrong number of type arguments: expected 1, found 2
   --> $DIR/bad-mid-path-type-params.rs:40:28
    |
 LL |     let _ = S::new::<isize,f64>(1, 1.0);
@@ -10,13 +10,13 @@ error[E0107]: wrong number of lifetime arguments: expected 0, found 1
 LL |     let _ = S::<'a,isize>::new::<f64>(1, 1.0);
    |                 ^^ unexpected lifetime argument
 
-error[E0087]: wrong number of type arguments: expected 1, found 2
+error[E0107]: wrong number of type arguments: expected 1, found 2
   --> $DIR/bad-mid-path-type-params.rs:46:36
    |
 LL |     let _: S2 = Trait::new::<isize,f64>(1, 1.0);
    |                                    ^^^ unexpected type argument
 
-error[E0088]: wrong number of lifetime arguments: expected 0, found 1
+error[E0107]: wrong number of lifetime arguments: expected 0, found 1
   --> $DIR/bad-mid-path-type-params.rs:49:25
    |
 LL |     let _: S2 = Trait::<'a,isize>::new::<f64>(1, 1.0);
@@ -24,5 +24,4 @@ LL |     let _: S2 = Trait::<'a,isize>::new::<f64>(1, 1.0);
 
 error: aborting due to 4 previous errors
 
-Some errors occurred: E0087, E0088, E0107.
-For more information about an error, try `rustc --explain E0087`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/constructor-lifetime-args.stderr b/src/test/ui/constructor-lifetime-args.stderr
index cf3ad9ae8ec..d1d801499d3 100644
--- a/src/test/ui/constructor-lifetime-args.stderr
+++ b/src/test/ui/constructor-lifetime-args.stderr
@@ -1,22 +1,22 @@
-error[E0090]: wrong number of lifetime arguments: expected 2, found 1
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
   --> $DIR/constructor-lifetime-args.rs:27:5
    |
 LL |     S::<'static>(&0, &0);
    |     ^^^^^^^^^^^^ expected 2 lifetime arguments
 
-error[E0088]: wrong number of lifetime arguments: expected 2, found 3
+error[E0107]: wrong number of lifetime arguments: expected 2, found 3
   --> $DIR/constructor-lifetime-args.rs:29:27
    |
 LL |     S::<'static, 'static, 'static>(&0, &0);
    |                           ^^^^^^^ unexpected lifetime argument
 
-error[E0090]: wrong number of lifetime arguments: expected 2, found 1
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
   --> $DIR/constructor-lifetime-args.rs:32:5
    |
 LL |     E::V::<'static>(&0);
    |     ^^^^^^^^^^^^^^^ expected 2 lifetime arguments
 
-error[E0088]: wrong number of lifetime arguments: expected 2, found 3
+error[E0107]: wrong number of lifetime arguments: expected 2, found 3
   --> $DIR/constructor-lifetime-args.rs:34:30
    |
 LL |     E::V::<'static, 'static, 'static>(&0);
@@ -24,5 +24,4 @@ LL |     E::V::<'static, 'static, 'static>(&0);
 
 error: aborting due to 4 previous errors
 
-Some errors occurred: E0088, E0090.
-For more information about an error, try `rustc --explain E0088`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/error-codes/E0087.rs b/src/test/ui/error-codes/E0087.rs
deleted file mode 100644
index bea76f34220..00000000000
--- a/src/test/ui/error-codes/E0087.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// 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() {}
-fn bar<T>() {}
-
-fn main() {
-    foo::<f64>(); //~ ERROR wrong number of type arguments: expected 0, found 1 [E0087]
-
-    bar::<f64, u64>(); //~ ERROR wrong number of type arguments: expected 1, found 2 [E0087]
-}
diff --git a/src/test/ui/error-codes/E0087.stderr b/src/test/ui/error-codes/E0087.stderr
deleted file mode 100644
index a07f1bbf39a..00000000000
--- a/src/test/ui/error-codes/E0087.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0087]: wrong number of type arguments: expected 0, found 1
-  --> $DIR/E0087.rs:15:11
-   |
-LL |     foo::<f64>(); //~ ERROR wrong number of type arguments: expected 0, found 1 [E0087]
-   |           ^^^ unexpected type argument
-
-error[E0087]: wrong number of type arguments: expected 1, found 2
-  --> $DIR/E0087.rs:17:16
-   |
-LL |     bar::<f64, u64>(); //~ ERROR wrong number of type arguments: expected 1, found 2 [E0087]
-   |                ^^^ unexpected type argument
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0087`.
diff --git a/src/test/ui/error-codes/E0088.rs b/src/test/ui/error-codes/E0088.rs
deleted file mode 100644
index db84a4edc48..00000000000
--- a/src/test/ui/error-codes/E0088.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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 g<'a>() -> &'a u8 { loop {} }
-
-fn main() {
-    f::<'static>(); //~ ERROR E0088
-    g::<'static, 'static>(); //~ ERROR E0088
-}
diff --git a/src/test/ui/error-codes/E0088.stderr b/src/test/ui/error-codes/E0088.stderr
deleted file mode 100644
index 6b956023e05..00000000000
--- a/src/test/ui/error-codes/E0088.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0088]: wrong number of lifetime arguments: expected 0, found 1
-  --> $DIR/E0088.rs:15:9
-   |
-LL |     f::<'static>(); //~ ERROR E0088
-   |         ^^^^^^^ unexpected lifetime argument
-
-error[E0088]: wrong number of lifetime arguments: expected 1, found 2
-  --> $DIR/E0088.rs:16:18
-   |
-LL |     g::<'static, 'static>(); //~ ERROR E0088
-   |                  ^^^^^^^ unexpected lifetime argument
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0088`.
diff --git a/src/test/ui/error-codes/E0089.rs b/src/test/ui/error-codes/E0089.rs
deleted file mode 100644
index 4e6196a7b89..00000000000
--- a/src/test/ui/error-codes/E0089.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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 wrong number of type arguments: expected 2, found 1 [E0089]
-}
diff --git a/src/test/ui/error-codes/E0089.stderr b/src/test/ui/error-codes/E0089.stderr
deleted file mode 100644
index f79c478b733..00000000000
--- a/src/test/ui/error-codes/E0089.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0089]: wrong number of type arguments: expected 2, found 1
-  --> $DIR/E0089.rs:14:5
-   |
-LL |     foo::<f64>(); //~ ERROR wrong number of type arguments: expected 2, found 1 [E0089]
-   |     ^^^^^^^^^^ expected 2 type arguments
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0089`.
diff --git a/src/test/ui/error-codes/E0090.rs b/src/test/ui/error-codes/E0090.rs
deleted file mode 100644
index 26be4c12f07..00000000000
--- a/src/test/ui/error-codes/E0090.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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<'a: 'b, 'b: 'a>() {}
-
-fn main() {
-    foo::<'static>(); //~ ERROR wrong number of lifetime arguments: expected 2, found 1 [E0090]
-}
diff --git a/src/test/ui/error-codes/E0090.stderr b/src/test/ui/error-codes/E0090.stderr
deleted file mode 100644
index 9029b6c2708..00000000000
--- a/src/test/ui/error-codes/E0090.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0090]: wrong number of lifetime arguments: expected 2, found 1
-  --> $DIR/E0090.rs:14:5
-   |
-LL |     foo::<'static>(); //~ ERROR wrong number of lifetime arguments: expected 2, found 1 [E0090]
-   |     ^^^^^^^^^^^^^^ expected 2 lifetime arguments
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0090`.
diff --git a/src/test/ui/error-codes/E0243.rs b/src/test/ui/error-codes/E0243.rs
deleted file mode 100644
index 615ce0b5d42..00000000000
--- a/src/test/ui/error-codes/E0243.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// 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 wrong number of type arguments: expected 1, found 0 [E0243]
-
-fn main() {
-}
diff --git a/src/test/ui/error-codes/E0243.stderr b/src/test/ui/error-codes/E0243.stderr
deleted file mode 100644
index 0477d1b844a..00000000000
--- a/src/test/ui/error-codes/E0243.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0243]: wrong number of type arguments: expected 1, found 0
-  --> $DIR/E0243.rs:12:17
-   |
-LL | struct Bar { x: Foo }
-   |                 ^^^ expected 1 type argument
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0243`.
diff --git a/src/test/ui/error-codes/E0244.rs b/src/test/ui/error-codes/E0244.rs
deleted file mode 100644
index 9a78b3139d0..00000000000
--- a/src/test/ui/error-codes/E0244.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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 wrong number of type arguments: expected 0, found 2 [E0244]
-
-
-fn main() {
-}
diff --git a/src/test/ui/error-codes/E0244.stderr b/src/test/ui/error-codes/E0244.stderr
deleted file mode 100644
index 87f063c604f..00000000000
--- a/src/test/ui/error-codes/E0244.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0244]: wrong number of type arguments: expected 0, found 2
-  --> $DIR/E0244.rs:12:23
-   |
-LL | struct Bar<S, T> { x: Foo<S, T> }
-   |                       ^^^^^^^^^ 2 unexpected type arguments
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0244`.
diff --git a/src/test/ui/generic/generic-arg-mismatch-recover.stderr b/src/test/ui/generic/generic-arg-mismatch-recover.stderr
index 81869ad0d08..5cbaa29794f 100644
--- a/src/test/ui/generic/generic-arg-mismatch-recover.stderr
+++ b/src/test/ui/generic/generic-arg-mismatch-recover.stderr
@@ -1,4 +1,4 @@
-error[E0088]: wrong number of lifetime arguments: expected 1, found 2
+error[E0107]: wrong number of lifetime arguments: expected 1, found 2
   --> $DIR/generic-arg-mismatch-recover.rs:16:20
    |
 LL |     Foo::<'static, 'static, ()>(&0); //~ ERROR wrong number of lifetime arguments
@@ -13,13 +13,13 @@ LL |     Foo::<'static, 'static, ()>(&0); //~ ERROR wrong number of lifetime arg
    = note: expected type `&'static ()`
               found type `&{integer}`
 
-error[E0088]: wrong number of lifetime arguments: expected 1, found 2
+error[E0107]: wrong number of lifetime arguments: expected 1, found 2
   --> $DIR/generic-arg-mismatch-recover.rs:19:20
    |
 LL |     Bar::<'static, 'static, ()>(&()); //~ ERROR wrong number of lifetime arguments
    |                    ^^^^^^^ unexpected lifetime argument
 
-error[E0087]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/generic-arg-mismatch-recover.rs:19:29
    |
 LL |     Bar::<'static, 'static, ()>(&()); //~ ERROR wrong number of lifetime arguments
@@ -27,5 +27,5 @@ LL |     Bar::<'static, 'static, ()>(&()); //~ ERROR wrong number of lifetime ar
 
 error: aborting due to 4 previous errors
 
-Some errors occurred: E0087, E0088, E0308.
-For more information about an error, try `rustc --explain E0087`.
+Some errors occurred: E0107, E0308.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/generic/generic-impl-less-params-with-defaults.stderr b/src/test/ui/generic/generic-impl-less-params-with-defaults.stderr
index a10b500f9f8..94ae02a7b4b 100644
--- a/src/test/ui/generic/generic-impl-less-params-with-defaults.stderr
+++ b/src/test/ui/generic/generic-impl-less-params-with-defaults.stderr
@@ -1,4 +1,4 @@
-error[E0243]: wrong number of type arguments: expected at least 2, found 1
+error[E0107]: wrong number of type arguments: expected at least 2, found 1
   --> $DIR/generic-impl-less-params-with-defaults.rs:21:5
    |
 LL |     Foo::<isize>::new();
@@ -6,4 +6,4 @@ LL |     Foo::<isize>::new();
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0243`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/generic/generic-impl-more-params-with-defaults.stderr b/src/test/ui/generic/generic-impl-more-params-with-defaults.stderr
index 6b54baefb1d..43a7413856b 100644
--- a/src/test/ui/generic/generic-impl-more-params-with-defaults.stderr
+++ b/src/test/ui/generic/generic-impl-more-params-with-defaults.stderr
@@ -1,4 +1,4 @@
-error[E0244]: wrong number of type arguments: expected at most 2, found 3
+error[E0107]: wrong number of type arguments: expected at most 2, found 3
   --> $DIR/generic-impl-more-params-with-defaults.rs:23:5
    |
 LL |     Vec::<isize, Heap, bool>::new();
@@ -6,4 +6,4 @@ LL |     Vec::<isize, Heap, bool>::new();
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0244`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/generic/generic-type-less-params-with-defaults.rs b/src/test/ui/generic/generic-type-less-params-with-defaults.rs
index c873fa67600..295f0fbc77e 100644
--- a/src/test/ui/generic/generic-type-less-params-with-defaults.rs
+++ b/src/test/ui/generic/generic-type-less-params-with-defaults.rs
@@ -17,5 +17,5 @@ struct Vec<T, A = Heap>(
 
 fn main() {
     let _: Vec;
-    //~^ ERROR wrong number of type arguments: expected at least 1, found 0 [E0243]
+    //~^ ERROR wrong number of type arguments: expected at least 1, found 0 [E0107]
 }
diff --git a/src/test/ui/generic/generic-type-less-params-with-defaults.stderr b/src/test/ui/generic/generic-type-less-params-with-defaults.stderr
index 28867eb2254..b024be55c8d 100644
--- a/src/test/ui/generic/generic-type-less-params-with-defaults.stderr
+++ b/src/test/ui/generic/generic-type-less-params-with-defaults.stderr
@@ -1,4 +1,4 @@
-error[E0243]: wrong number of type arguments: expected at least 1, found 0
+error[E0107]: wrong number of type arguments: expected at least 1, found 0
   --> $DIR/generic-type-less-params-with-defaults.rs:19:12
    |
 LL |     let _: Vec;
@@ -6,4 +6,4 @@ LL |     let _: Vec;
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0243`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/generic/generic-type-more-params-with-defaults.rs b/src/test/ui/generic/generic-type-more-params-with-defaults.rs
index 0d1b1943ca2..84c3a2f2230 100644
--- a/src/test/ui/generic/generic-type-more-params-with-defaults.rs
+++ b/src/test/ui/generic/generic-type-more-params-with-defaults.rs
@@ -17,5 +17,5 @@ struct Vec<T, A = Heap>(
 
 fn main() {
     let _: Vec<isize, Heap, bool>;
-    //~^ ERROR wrong number of type arguments: expected at most 2, found 3 [E0244]
+    //~^ ERROR wrong number of type arguments: expected at most 2, found 3 [E0107]
 }
diff --git a/src/test/ui/generic/generic-type-more-params-with-defaults.stderr b/src/test/ui/generic/generic-type-more-params-with-defaults.stderr
index 684a22ce45c..2d3e1c5970c 100644
--- a/src/test/ui/generic/generic-type-more-params-with-defaults.stderr
+++ b/src/test/ui/generic/generic-type-more-params-with-defaults.stderr
@@ -1,4 +1,4 @@
-error[E0244]: wrong number of type arguments: expected at most 2, found 3
+error[E0107]: wrong number of type arguments: expected at most 2, found 3
   --> $DIR/generic-type-more-params-with-defaults.rs:19:12
    |
 LL |     let _: Vec<isize, Heap, bool>;
@@ -6,4 +6,4 @@ LL |     let _: Vec<isize, Heap, bool>;
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0244`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/issue-53251.stderr b/src/test/ui/issue-53251.stderr
index f12afa4a792..51ea745bedb 100644
--- a/src/test/ui/issue-53251.stderr
+++ b/src/test/ui/issue-53251.stderr
@@ -1,4 +1,4 @@
-error[E0087]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/issue-53251.rs:21:24
    |
 LL |                 S::f::<i64>();
@@ -9,4 +9,4 @@ LL | impl_add!(a b);
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0087`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/issues/issue-14092.rs b/src/test/ui/issues/issue-14092.rs
index 449de26769f..fdce4b7a31d 100644
--- a/src/test/ui/issues/issue-14092.rs
+++ b/src/test/ui/issues/issue-14092.rs
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 fn fn1(0: Box) {}
-        //~^ ERROR wrong number of type arguments: expected 1, found 0 [E0243]
+        //~^ ERROR wrong number of type arguments: expected 1, found 0 [E0107]
 
 fn main() {}
diff --git a/src/test/ui/issues/issue-14092.stderr b/src/test/ui/issues/issue-14092.stderr
index f90ea4776ab..98f18d75448 100644
--- a/src/test/ui/issues/issue-14092.stderr
+++ b/src/test/ui/issues/issue-14092.stderr
@@ -1,4 +1,4 @@
-error[E0243]: wrong number of type arguments: expected 1, found 0
+error[E0107]: wrong number of type arguments: expected 1, found 0
   --> $DIR/issue-14092.rs:11:11
    |
 LL | fn fn1(0: Box) {}
@@ -6,4 +6,4 @@ LL | fn fn1(0: Box) {}
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0243`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/issues/issue-23024.rs b/src/test/ui/issues/issue-23024.rs
index 5d9b49f486c..1c2c815ea9c 100644
--- a/src/test/ui/issues/issue-23024.rs
+++ b/src/test/ui/issues/issue-23024.rs
@@ -18,6 +18,6 @@ fn main()
     vfnfer.push(box h);
     println!("{:?}",(vfnfer[0] as Fn)(3));
     //~^ ERROR the precise format of `Fn`-family traits'
-    //~| ERROR wrong number of type arguments: expected 1, found 0 [E0243]
+    //~| ERROR wrong number of type arguments: expected 1, found 0 [E0107]
     //~| ERROR the value of the associated type `Output` (from the trait `std::ops::FnOnce`)
 }
diff --git a/src/test/ui/issues/issue-23024.stderr b/src/test/ui/issues/issue-23024.stderr
index 39c79d8f14e..129d0945303 100644
--- a/src/test/ui/issues/issue-23024.stderr
+++ b/src/test/ui/issues/issue-23024.stderr
@@ -6,7 +6,7 @@ LL |     println!("{:?}",(vfnfer[0] as Fn)(3));
    |
    = help: add #![feature(unboxed_closures)] to the crate attributes to enable
 
-error[E0243]: wrong number of type arguments: expected 1, found 0
+error[E0107]: wrong number of type arguments: expected 1, found 0
   --> $DIR/issue-23024.rs:19:35
    |
 LL |     println!("{:?}",(vfnfer[0] as Fn)(3));
@@ -20,5 +20,5 @@ LL |     println!("{:?}",(vfnfer[0] as Fn)(3));
 
 error: aborting due to 3 previous errors
 
-Some errors occurred: E0191, E0243, E0658.
-For more information about an error, try `rustc --explain E0191`.
+Some errors occurred: E0107, E0191, E0658.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/issues/issue-3214.stderr b/src/test/ui/issues/issue-3214.stderr
index 2c4b9f84105..d831be9ad3e 100644
--- a/src/test/ui/issues/issue-3214.stderr
+++ b/src/test/ui/issues/issue-3214.stderr
@@ -9,7 +9,7 @@ LL |     struct foo {
 LL |         x: T, //~ ERROR can't use type parameters from outer function
    |            ^ use of type variable from outer function
 
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/issue-3214.rs:16:26
    |
 LL |     impl<T> Drop for foo<T> {
@@ -17,5 +17,5 @@ LL |     impl<T> Drop for foo<T> {
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0244, E0401.
-For more information about an error, try `rustc --explain E0244`.
+Some errors occurred: E0107, E0401.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/methods/method-call-lifetime-args-fail.stderr b/src/test/ui/methods/method-call-lifetime-args-fail.stderr
index d86a9f48e00..ce283ec964e 100644
--- a/src/test/ui/methods/method-call-lifetime-args-fail.stderr
+++ b/src/test/ui/methods/method-call-lifetime-args-fail.stderr
@@ -1,10 +1,10 @@
-error[E0090]: wrong number of lifetime arguments: expected 2, found 1
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
   --> $DIR/method-call-lifetime-args-fail.rs:26:7
    |
 LL |     S.early::<'static>();
    |       ^^^^^ expected 2 lifetime arguments
 
-error[E0088]: wrong number of lifetime arguments: expected 2, found 3
+error[E0107]: wrong number of lifetime arguments: expected 2, found 3
   --> $DIR/method-call-lifetime-args-fail.rs:28:33
    |
 LL |     S.early::<'static, 'static, 'static>();
@@ -178,13 +178,13 @@ note: the late bound lifetime parameter is introduced here
 LL |     fn late_unused_early<'a, 'b>(self) -> &'b u8 { loop {} }
    |                          ^^
 
-error[E0090]: wrong number of lifetime arguments: expected 2, found 1
+error[E0107]: wrong number of lifetime arguments: expected 2, found 1
   --> $DIR/method-call-lifetime-args-fail.rs:73:5
    |
 LL |     S::early::<'static>(S);
    |     ^^^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments
 
-error[E0088]: wrong number of lifetime arguments: expected 2, found 3
+error[E0107]: wrong number of lifetime arguments: expected 2, found 3
   --> $DIR/method-call-lifetime-args-fail.rs:75:34
    |
 LL |     S::early::<'static, 'static, 'static>(S);
@@ -192,5 +192,4 @@ LL |     S::early::<'static, 'static, 'static>(S);
 
 error: aborting due to 18 previous errors
 
-Some errors occurred: E0088, E0090.
-For more information about an error, try `rustc --explain E0088`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/seq-args.stderr b/src/test/ui/seq-args.stderr
index 068f08eebe7..6ef9f5de4eb 100644
--- a/src/test/ui/seq-args.stderr
+++ b/src/test/ui/seq-args.stderr
@@ -1,10 +1,10 @@
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/seq-args.rs:14:13
    |
 LL | impl<T> seq<T> for Vec<T> { //~ ERROR wrong number of type arguments
    |             ^ unexpected type argument
 
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/seq-args.rs:17:10
    |
 LL | impl seq<bool> for u32 { //~ ERROR wrong number of type arguments
@@ -12,4 +12,4 @@ LL | impl seq<bool> for u32 { //~ ERROR wrong number of type arguments
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0244`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.stderr b/src/test/ui/structs/structure-constructor-type-mismatch.stderr
index dfa219e0872..97a64bf3b55 100644
--- a/src/test/ui/structs/structure-constructor-type-mismatch.stderr
+++ b/src/test/ui/structs/structure-constructor-type-mismatch.stderr
@@ -70,7 +70,7 @@ LL |         x: 7,
    = note: expected type `f32`
               found type `{integer}`
 
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/structure-constructor-type-mismatch.rs:58:24
    |
 LL |     let pt3 = PointF::<i32> { //~ ERROR wrong number of type arguments
@@ -100,7 +100,7 @@ LL |         y: 10, //~ ERROR mismatched types
    = note: expected type `f32`
               found type `{integer}`
 
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/structure-constructor-type-mismatch.rs:64:18
    |
 LL |         PointF::<u32> { .. } => {} //~ ERROR wrong number of type arguments
@@ -135,5 +135,5 @@ LL |         PairF::<u32> { .. } => {} //~ ERROR mismatched types
 
 error: aborting due to 13 previous errors
 
-Some errors occurred: E0244, E0308.
-For more information about an error, try `rustc --explain E0244`.
+Some errors occurred: E0107, E0308.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/tag-type-args.stderr b/src/test/ui/tag-type-args.stderr
index 1431ee9cc86..dffdcb20ad2 100644
--- a/src/test/ui/tag-type-args.stderr
+++ b/src/test/ui/tag-type-args.stderr
@@ -1,4 +1,4 @@
-error[E0243]: wrong number of type arguments: expected 1, found 0
+error[E0107]: wrong number of type arguments: expected 1, found 0
   --> $DIR/tag-type-args.rs:15:11
    |
 LL | fn foo(c: quux) { assert!((false)); }
@@ -6,4 +6,4 @@ LL | fn foo(c: quux) { assert!((false)); }
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0243`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/traits/trait-object-vs-lifetime.stderr b/src/test/ui/traits/trait-object-vs-lifetime.stderr
index c0b65a7aa5c..33ddb4c0ec3 100644
--- a/src/test/ui/traits/trait-object-vs-lifetime.stderr
+++ b/src/test/ui/traits/trait-object-vs-lifetime.stderr
@@ -16,7 +16,7 @@ error[E0107]: wrong number of lifetime arguments: expected 1, found 2
 LL |     let _: S<'static, 'static>;
    |                       ^^^^^^^ unexpected lifetime argument
 
-error[E0243]: wrong number of type arguments: expected 1, found 0
+error[E0107]: wrong number of type arguments: expected 1, found 0
   --> $DIR/trait-object-vs-lifetime.rs:23:12
    |
 LL |     let _: S<'static, 'static>;
@@ -30,5 +30,5 @@ LL |     let _: S<'static +, 'static>;
 
 error: aborting due to 5 previous errors
 
-Some errors occurred: E0107, E0224, E0243.
+Some errors occurred: E0107, E0224.
 For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/traits/trait-test-2.stderr b/src/test/ui/traits/trait-test-2.stderr
index fb9cd701922..1e1fcbe340e 100644
--- a/src/test/ui/traits/trait-test-2.stderr
+++ b/src/test/ui/traits/trait-test-2.stderr
@@ -1,10 +1,10 @@
-error[E0087]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/trait-test-2.rs:18:14
    |
 LL |     10.dup::<i32>(); //~ ERROR wrong number of type arguments: expected 0, found 1
    |              ^^^ unexpected type argument
 
-error[E0087]: wrong number of type arguments: expected 1, found 2
+error[E0107]: wrong number of type arguments: expected 1, found 2
   --> $DIR/trait-test-2.rs:19:20
    |
 LL |     10.blah::<i32, i32>(); //~ ERROR wrong number of type arguments: expected 1, found 2
@@ -37,5 +37,5 @@ LL |     (box 10 as Box<bar>).dup();
 
 error: aborting due to 5 previous errors
 
-Some errors occurred: E0038, E0087, E0277.
+Some errors occurred: E0038, E0107, E0277.
 For more information about an error, try `rustc --explain E0038`.
diff --git a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs
index 9285b8ca6bc..715ffe92299 100644
--- a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs
+++ b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs
@@ -9,20 +9,20 @@
 // except according to those terms.
 
 fn foo1<T:Copy<U>, U>(x: T) {}
-//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0244]
+//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0107]
 
 trait Trait: Copy<Send> {}
-//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0244]
+//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0107]
 
 struct MyStruct1<T: Copy<T>>;
-//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0244]
+//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0107]
 
 struct MyStruct2<'a, T: Copy<'a>>;
-//~^ ERROR: wrong number of lifetime arguments: expected 0, found 1
+//~^ ERROR: wrong number of lifetime arguments: expected 0, found 1 [E0107]
 
 
 fn foo2<'a, T:Copy<'a, U>, U>(x: T) {}
-//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0244]
+//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0107]
 //~| ERROR: wrong number of lifetime arguments: expected 0, found 1
 
 fn main() {
diff --git a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr
index b6444181dd8..6fc32a4fccd 100644
--- a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr
+++ b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr
@@ -1,16 +1,16 @@
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/typeck-builtin-bound-type-parameters.rs:11:16
    |
 LL | fn foo1<T:Copy<U>, U>(x: T) {}
    |                ^ unexpected type argument
 
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/typeck-builtin-bound-type-parameters.rs:14:19
    |
 LL | trait Trait: Copy<Send> {}
    |                   ^^^^ unexpected type argument
 
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/typeck-builtin-bound-type-parameters.rs:17:26
    |
 LL | struct MyStruct1<T: Copy<T>>;
@@ -28,7 +28,7 @@ error[E0107]: wrong number of lifetime arguments: expected 0, found 1
 LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {}
    |                    ^^ unexpected lifetime argument
 
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/typeck-builtin-bound-type-parameters.rs:24:24
    |
 LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {}
@@ -36,5 +36,4 @@ LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {}
 
 error: aborting due to 6 previous errors
 
-Some errors occurred: E0107, E0244.
-For more information about an error, try `rustc --explain E0107`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.rs b/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.rs
index 49774ab173a..cef7b6eebc9 100644
--- a/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.rs
+++ b/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.rs
@@ -17,5 +17,5 @@ struct Foo<'a, T:'a> {
 
 pub fn main() {
     let c: Foo<_, _> = Foo { r: &5 };
-    //~^ ERROR wrong number of type arguments: expected 1, found 2 [E0244]
+    //~^ ERROR wrong number of type arguments: expected 1, found 2 [E0107]
 }
diff --git a/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr b/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr
index a49839b7310..8da357452a7 100644
--- a/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr
+++ b/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr
@@ -1,4 +1,4 @@
-error[E0244]: wrong number of type arguments: expected 1, found 2
+error[E0107]: wrong number of type arguments: expected 1, found 2
   --> $DIR/typeck_type_placeholder_lifetime_1.rs:19:19
    |
 LL |     let c: Foo<_, _> = Foo { r: &5 };
@@ -6,4 +6,4 @@ LL |     let c: Foo<_, _> = Foo { r: &5 };
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0244`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.rs b/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.rs
index 40617613ed7..4c25a2528f0 100644
--- a/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.rs
+++ b/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.rs
@@ -17,5 +17,5 @@ struct Foo<'a, T:'a> {
 
 pub fn main() {
     let c: Foo<_, usize> = Foo { r: &5 };
-    //~^ ERROR wrong number of type arguments: expected 1, found 2 [E0244]
+    //~^ ERROR wrong number of type arguments: expected 1, found 2 [E0107]
 }
diff --git a/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr b/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr
index cafb6f507a0..c43f73a5f1a 100644
--- a/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr
+++ b/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr
@@ -1,4 +1,4 @@
-error[E0244]: wrong number of type arguments: expected 1, found 2
+error[E0107]: wrong number of type arguments: expected 1, found 2
   --> $DIR/typeck_type_placeholder_lifetime_2.rs:19:19
    |
 LL |     let c: Foo<_, usize> = Foo { r: &5 };
@@ -6,4 +6,4 @@ LL |     let c: Foo<_, usize> = Foo { r: &5 };
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0244`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr b/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr
index 2653b7bf4ac..7536205dc0f 100644
--- a/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr
+++ b/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr
@@ -1,4 +1,4 @@
-error[E0089]: wrong number of type arguments: expected 1, found 0
+error[E0107]: wrong number of type arguments: expected 1, found 0
   --> $DIR/ufcs-qpath-missing-params.rs:24:5
    |
 LL |     <String as IntoCow>::into_cow("foo".to_string());
@@ -6,4 +6,4 @@ LL |     <String as IntoCow>::into_cow("foo".to_string());
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0089`.
+For more information about this error, try `rustc --explain E0107`.
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr
index feac4274357..f15868af7c0 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr
@@ -1,4 +1,4 @@
-error[E0243]: wrong number of type arguments: expected 3, found 1
+error[E0107]: wrong number of type arguments: expected 3, found 1
   --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs:15:12
    |
 LL | fn foo(_: &Three())
@@ -12,5 +12,5 @@ LL | fn foo(_: &Three())
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0220, E0243.
-For more information about an error, try `rustc --explain E0220`.
+Some errors occurred: E0107, E0220.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr
index 89587c47cf6..d54f7741944 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr
@@ -1,4 +1,4 @@
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:15:15
    |
 LL | fn foo(_: Zero())
@@ -12,5 +12,5 @@ LL | fn foo(_: Zero())
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0220, E0244.
-For more information about an error, try `rustc --explain E0220`.
+Some errors occurred: E0107, E0220.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.rs b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.rs
index 1519ceb8988..5e4e180201d 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.rs
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.rs
@@ -13,7 +13,7 @@
 trait Trait {}
 
 fn f<F:Trait(isize) -> isize>(x: F) {}
-//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0244]
+//~^ ERROR wrong number of type arguments: expected 0, found 1 [E0107]
 //~| ERROR E0220
 
 fn main() {}
diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr
index 91f57cbd468..a4784ee0ae8 100644
--- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr
@@ -1,4 +1,4 @@
-error[E0244]: wrong number of type arguments: expected 0, found 1
+error[E0107]: wrong number of type arguments: expected 0, found 1
   --> $DIR/unboxed-closure-sugar-wrong-trait.rs:15:13
    |
 LL | fn f<F:Trait(isize) -> isize>(x: F) {}
@@ -12,5 +12,5 @@ LL | fn f<F:Trait(isize) -> isize>(x: F) {}
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0220, E0244.
-For more information about an error, try `rustc --explain E0220`.
+Some errors occurred: E0107, E0220.
+For more information about an error, try `rustc --explain E0107`.