diff options
| author | Nick Hamann <nick@wabbo.org> | 2015-05-19 01:32:42 -0500 |
|---|---|---|
| committer | Nick Hamann <nick@wabbo.org> | 2015-05-20 00:38:10 -0500 |
| commit | cc9d1de69251bae8b46133301fdeb0f13b8c4d51 (patch) | |
| tree | 677847009b0406f2bb65bcf9c305ba9f8f38c287 | |
| parent | 50b802ade0d9aecf3a781c98c8f051b3714db3ea (diff) | |
| download | rust-cc9d1de69251bae8b46133301fdeb0f13b8c4d51.tar.gz rust-cc9d1de69251bae8b46133301fdeb0f13b8c4d51.zip | |
Add error explanation for E0202.
| -rw-r--r-- | src/librustc_typeck/collect.rs | 2 | ||||
| -rw-r--r-- | src/librustc_typeck/diagnostics.rs | 9 | ||||
| -rw-r--r-- | src/test/compile-fail/assoc-inherent.rs | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 014991f7ea5..a20a40ea7c0 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 549478e4153..64cbbb0032c 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 e68c3e30b9a..7eab831258f 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() {} |
