diff options
Diffstat (limited to 'testing/tests/ui')
-rw-r--r-- | testing/tests/ui/loop_cycle_wrong_argument_count.rs | 13 | ||||
-rw-r--r-- | testing/tests/ui/loop_cycle_wrong_argument_count.stderr | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/testing/tests/ui/loop_cycle_wrong_argument_count.rs b/testing/tests/ui/loop_cycle_wrong_argument_count.rs new file mode 100644 index 0000000..e87f4f4 --- /dev/null +++ b/testing/tests/ui/loop_cycle_wrong_argument_count.rs @@ -0,0 +1,13 @@ +use askama::Template; + +#[derive(Template)] +#[template( + source = r#"{% for v in values %}{{ loop.cycle("r", "g", "b") }}{{ v }},{% endfor %}"#, + ext = "txt" +)] +struct ForCycle<'a> { + values: &'a [u8], +} + +fn main() { +} diff --git a/testing/tests/ui/loop_cycle_wrong_argument_count.stderr b/testing/tests/ui/loop_cycle_wrong_argument_count.stderr new file mode 100644 index 0000000..acf3bb1 --- /dev/null +++ b/testing/tests/ui/loop_cycle_wrong_argument_count.stderr @@ -0,0 +1,7 @@ +error: loop.cycle(…) expects exactly one argument + --> $DIR/loop_cycle_wrong_argument_count.rs:3:10 + | +3 | #[derive(Template)] + | ^^^^^^^^ + | + = note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info) |