Skip to content

Commit a254282

Browse files
committed
Fix duplicate error code
1 parent 9510add commit a254282

6 files changed

+11
-11
lines changed

src/librustc_typeck/check/wfcheck.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,11 @@ impl<'ccx, 'gcx> CheckTypeWellFormedVisitor<'ccx, 'gcx> {
300300
if !items.is_empty() {
301301
error_380(self.ccx, span);
302302
} else if has_ty_params {
303-
err = Some(struct_span_err!(self.tcx().sess, span, E0566,
303+
err = Some(struct_span_err!(self.tcx().sess, span, E0567,
304304
"traits with auto impls (`e.g. impl \
305305
Trait for ..`) can not have type parameters"));
306306
} else if has_predicates {
307-
err = Some(struct_span_err!(self.tcx().sess, span, E0565,
307+
err = Some(struct_span_err!(self.tcx().sess, span, E0568,
308308
"traits with auto impls (`e.g. impl \
309309
Trait for ..`) cannot have predicates"));
310310
}

src/librustc_typeck/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4072,6 +4072,6 @@ register_diagnostics! {
40724072
E0563, // cannot determine a type for this `impl Trait`: {}
40734073
E0564, // only named lifetimes are allowed in `impl Trait`,
40744074
// but `{}` was found in the type `{}`
4075-
E0565, // auto-traits can not have predicates,
4076-
E0566, // auto traits can not have type parameters
4075+
E0567, // auto traits can not have type parameters
4076+
E0568, // auto-traits can not have predicates,
40774077
}

src/test/compile-fail/traits-inductive-overflow-supertrait-oibit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#![feature(optin_builtin_traits)]
1616

17-
trait Magic: Copy {} //~ ERROR E0565
17+
trait Magic: Copy {} //~ ERROR E0568
1818
impl Magic for .. {}
1919

2020
fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }

src/test/compile-fail/typeck-auto-trait-no-supertraits-2.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
#![feature(optin_builtin_traits)]
1212

13-
trait Magic : Sized where Option<Self> : Magic {} //~ ERROR E0565
14-
impl Magic for .. {}
13+
trait Magic : Sized where Option<Self> : Magic {} //~ ERROR E0568
14+
impl Magic for .. {}
1515
impl<T:Magic> Magic for T {}
1616

1717
fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }

src/test/compile-fail/typeck-auto-trait-no-supertraits.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// type that contains a mutable reference, enabling
2424
// mutable aliasing.
2525
//
26-
// You can imagine an even more dangerous test,
26+
// You can imagine an even more dangerous test,
2727
// which currently compiles on nightly.
2828
//
2929
// fn main() {
@@ -34,8 +34,8 @@
3434

3535
#![feature(optin_builtin_traits)]
3636

37-
trait Magic: Copy {} //~ ERROR E0565
38-
impl Magic for .. {}
37+
trait Magic: Copy {} //~ ERROR E0568
38+
impl Magic for .. {}
3939
impl<T:Magic> Magic for T {}
4040

4141
fn copy<T: Magic>(x: T) -> (T, T) { (x, x) }

src/test/compile-fail/typeck-auto-trait-no-typeparams.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
#![feature(optin_builtin_traits)]
1212

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

0 commit comments

Comments
 (0)