Add error explanation for E0202.
This commit is contained in:
parent
50b802ade0
commit
cc9d1de692
@ -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)),
|
||||
|
@ -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
|
||||
|
@ -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() {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user