Skip to content
New issue

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

Provide a simpler test for const-generics #14

Closed
jmg-duarte opened this issue Jan 30, 2022 · 2 comments
Closed

Provide a simpler test for const-generics #14

jmg-duarte opened this issue Jan 30, 2022 · 2 comments
Labels
good first issue Good for newcomers

Comments

@jmg-duarte
Copy link
Owner

As it stands, the test for const-generics fails for version 1.51.0

┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0277]: `[T; N]` is not an iterator
  --> tests/pass/13-const-generics.rs:11:33
   |
11 |         IntoIterator::into_iter(arr).collect()
   |                                 ^^^
   |                                 |
   |                                 expected an implementor of trait `IntoIterator`
   |                                 help: consider borrowing here: `&arr`
   |
   = note: the trait bound `[T; N]: IntoIterator` is not satisfied
   = note: required because of the requirements on the impl of `IntoIterator` for `[T; N]`
   = note: required by `into_iter`

error[E0599]: the method `collect` exists for array `[T; N]`, but its trait bounds were not satisfied
  --> tests/pass/13-const-generics.rs:11:38
   |
11 |         IntoIterator::into_iter(arr).collect()
   |                                      ^^^^^^^ method cannot be called on `[T; N]` due to unsatisfied trait bounds
   |
   = note: the following trait bounds were not satisfied:
           `[T; N]: Iterator`
           which is required by `&mut [T; N]: Iterator`
           `[T]: Iterator`
           which is required by `&mut [T]: Iterator`
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

Finding a simpler test that works would allow test runs for 1.50.0

@MingweiSamuel
Copy link
Contributor

Ah yeah arr.into_iter() is janky, requires rust 1.53 https://doc.rust-lang.org/edition-guide/rust-2021/IntoIterator-for-arrays.html

But its pretty easy to switch to something else for the example

@jmg-duarte
Copy link
Owner Author

Fixed by e59df00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants