From a25428269d8cac3ef00162a19dcbb5d5d5c47192 Mon Sep 17 00:00:00 2001 From: Jared Roesch Date: Wed, 7 Sep 2016 17:22:19 -0700 Subject: [PATCH] Fix duplicate error code --- src/librustc_typeck/check/wfcheck.rs | 4 ++-- src/librustc_typeck/diagnostics.rs | 4 ++-- .../traits-inductive-overflow-supertrait-oibit.rs | 2 +- src/test/compile-fail/typeck-auto-trait-no-supertraits-2.rs | 4 ++-- src/test/compile-fail/typeck-auto-trait-no-supertraits.rs | 6 +++--- src/test/compile-fail/typeck-auto-trait-no-typeparams.rs | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 6e39e33c9a8d5..0fe703aca79be 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -300,11 +300,11 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> { if !items.is_empty() { error_380(self.ccx, span); } else if has_ty_params { - err = Some(struct_span_err!(self.tcx().sess, span, E0566, + err = Some(struct_span_err!(self.tcx().sess, span, E0567, "traits with auto impls (`e.g. impl \ Trait for ..`) can not have type parameters")); } else if has_predicates { - err = Some(struct_span_err!(self.tcx().sess, span, E0565, + err = Some(struct_span_err!(self.tcx().sess, span, E0568, "traits with auto impls (`e.g. impl \ Trait for ..`) cannot have predicates")); } diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 7b7b4d2aa00fa..e5c901f223ffb 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -4072,6 +4072,6 @@ register_diagnostics! { E0563, // cannot determine a type for this `impl Trait`: {} E0564, // only named lifetimes are allowed in `impl Trait`, // but `{}` was found in the type `{}` - E0565, // auto-traits can not have predicates, - E0566, // auto traits can not have type parameters + E0567, // auto traits can not have type parameters + E0568, // auto-traits can not have predicates, } diff --git a/src/test/compile-fail/traits-inductive-overflow-supertrait-oibit.rs b/src/test/compile-fail/traits-inductive-overflow-supertrait-oibit.rs index 168148b92fe44..fe0e583b20a38 100644 --- a/src/test/compile-fail/traits-inductive-overflow-supertrait-oibit.rs +++ b/src/test/compile-fail/traits-inductive-overflow-supertrait-oibit.rs @@ -14,7 +14,7 @@ #![feature(optin_builtin_traits)] -trait Magic: Copy {} //~ ERROR E0565 +trait Magic: Copy {} //~ ERROR E0568 impl Magic for .. {} fn copy(x: T) -> (T, T) { (x, x) } diff --git a/src/test/compile-fail/typeck-auto-trait-no-supertraits-2.rs b/src/test/compile-fail/typeck-auto-trait-no-supertraits-2.rs index 60da647f68240..f6678ac7c2d8c 100644 --- a/src/test/compile-fail/typeck-auto-trait-no-supertraits-2.rs +++ b/src/test/compile-fail/typeck-auto-trait-no-supertraits-2.rs @@ -10,8 +10,8 @@ #![feature(optin_builtin_traits)] -trait Magic : Sized where Option : Magic {} //~ ERROR E0565 -impl Magic for .. {} +trait Magic : Sized where Option : Magic {} //~ ERROR E0568 +impl Magic for .. {} impl Magic for T {} fn copy(x: T) -> (T, T) { (x, x) } diff --git a/src/test/compile-fail/typeck-auto-trait-no-supertraits.rs b/src/test/compile-fail/typeck-auto-trait-no-supertraits.rs index 177d594da18a0..9497dfb39d7d0 100644 --- a/src/test/compile-fail/typeck-auto-trait-no-supertraits.rs +++ b/src/test/compile-fail/typeck-auto-trait-no-supertraits.rs @@ -23,7 +23,7 @@ // type that contains a mutable reference, enabling // mutable aliasing. // -// You can imagine an even more dangerous test, +// You can imagine an even more dangerous test, // which currently compiles on nightly. // // fn main() { @@ -34,8 +34,8 @@ #![feature(optin_builtin_traits)] -trait Magic: Copy {} //~ ERROR E0565 -impl Magic for .. {} +trait Magic: Copy {} //~ ERROR E0568 +impl Magic for .. {} impl Magic for T {} fn copy(x: T) -> (T, T) { (x, x) } diff --git a/src/test/compile-fail/typeck-auto-trait-no-typeparams.rs b/src/test/compile-fail/typeck-auto-trait-no-typeparams.rs index f2841a413db9e..5a852c54869a5 100644 --- a/src/test/compile-fail/typeck-auto-trait-no-typeparams.rs +++ b/src/test/compile-fail/typeck-auto-trait-no-typeparams.rs @@ -10,5 +10,5 @@ #![feature(optin_builtin_traits)] -trait Magic {} //~ ERROR E0566 +trait Magic {} //~ ERROR E0567 impl Magic for .. {}