Closed
Description
I tried this code:
trait Trait: SuperTrait {
fn array() -> [u8; <Self as SuperTrait>::SIZE];
}
trait SuperTrait {
const SIZE: usize;
}
I expected to see this happen: compiled without errors.
Instead, this happened:
error[E0277]: the trait bound `Self: SuperTrait` is not satisfied
--> src/lib.rs:2:24
|
2 | fn array() -> [u8; <Self as SuperTrait>::SIZE];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - help: consider further restricting `Self`: `where Self: SuperTrait`
| |
| the trait `SuperTrait` is not implemented for `Self`
...
6 | const SIZE: usize;
| ------------------ required by `SuperTrait::SIZE`
I'm not sure whether rustc is incapable of accessing the supertrait items (because Chalk, I guess), or whether it's erroneously detecting an error.