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
The following code fails on nightly/beta/stable
nightly
beta
stable
trait Trait { const SIZE: usize; } fn foo<T>(v: &T) where T: Trait { [0i32; <T as Trait>::SIZE]; }
with the following error:
error[E0277]: the trait bound `T: Trait` is not satisfied --> src/lib.rs:6:12 | 6 | [0i32; <T as Trait>::SIZE]; | ^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` | = help: consider adding a `where T: Trait` bound note: required by `Trait::SIZE` --> src/lib.rs:2:5 | 2 | const SIZE: usize; | ^^^^^^^^^^^^^^^^^^
See playground at https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=94152b99b38a0faec9ef4231543cdc94
This is similar to the issues #61021 and #43580
However, the above compiles with a change of the offending line to
vec![0i32; <T as Trait>::SIZE];
Suggesting that it is specific to the constant expression being used in the array expression?
The text was updated successfully, but these errors were encountered:
Duplicate of #43408.
Sorry, something went wrong.
No branches or pull requests
The following code fails on
nightly
/beta
/stable
with the following error:
See playground at https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=94152b99b38a0faec9ef4231543cdc94
This is similar to the issues #61021 and #43580
However, the above compiles with a change of the offending line to
Suggesting that it is specific to the constant expression being used in the array expression?
The text was updated successfully, but these errors were encountered: