We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried this code:
trait Trait: SuperTrait { fn array() -> [u8; <Self as SuperTrait>::SIZE]; } trait SuperTrait { const SIZE: usize; }
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=9d962e9ed3712729d2d9150df48ecddf
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.
The text was updated successfully, but these errors were encountered:
Since fn array() -> usize { <Self as SuperTrait>::SIZE } works fine, this is a duplicate of #43408
fn array() -> usize { <Self as SuperTrait>::SIZE }
Sorry, something went wrong.
No branches or pull requests
I tried this code:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=9d962e9ed3712729d2d9150df48ecddf
I expected to see this happen: compiled without errors.
Instead, this happened:
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.
The text was updated successfully, but these errors were encountered: