diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 6e39e33c9a8..0fe703aca79 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 7b7b4d2aa00..e5c901f223f 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 168148b92fe..fe0e583b20a 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 60da647f682..f6678ac7c2d 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 177d594da18..9497dfb39d7 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 f2841a413db..5a852c54869 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 .. {}