about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src/error_codes/E0376.md
blob: 5b564ec22fcb85f0f12e24ce77f7707c5f281db4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#### Note: this error code is no longer emitted by the compiler.

`CoerceUnsized` or `DispatchFromDyn` was implemented between two types that
are not structs.

Erroneous code example:

```compile_fail,E0377
#![feature(coerce_unsized)]
use std::ops::CoerceUnsized;

struct Foo<T: ?Sized> {
    a: T,
}

// error: The type `U` is not a struct
impl<T, U> CoerceUnsized<U> for Foo<T> {}
```

`CoerceUnsized` or `DispatchFromDyn` can only be implemented between structs.