Skip to content

Commit

Permalink
Fix duplicate error code
Browse files Browse the repository at this point in the history
  • Loading branch information
jroesch committed Sep 8, 2016
1 parent 9510add commit a254282
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/wfcheck.rs
Expand Up @@ -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"));
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/diagnostics.rs
Expand Up @@ -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,
}
Expand Up @@ -14,7 +14,7 @@

#![feature(optin_builtin_traits)]

trait Magic: Copy {} //~ ERROR E0565
trait Magic: Copy {} //~ ERROR E0568
impl Magic for .. {}

fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/typeck-auto-trait-no-supertraits-2.rs
Expand Up @@ -10,8 +10,8 @@

#![feature(optin_builtin_traits)]

trait Magic : Sized where Option<Self> : Magic {} //~ ERROR E0565
impl Magic for .. {}
trait Magic : Sized where Option<Self> : Magic {} //~ ERROR E0568
impl Magic for .. {}
impl<T:Magic> Magic for T {}

fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
Expand Down
6 changes: 3 additions & 3 deletions src/test/compile-fail/typeck-auto-trait-no-supertraits.rs
Expand Up @@ -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() {
Expand All @@ -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<T:Magic> Magic for T {}

fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/typeck-auto-trait-no-typeparams.rs
Expand Up @@ -10,5 +10,5 @@

#![feature(optin_builtin_traits)]

trait Magic<T> {} //~ ERROR E0566
trait Magic<T> {} //~ ERROR E0567
impl Magic<isize> for .. {}

0 comments on commit a254282

Please sign in to comment.