diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 014991f7ea56..a20a40ea7c05 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -877,7 +877,7 @@ fn convert_item(ccx: &CrateCtxt, it: &ast::Item) { if let ast::TypeImplItem(ref ty) = impl_item.node { if opt_trait_ref.is_none() { span_err!(tcx.sess, impl_item.span, E0202, - "associated items are not allowed in inherent impls"); + "associated types are not allowed in inherent impls"); } as_refsociated_type(ccx, ImplContainer(local_def(it.id)), diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index 549478e4153a..64cbbb0032cc 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -573,6 +573,14 @@ impl Foo { ``` "##, +E0202: r##" +Inherent associated types were part of [RFC 195] but are not yet implemented. +See [the tracking issue][iss8995] for the status of this implementation. + +[RFC 195]: https://github.com/rust-lang/rfcs/pull/195 +[iss8995]: https://github.com/rust-lang/rust/issues/8995 +"##, + E0204: r##" An attempt to implement the `Copy` trait for a struct failed because one of the fields does not implement `Copy`. To fix this, you must implement `Copy` for the @@ -881,7 +889,6 @@ register_diagnostics! { E0194, E0195, // lifetime parameters or bounds on method do not match the trait declaration E0196, // cannot determine a type for this closure - E0202, // associated items are not allowed in inherent impls E0203, // type parameter has more than one relaxed default bound, // and only one is supported E0207, // type parameter is not constrained by the impl trait, self type, or predicate diff --git a/src/test/compile-fail/assoc-inherent.rs b/src/test/compile-fail/assoc-inherent.rs index e68c3e30b9a7..7eab831258f2 100644 --- a/src/test/compile-fail/assoc-inherent.rs +++ b/src/test/compile-fail/assoc-inherent.rs @@ -13,7 +13,7 @@ struct Foo; impl Foo { - type Bar = isize; //~ERROR associated items are not allowed in inherent impls + type Bar = isize; //~ERROR associated types are not allowed in inherent impls } fn main() {}