Fix duplicate error code
This commit is contained in:
parent
9510add6a3
commit
a25428269d
@ -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"));
|
||||
}
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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) }
|
||||
|
@ -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) }
|
||||
|
@ -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<T:Magic> Magic for T {}
|
||||
|
||||
fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }
|
||||
|
@ -10,5 +10,5 @@
|
||||
|
||||
#![feature(optin_builtin_traits)]
|
||||
|
||||
trait Magic<T> {} //~ ERROR E0566
|
||||
trait Magic<T> {} //~ ERROR E0567
|
||||
impl Magic<isize> for .. {}
|
||||
|
Loading…
Reference in New Issue
Block a user