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

Cannot iterate over slice #6

Closed
dtolnay opened this issue Mar 6, 2017 · 1 comment
Closed

Cannot iterate over slice #6

dtolnay opened this issue Mar 6, 2017 · 1 comment

Comments

@dtolnay
Copy link
Contributor

dtolnay commented Mar 6, 2017

Would it be possible to make this work?

#[derive(Template)]
#[template(path = "test")]
struct Test<'a> {
    names: &'a [&'a str],
}
{% for n in names %}
  name = {{ n }}
{% endfor %}
error[E0277]: the trait bound `&&[&str]: std::iter::Iterator` is not satisfied
 --> src/main.rs:7:10
  |
7 | #[derive(Template)]
  |          ^^^^^^^^ the trait `std::iter::Iterator` is not implemented for `&&[&str]`
  |
  = note: `&&[&str]` is not an iterator; maybe try calling `.iter()` or a similar method
  = note: required by `std::iter::IntoIterator::into_iter`
@djc
Copy link
Owner

djc commented Mar 7, 2017

This is now covered by test_nested_for.

@djc djc closed this as completed Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants