Add error explanation for E0328.

This commit is contained in:
Lin Clark
2016-11-30 21:32:14 -05:00
parent 74e5b7d96a
commit 437c66cce5
+23 -1
View File
@@ -3087,6 +3087,29 @@ impl Foo for Bar {
```
"##,
E0328: r##"
The Unsize trait should not be implemented directly. All implementations of
Unsize are provided automatically by the compiler.
Here's an example of this error:
```compile_fail,E0328
#![feature(unsize)]
use std::marker::Unsize;
pub struct MyType;
impl<T> Unsize<T> for MyType {}
```
If you are defining your own smart pointer type and would like to enable
conversion from a sized to an unsized type with the [DST coercion system]
(https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md), use
[`CoerceUnsized`](https://doc.rust-lang.org/std/ops/trait.CoerceUnsized.html)
instead.
"##,
E0329: r##"
An attempt was made to access an associated constant through either a generic
type parameter or `Self`. This is not supported yet. An example causing this
@@ -4195,7 +4218,6 @@ fn main() {
// E0249,
// E0319, // trait impls for defaulted traits allowed just for structs/enums
E0320, // recursive overflow during dropck
E0328, // cannot implement Unsize explicitly
// E0372, // coherence not object safe
E0377, // the trait `CoerceUnsized` may only be implemented for a coercion
// between structures with the same definition