Compiling playground v0.0.1 (/playground)
error[E0599]: no associated item named `MAX` found for type `T` in the current scope
--> src/lib.rs:11:40
|
11 | impl<T: Trait> StorageValue<[usize; T::MAX]> for Foo<T> {
| ^^^ associated item not found in `T`
|
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `MAX`, perhaps you need to restrict type parameter `T` with it:
|
11 | impl<T: Trait + Trait> StorageValue<[usize; T::MAX]> for Foo<T> {
| ^^^^^^^^^^
error[E0599]: no associated item named `MAX` found for type `T` in the current scope
--> src/lib.rs:12:28
|
12 | fn get() -> [usize; T::MAX] {
| ^^^ associated item not found in `T`
|
= help: items from traits can only be used if the type parameter is bounded by the trait
help: the following trait defines an item `MAX`, perhaps you need to restrict type parameter `T` with it:
|
11 | impl<T: Trait + Trait> StorageValue<[usize; T::MAX]> for Foo<T> {
| ^^^^^^^^^^
As you can see, the suggestion from the compiler is to add a trait which is already there!
These are not intended to work until we get const generics. Currently you can try a very experimental verision of const generics in nightly by putting #![feature(const_generics)] at the top of main.rs or lib.rs