From 5e98580ae3ff720cfdfe855e775ffe57460caea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Kijewski?= Date: Tue, 30 Jul 2024 12:52:48 +0200 Subject: [PATCH] derive: highlight value, not key --- rinja_derive/src/input.rs | 8 +-- testing/tests/ui/as-primitive-type.stderr | 24 ++++----- testing/tests/ui/block_in_filter_block.stderr | 15 ++++-- .../tests/ui/blocks_below_top_level.stderr | 34 ++++++++---- testing/tests/ui/break_outside_of_loop.stderr | 4 +- testing/tests/ui/broken-config.stderr | 16 +++--- testing/tests/ui/char_literal.stderr | 32 +++++------ testing/tests/ui/cycle.stderr | 4 +- testing/tests/ui/cycle2.stderr | 4 +- testing/tests/ui/error_file_path.stderr | 12 ++--- testing/tests/ui/excessive_nesting.stderr | 15 ++++-- testing/tests/ui/extends.stderr | 8 +-- testing/tests/ui/filter-recursion.stderr | 4 +- testing/tests/ui/filter_block_ws.stderr | 10 ++-- testing/tests/ui/include-a-folder.stderr | 4 +- testing/tests/ui/incorrect_path.stderr | 4 +- testing/tests/ui/is_defined.stderr | 24 ++++----- testing/tests/ui/iso646.stderr | 12 ++--- testing/tests/ui/json-too-many-args.stderr | 4 +- .../ui/let_destructuring_has_rest.stderr | 47 ++++++++++------ testing/tests/ui/lit_on_assignment_lhs.stderr | 4 +- testing/tests/ui/loop_cycle_empty.stderr | 4 +- .../ui/loop_cycle_wrong_argument_count.stderr | 4 +- testing/tests/ui/macro-super.stderr | 4 +- testing/tests/ui/macro.stderr | 32 +++++++---- testing/tests/ui/macro_named_argument.stderr | 53 +++++++++++++------ testing/tests/ui/match_with_extra.stderr | 15 ++++-- testing/tests/ui/multiple_extends.stderr | 10 ++-- .../tests/ui/name_mismatch_endblock.stderr | 4 +- .../tests/ui/name_mismatch_endmacro.stderr | 4 +- testing/tests/ui/no-such-escaper.stderr | 12 ++--- testing/tests/ui/num-suffix.stderr | 12 ++--- testing/tests/ui/ref_deref.stderr | 4 +- testing/tests/ui/space-pipe.stderr | 8 +-- testing/tests/ui/transclude-missing.stderr | 8 +-- testing/tests/ui/typo_in_keyword.stderr | 4 +- testing/tests/ui/unclosed-nodes.stderr | 48 ++++++++--------- 37 files changed, 306 insertions(+), 209 deletions(-) diff --git a/rinja_derive/src/input.rs b/rinja_derive/src/input.rs index 046ea83c7..ea21215ef 100644 --- a/rinja_derive/src/input.rs +++ b/rinja_derive/src/input.rs @@ -366,7 +366,7 @@ impl TemplateArgs { if ident == "path" { source_or_path(ident, value, &mut args.source, Source::Path)?; - args.ext_span = Some(ident.span()); + args.ext_span = Some(value.span()); } else if ident == "source" { source_or_path(ident, value, &mut args.source, |s| Source::Source(s.into()))?; } else if ident == "block" { @@ -395,12 +395,12 @@ impl TemplateArgs { set_template_str_attr(ident, value, &mut args.escaping)?; } else if ident == "ext" { set_template_str_attr(ident, value, &mut args.ext)?; - args.ext_span = Some(ident.span()); + args.ext_span = Some(value.span()); } else if ident == "syntax" { set_template_str_attr(ident, value, &mut args.syntax)?; } else if ident == "config" { set_template_str_attr(ident, value, &mut args.config)?; - args.config_span = Some(ident.span()) + args.config_span = Some(value.span()) } else if ident == "whitespace" { set_template_str_attr(ident, value, &mut args.whitespace)?; } else { @@ -439,7 +439,7 @@ fn source_or_path( Some(name.span()), )) } else if let syn::Lit::Str(s) = &value.lit { - *dest = Some((ctor(s.value()), Some(name.span()))); + *dest = Some((ctor(s.value()), Some(value.span()))); Ok(()) } else { Err(CompileError::no_file_info( diff --git a/testing/tests/ui/as-primitive-type.stderr b/testing/tests/ui/as-primitive-type.stderr index 0d715e109..86dba2305 100644 --- a/testing/tests/ui/as-primitive-type.stderr +++ b/testing/tests/ui/as-primitive-type.stderr @@ -1,47 +1,47 @@ error: `as` operator expects the name of a primitive type on its right-hand side --> :1:8 "as 4567 }}" - --> tests/ui/as-primitive-type.rs:4:12 + --> tests/ui/as-primitive-type.rs:4:21 | 4 | #[template(source = r#"{{ 1234 as 4567 }}"#, ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ error: `as` operator expects the name of a primitive type on its right-hand side --> :1:8 "as ? }}" - --> tests/ui/as-primitive-type.rs:8:12 + --> tests/ui/as-primitive-type.rs:8:21 | 8 | #[template(source = r#"{{ 1234 as ? }}"#, ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ error: `as` operator expects the name of a primitive type on its right-hand side, found `u1234` --> :1:8 "as u1234 }}" - --> tests/ui/as-primitive-type.rs:12:12 + --> tests/ui/as-primitive-type.rs:12:21 | 12 | #[template(source = r#"{{ 1234 as u1234 }}"#, ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ error: `as` operator expects the name of a primitive type on its right-hand side, found `core` --> :1:8 "as core::primitive::u32 }}" - --> tests/ui/as-primitive-type.rs:16:12 + --> tests/ui/as-primitive-type.rs:16:21 | 16 | #[template(source = r#"{{ 1234 as core::primitive::u32 }}"#, ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `as` operator expects the name of a primitive type on its right-hand side, found `int32_t` --> :1:8 "as int32_t }}" - --> tests/ui/as-primitive-type.rs:20:12 + --> tests/ui/as-primitive-type.rs:20:21 | 20 | #[template(source = r#"{{ 1234 as int32_t }}"#, ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `as` operator expects the name of a primitive type on its right-hand side, found `int32_t` --> :1:35 "as int32_t }}" - --> tests/ui/as-primitive-type.rs:24:12 + --> tests/ui/as-primitive-type.rs:24:21 | 24 | #[template(source = r#"{{ (1234 + 4 * 12 / 45675445 - 13) as int32_t }}"#, ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/block_in_filter_block.stderr b/testing/tests/ui/block_in_filter_block.stderr index ccd9fda71..89974337a 100644 --- a/testing/tests/ui/block_in_filter_block.stderr +++ b/testing/tests/ui/block_in_filter_block.stderr @@ -1,7 +1,14 @@ error: cannot have a block inside a filter block --> BlockInFilter.html:7:10 " block title %}New title{% endblock %}\n a b\n {% endfilter %}\n{%- endblock body %}\n" - --> tests/ui/block_in_filter_block.rs:5:5 - | -5 | source = r#"{% extends "html-base.html" %} - | ^^^^^^ + --> tests/ui/block_in_filter_block.rs:5:14 + | +5 | source = r#"{% extends "html-base.html" %} + | ______________^ +6 | | +7 | | {%- block body -%} +8 | |

Metadata

+... | +14 | | {%- endblock body %} +15 | | "#, + | |__^ diff --git a/testing/tests/ui/blocks_below_top_level.stderr b/testing/tests/ui/blocks_below_top_level.stderr index cab6e8a2b..653998a08 100644 --- a/testing/tests/ui/blocks_below_top_level.stderr +++ b/testing/tests/ui/blocks_below_top_level.stderr @@ -1,23 +1,39 @@ error: `extends` blocks are not allowed below top level --> MyTemplate1.txt:3:2 " extends \"bla.txt\" %}\n{% endblock %}\n" - --> tests/ui/blocks_below_top_level.rs:4:12 + --> tests/ui/blocks_below_top_level.rs:4:21 | -4 | #[template(source = r#" - | ^^^^^^ +4 | #[template(source = r#" + | _____________________^ +5 | | {% block bla %} +6 | | {% extends "bla.txt" %} +7 | | {% endblock %} +8 | | "#, ext = "txt")] + | |__^ error: `macro` blocks are not allowed below top level --> MyTemplate2.txt:3:2 " macro bla() %}\n{% endmacro %}\n{% endblock %}\n" - --> tests/ui/blocks_below_top_level.rs:12:12 + --> tests/ui/blocks_below_top_level.rs:12:21 | -12 | #[template(source = r#" - | ^^^^^^ +12 | #[template(source = r#" + | _____________________^ +13 | | {% block bla %} +14 | | {% macro bla() %} +15 | | {% endmacro %} +16 | | {% endblock %} +17 | | "#, ext = "txt")] + | |__^ error: `import` blocks are not allowed below top level --> MyTemplate3.txt:3:2 " import \"bla.txt\" as blue %}\n{% endblock %}\n" - --> tests/ui/blocks_below_top_level.rs:21:12 + --> tests/ui/blocks_below_top_level.rs:21:21 | -21 | #[template(source = r#" - | ^^^^^^ +21 | #[template(source = r#" + | _____________________^ +22 | | {% block bla %} +23 | | {% import "bla.txt" as blue %} +24 | | {% endblock %} +25 | | "#, ext = "txt")] + | |__^ diff --git a/testing/tests/ui/break_outside_of_loop.stderr b/testing/tests/ui/break_outside_of_loop.stderr index 1bffa3cbe..ba23ec45f 100644 --- a/testing/tests/ui/break_outside_of_loop.stderr +++ b/testing/tests/ui/break_outside_of_loop.stderr @@ -1,7 +1,7 @@ error: you can only `break` inside a `for` loop --> :1:9 "break%}, have a parsing error!" - --> tests/ui/break_outside_of_loop.rs:5:5 + --> tests/ui/break_outside_of_loop.rs:5:14 | 5 | source = "Have a {%break%}, have a parsing error!", - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/broken-config.stderr b/testing/tests/ui/broken-config.stderr index 8765b02b7..e6812a9c9 100644 --- a/testing/tests/ui/broken-config.stderr +++ b/testing/tests/ui/broken-config.stderr @@ -1,25 +1,25 @@ error: `$WORKSPACE/target/tests/trybuild/rinja_testing/no-such-config.toml` does not exist - --> tests/ui/broken-config.rs:4:38 + --> tests/ui/broken-config.rs:4:47 | 4 | #[template(source = "", ext = "txt", config = "no-such-config.toml")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ error: unable to read $WORKSPACE/target/tests/trybuild/rinja_testing/folder-config.toml: Is a directory (os error 21) - --> tests/ui/broken-config.rs:8:38 + --> tests/ui/broken-config.rs:8:47 | 8 | #[template(source = "", ext = "txt", config = "folder-config.toml")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ error: a delimiter may not be the prefix of another delimiter: "<<<" vs "<<<<" --> testing/delim-clash.toml - --> tests/ui/broken-config.rs:12:38 + --> tests/ui/broken-config.rs:12:47 | 12 | #[template(source = "", ext = "txt", config = "delim-clash.toml")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^ error: delimiters must be at least two characters long: "<" --> testing/delim-too-short.toml - --> tests/ui/broken-config.rs:16:38 + --> tests/ui/broken-config.rs:16:47 | 16 | #[template(source = "", ext = "txt", config = "delim-too-short.toml")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/char_literal.stderr b/testing/tests/ui/char_literal.stderr index 058a74497..5a116fc2d 100644 --- a/testing/tests/ui/char_literal.stderr +++ b/testing/tests/ui/char_literal.stderr @@ -1,63 +1,63 @@ error: invalid character --> testing/templates/char-literals/char-literal-1.txt:1:11 "'\\a' %}" - --> tests/ui/char_literal.rs:4:12 + --> tests/ui/char_literal.rs:4:19 | 4 | #[template(path = "char-literals/char-literal-1.txt")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: invalid character --> testing/templates/char-literals/char-literal-2.txt:1:11 "'\\x' %}" - --> tests/ui/char_literal.rs:8:12 + --> tests/ui/char_literal.rs:8:19 | 8 | #[template(path = "char-literals/char-literal-2.txt")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: invalid character --> testing/templates/char-literals/char-literal-3.txt:1:11 "'\\x1' %}" - --> tests/ui/char_literal.rs:12:12 + --> tests/ui/char_literal.rs:12:19 | 12 | #[template(path = "char-literals/char-literal-3.txt")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: must be a character in the range [\x00-\x7f] --> testing/templates/char-literals/char-literal-4.txt:1:11 "'\\x80' %}" - --> tests/ui/char_literal.rs:16:12 + --> tests/ui/char_literal.rs:16:19 | 16 | #[template(path = "char-literals/char-literal-4.txt")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: invalid character --> testing/templates/char-literals/char-literal-5.txt:1:11 "'\\u' %}" - --> tests/ui/char_literal.rs:20:12 + --> tests/ui/char_literal.rs:20:19 | 20 | #[template(path = "char-literals/char-literal-5.txt")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: invalid character --> testing/templates/char-literals/char-literal-6.txt:1:11 "'\\u{}' %}" - --> tests/ui/char_literal.rs:24:12 + --> tests/ui/char_literal.rs:24:19 | 24 | #[template(path = "char-literals/char-literal-6.txt")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: unicode escape must be at most 10FFFF --> testing/templates/char-literals/char-literal-7.txt:1:11 "'\\u{110000}' %}" - --> tests/ui/char_literal.rs:28:12 + --> tests/ui/char_literal.rs:28:19 | 28 | #[template(path = "char-literals/char-literal-7.txt")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: invalid character --> :1:11 "'aaa' %}" - --> tests/ui/char_literal.rs:32:12 + --> tests/ui/char_literal.rs:32:21 | 32 | #[template(source = "{% let s = 'aaa' %}", ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/cycle.stderr b/testing/tests/ui/cycle.stderr index ddff9a7dc..90f26b53c 100644 --- a/testing/tests/ui/cycle.stderr +++ b/testing/tests/ui/cycle.stderr @@ -2,7 +2,7 @@ error: cyclic dependency in graph [ "\"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle2.html/" --> \"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/"", "\"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/" --> \"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/"", ] - --> tests/ui/cycle.rs:4:12 + --> tests/ui/cycle.rs:4:19 | 4 | #[template(path = "cycle2.html")] - | ^^^^ + | ^^^^^^^^^^^^^ diff --git a/testing/tests/ui/cycle2.stderr b/testing/tests/ui/cycle2.stderr index c5415fbbb..08d135fe8 100644 --- a/testing/tests/ui/cycle2.stderr +++ b/testing/tests/ui/cycle2.stderr @@ -1,7 +1,7 @@ error: cyclic dependency in graph [ "\"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/" --> \"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/"", ] - --> tests/ui/cycle2.rs:4:12 + --> tests/ui/cycle2.rs:4:19 | 4 | #[template(path = "cycle1.html")] - | ^^^^ + | ^^^^^^^^^^^^^ diff --git a/testing/tests/ui/error_file_path.stderr b/testing/tests/ui/error_file_path.stderr index 4de70066b..36facafd7 100644 --- a/testing/tests/ui/error_file_path.stderr +++ b/testing/tests/ui/error_file_path.stderr @@ -1,23 +1,23 @@ error: failed to parse template source --> testing/templates/invalid_syntax.html:1:14 "}" - --> tests/ui/error_file_path.rs:4:12 + --> tests/ui/error_file_path.rs:4:19 | 4 | #[template(path = "invalid_syntax.html")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ error: failed to parse template source --> testing/templates/invalid_syntax.html:1:14 "}" - --> tests/ui/error_file_path.rs:8:12 + --> tests/ui/error_file_path.rs:8:19 | 8 | #[template(path = "include_invalid_syntax.html")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: failed to parse template source --> testing/templates/invalid_syntax.html:1:14 "}" - --> tests/ui/error_file_path.rs:12:12 + --> tests/ui/error_file_path.rs:12:21 | 12 | #[template(source = r#"{% extends "include_invalid_syntax.html" %}"#, ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/excessive_nesting.stderr b/testing/tests/ui/excessive_nesting.stderr index 46dd682d1..0fa8ebdef 100644 --- a/testing/tests/ui/excessive_nesting.stderr +++ b/testing/tests/ui/excessive_nesting.stderr @@ -1,7 +1,14 @@ error: your template code is too deeply nested, or last expression is too complex --> :14:42 "%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 200\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 300\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 400\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 500\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 600\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 700\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 800\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 900\n\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}\n {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 1000\n " - --> tests/ui/excessive_nesting.rs:5:5 - | -5 | source = " - | ^^^^^^ + --> tests/ui/excessive_nesting.rs:5:14 + | +5 | source = " + | ______________^ +6 | | {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} +7 | | {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} +8 | | {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} +... | +114 | | {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 1000 +115 | | ", + | |_____^ diff --git a/testing/tests/ui/extends.stderr b/testing/tests/ui/extends.stderr index 7a86ececf..71274cbbd 100644 --- a/testing/tests/ui/extends.stderr +++ b/testing/tests/ui/extends.stderr @@ -1,15 +1,15 @@ error: whitespace control is not allowed on `extends` --> :1:2 "- extends \"whatever.html\" %}" - --> tests/ui/extends.rs:5:5 + --> tests/ui/extends.rs:5:14 | 5 | source = r#"{%- extends "whatever.html" %}"#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: whitespace control is not allowed on `extends` --> :1:2 " extends \"whatever.html\" -%}" - --> tests/ui/extends.rs:12:5 + --> tests/ui/extends.rs:12:14 | 12 | source = r#"{% extends "whatever.html" -%}"#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/filter-recursion.stderr b/testing/tests/ui/filter-recursion.stderr index 6626e6f5f..581b41642 100644 --- a/testing/tests/ui/filter-recursion.stderr +++ b/testing/tests/ui/filter-recursion.stderr @@ -1,7 +1,7 @@ error: your template code is too deeply nested, or last expression is too complex --> testing/templates/filter-recursion.html:1:255 "|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A||A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A|A|A|A|AA|A" - --> tests/ui/filter-recursion.rs:4:12 + --> tests/ui/filter-recursion.rs:4:19 | 4 | #[template(path = "filter-recursion.html")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/filter_block_ws.stderr b/testing/tests/ui/filter_block_ws.stderr index 7487e98ed..f94c121b2 100644 --- a/testing/tests/ui/filter_block_ws.stderr +++ b/testing/tests/ui/filter_block_ws.stderr @@ -1,7 +1,11 @@ error: failed to parse template source --> :1:27 " %}\nHELLO\n{{v}}\n{%- endfilter %}" - --> tests/ui/filter_block_ws.rs:4:12 + --> tests/ui/filter_block_ws.rs:4:21 | -4 | #[template(source = "{% filter lower|indent(2) - %} - | ^^^^^^ +4 | #[template(source = "{% filter lower|indent(2) - %} + | _____________________^ +5 | | HELLO +6 | | {{v}} +7 | | {%- endfilter %}", ext = "html")] + | |_________________^ diff --git a/testing/tests/ui/include-a-folder.stderr b/testing/tests/ui/include-a-folder.stderr index d90135401..08a1cef84 100644 --- a/testing/tests/ui/include-a-folder.stderr +++ b/testing/tests/ui/include-a-folder.stderr @@ -1,7 +1,7 @@ error: unable to open template file '$WORKSPACE/target/tests/trybuild/rinja_testing/templates/a_file_that_is_actually_a_folder.html': Is a directory (os error 21) --> YouCannotIncludeFolders.txt:1:2 " include \"a_file_that_is_actually_a_folder.html\" %}" - --> tests/ui/include-a-folder.rs:4:25 + --> tests/ui/include-a-folder.rs:4:34 | 4 | #[template(ext = "txt", source = r#"{% include "a_file_that_is_actually_a_folder.html" %}"#)] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/incorrect_path.stderr b/testing/tests/ui/incorrect_path.stderr index c57f49aa3..0519b1131 100644 --- a/testing/tests/ui/incorrect_path.stderr +++ b/testing/tests/ui/incorrect_path.stderr @@ -1,5 +1,5 @@ error: template "thisdoesnotexist.html" not found in directories ["$WORKSPACE/target/tests/trybuild/rinja_testing/templates"] - --> tests/ui/incorrect_path.rs:4:12 + --> tests/ui/incorrect_path.rs:4:19 | 4 | #[template(path = "thisdoesnotexist.html")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/is_defined.stderr b/testing/tests/ui/is_defined.stderr index 9851d0f4c..3849fde89 100644 --- a/testing/tests/ui/is_defined.stderr +++ b/testing/tests/ui/is_defined.stderr @@ -1,47 +1,47 @@ error: `is defined` operator can only be used on variables, not on their fields --> :1:6 "x.y is defined %}{% endif %}" - --> tests/ui/is_defined.rs:6:5 + --> tests/ui/is_defined.rs:6:14 | 6 | source = r#"{% if x.y is defined %}{% endif %}"#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `is defined` operator can only be used on variables --> :1:6 "true is defined %}{% endif %}" - --> tests/ui/is_defined.rs:13:5 + --> tests/ui/is_defined.rs:13:14 | 13 | source = r#"{% if true is defined %}{% endif %}"#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: expected `defined` or `not defined` after `is` --> :1:6 "true is %}{% endif %}" - --> tests/ui/is_defined.rs:20:5 + --> tests/ui/is_defined.rs:20:14 | 20 | source = r#"{% if true is %}{% endif %}"#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: expected `defined` or `not defined` after `is` --> :1:6 "x is %}{% endif %}" - --> tests/ui/is_defined.rs:27:5 + --> tests/ui/is_defined.rs:27:14 | 27 | source = r#"{% if x is %}{% endif %}"#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: expected `defined` or `not defined` after `is` --> :1:6 "x is blue %}{% endif %}" - --> tests/ui/is_defined.rs:34:5 + --> tests/ui/is_defined.rs:34:14 | 34 | source = r#"{% if x is blue %}{% endif %}"#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: expected `defined` or `not defined` after `is` --> :1:6 "x is blue.red %}{% endif %}" - --> tests/ui/is_defined.rs:41:5 + --> tests/ui/is_defined.rs:41:14 | 41 | source = r#"{% if x is blue.red %}{% endif %}"#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/iso646.stderr b/testing/tests/ui/iso646.stderr index f754c8ca0..57fd27970 100644 --- a/testing/tests/ui/iso646.stderr +++ b/testing/tests/ui/iso646.stderr @@ -1,24 +1,24 @@ error: the binary AND operator is called `bitand` in rinja --> :1:6 " b }}" - --> tests/ui/iso646.rs:4:25 + --> tests/ui/iso646.rs:4:34 | 4 | #[template(ext = "txt", source = "{{ a & b }}")] - | ^^^^^^ + | ^^^^^^^^^^^^^ error: the filter operator `|` must not be preceded by any whitespace characters the binary OR operator is called `bitor` in rinja --> :1:4 " | b }}" - --> tests/ui/iso646.rs:18:25 + --> tests/ui/iso646.rs:18:34 | 18 | #[template(ext = "txt", source = "{{ a | b }}")] - | ^^^^^^ + | ^^^^^^^^^^^^^ error: the binary XOR operator is called `xor` in rinja --> :1:6 " b }}" - --> tests/ui/iso646.rs:32:25 + --> tests/ui/iso646.rs:32:34 | 32 | #[template(ext = "txt", source = "{{ a ^ b }}")] - | ^^^^^^ + | ^^^^^^^^^^^^^ diff --git a/testing/tests/ui/json-too-many-args.stderr b/testing/tests/ui/json-too-many-args.stderr index a69aea1e1..c2e59678c 100644 --- a/testing/tests/ui/json-too-many-args.stderr +++ b/testing/tests/ui/json-too-many-args.stderr @@ -1,7 +1,7 @@ error: unexpected argument(s) in `json` filter --> OneTwoThree.txt:1:3 "1|json(2, 3) }}" - --> tests/ui/json-too-many-args.rs:6:25 + --> tests/ui/json-too-many-args.rs:6:34 | 6 | #[template(ext = "txt", source = "{{ 1|json(2, 3) }}")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/let_destructuring_has_rest.stderr b/testing/tests/ui/let_destructuring_has_rest.stderr index a53e0e273..61eb6efd6 100644 --- a/testing/tests/ui/let_destructuring_has_rest.stderr +++ b/testing/tests/ui/let_destructuring_has_rest.stderr @@ -2,41 +2,56 @@ error: unexpected `,` character after `..` note that in a named struct, `..` must come last to ignore other members --> :2:20 ", } = x -%}hello {{ a }}{%- endif -%}\n" - --> tests/ui/let_destructuring_has_rest.rs:9:12 - | -9 | #[template(source = " - | ^^^^^^ + --> tests/ui/let_destructuring_has_rest.rs:9:21 + | +9 | #[template(source = " + | _____________________^ +10 | | {%- if let X { a, .., } = x -%}hello {{ a }}{%- endif -%} +11 | | ", ext = "html")] + | |_^ error: expected `,` for more members, or `}` as terminator --> :2:17 ".. } = x -%}hello {{ a }}{%- endif -%}\n" - --> tests/ui/let_destructuring_has_rest.rs:17:12 + --> tests/ui/let_destructuring_has_rest.rs:17:21 | -17 | #[template(source = " - | ^^^^^^ +17 | #[template(source = " + | _____________________^ +18 | | {%- if let X { a .. } = x -%}hello {{ a }}{%- endif -%} +19 | | ", ext = "html")] + | |_^ error: expected member, or `}` as terminator --> :2:18 "1 } = x -%}hello {{ a }}{%- endif -%}\n" - --> tests/ui/let_destructuring_has_rest.rs:25:12 + --> tests/ui/let_destructuring_has_rest.rs:25:21 | -25 | #[template(source = " - | ^^^^^^ +25 | #[template(source = " + | _____________________^ +26 | | {%- if let X { a, 1 } = x -%}hello {{ a }}{%- endif -%} +27 | | ", ext = "html")] + | |_^ error: unexpected `,` character after `..` note that in a named struct, `..` must come last to ignore other members --> :2:20 ", b } = x -%}hello {{ a }}{%- endif -%}\n" - --> tests/ui/let_destructuring_has_rest.rs:33:12 + --> tests/ui/let_destructuring_has_rest.rs:33:21 | -33 | #[template(source = " - | ^^^^^^ +33 | #[template(source = " + | _____________________^ +34 | | {%- if let X { a, .., b } = x -%}hello {{ a }}{%- endif -%} +35 | | ", ext = "html")] + | |_^ error: unexpected `,` character after `..` note that in a named struct, `..` must come last to ignore other members --> :2:17 ", b } = x -%}hello {{ a }}{%- endif -%}\n" - --> tests/ui/let_destructuring_has_rest.rs:41:12 + --> tests/ui/let_destructuring_has_rest.rs:41:21 | -41 | #[template(source = " - | ^^^^^^ +41 | #[template(source = " + | _____________________^ +42 | | {%- if let X { .., b } = x -%}hello {{ a }}{%- endif -%} +43 | | ", ext = "html")] + | |_^ diff --git a/testing/tests/ui/lit_on_assignment_lhs.stderr b/testing/tests/ui/lit_on_assignment_lhs.stderr index fd7ab00cf..b49b22265 100644 --- a/testing/tests/ui/lit_on_assignment_lhs.stderr +++ b/testing/tests/ui/lit_on_assignment_lhs.stderr @@ -1,7 +1,7 @@ error: literals are not allowed on the left-hand side of an assignment --> MyTemplate.txt:1:2 "let 7=x%}" - --> tests/ui/lit_on_assignment_lhs.rs:5:5 + --> tests/ui/lit_on_assignment_lhs.rs:5:14 | 5 | source = "{%let 7=x%}", - | ^^^^^^ + | ^^^^^^^^^^^^^ diff --git a/testing/tests/ui/loop_cycle_empty.stderr b/testing/tests/ui/loop_cycle_empty.stderr index eda9a050a..fd5335216 100644 --- a/testing/tests/ui/loop_cycle_empty.stderr +++ b/testing/tests/ui/loop_cycle_empty.stderr @@ -1,7 +1,7 @@ error: loop.cycle(…) cannot use an empty array --> ForCycleEmpty.txt:1:35 "[]) }}{{ v }},{% endfor %}" - --> tests/ui/loop_cycle_empty.rs:5:5 + --> tests/ui/loop_cycle_empty.rs:5:14 | 5 | source = r#"{% for v in values %}{{ loop.cycle([]) }}{{ v }},{% endfor %}"#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/loop_cycle_wrong_argument_count.stderr b/testing/tests/ui/loop_cycle_wrong_argument_count.stderr index 9be0c6ba5..27b489cfc 100644 --- a/testing/tests/ui/loop_cycle_wrong_argument_count.stderr +++ b/testing/tests/ui/loop_cycle_wrong_argument_count.stderr @@ -1,7 +1,7 @@ error: loop.cycle(…) cannot use an empty array --> ForCycle.txt:1:28 ".cycle(\"r\", \"g\", \"b\") }}{{ v }},{% endfor %}" - --> tests/ui/loop_cycle_wrong_argument_count.rs:5:5 + --> tests/ui/loop_cycle_wrong_argument_count.rs:5:14 | 5 | source = r#"{% for v in values %}{{ loop.cycle("r", "g", "b") }}{{ v }},{% endfor %}"#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/macro-super.stderr b/testing/tests/ui/macro-super.stderr index 5ac86a467..c03acad59 100644 --- a/testing/tests/ui/macro-super.stderr +++ b/testing/tests/ui/macro-super.stderr @@ -1,7 +1,7 @@ error: 'super' is not a valid name for a macro --> :1:2 "- macro super() -%}{%- endmacro -%}" - --> tests/ui/macro-super.rs:4:12 + --> tests/ui/macro-super.rs:4:21 | 4 | #[template(source = "{%- macro super() -%}{%- endmacro -%}", ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/macro.stderr b/testing/tests/ui/macro.stderr index 6b2a93752..3539e4325 100644 --- a/testing/tests/ui/macro.stderr +++ b/testing/tests/ui/macro.stderr @@ -1,23 +1,37 @@ error: macro "thrice" expected 1 argument, found 2 --> InvalidNumberOfArgs.html:5:2 "- call thrice(2, 3) -%}" - --> tests/ui/macro.rs:4:12 + --> tests/ui/macro.rs:4:21 | -4 | #[template(source = "{%- macro thrice(param) -%} - | ^^^^^^ +4 | #[template(source = "{%- macro thrice(param) -%} + | _____________________^ +5 | | {{ param }} +6 | | {%- endmacro -%} +7 | | +8 | | {%- call thrice(2, 3) -%}", ext = "html")] + | |__________________________^ error: macro "thrice" expected 2 arguments, found 0 --> InvalidNumberOfArgs2.html:5:2 "- call thrice() -%}" - --> tests/ui/macro.rs:12:12 + --> tests/ui/macro.rs:12:21 | -12 | #[template(source = "{%- macro thrice(param, param2) -%} - | ^^^^^^ +12 | #[template(source = "{%- macro thrice(param, param2) -%} + | _____________________^ +13 | | {{ param }} {{ param2 }} +14 | | {%- endmacro -%} +15 | | +16 | | {%- call thrice() -%}", ext = "html")] + | |______________________^ error: macro "thrice" expected 0 arguments, found 2 --> InvalidNumberOfArgs3.html:4:2 "- call thrice(1, 2) -%}" - --> tests/ui/macro.rs:20:12 + --> tests/ui/macro.rs:20:21 | -20 | #[template(source = "{%- macro thrice() -%} - | ^^^^^^ +20 | #[template(source = "{%- macro thrice() -%} + | _____________________^ +21 | | {%- endmacro -%} +22 | | +23 | | {%- call thrice(1, 2) -%}", ext = "html")] + | |__________________________^ diff --git a/testing/tests/ui/macro_named_argument.stderr b/testing/tests/ui/macro_named_argument.stderr index e132c6696..8a5e4d7fc 100644 --- a/testing/tests/ui/macro_named_argument.stderr +++ b/testing/tests/ui/macro_named_argument.stderr @@ -1,39 +1,62 @@ error: no argument named `param3` in macro "thrice" --> InvalidNamedArg.html:5:2 "- call thrice(param1=2, param3=3) -%}" - --> tests/ui/macro_named_argument.rs:4:12 + --> tests/ui/macro_named_argument.rs:4:21 | -4 | #[template(source = "{%- macro thrice(param1, param2) -%} - | ^^^^^^ +4 | #[template(source = "{%- macro thrice(param1, param2) -%} + | _____________________^ +5 | | {{ param1 }} {{ param2 }} +6 | | {%- endmacro -%} +7 | | +8 | | {%- call thrice(param1=2, param3=3) -%}", ext = "html")] + | |________________________________________^ error: named argument `param1` was passed more than once --> :5:15 "(param1=2, param1=3) -%}" - --> tests/ui/macro_named_argument.rs:12:12 + --> tests/ui/macro_named_argument.rs:12:21 | -12 | #[template(source = "{%- macro thrice(param1, param2) -%} - | ^^^^^^ +12 | #[template(source = "{%- macro thrice(param1, param2) -%} + | _____________________^ +13 | | {{ param1 }} {{ param2 }} +14 | | {%- endmacro -%} +15 | | +16 | | {%- call thrice(param1=2, param1=3) -%}", ext = "html")] + | |________________________________________^ error: failed to parse template source --> :5:29 "| filter(param1=12) -%}" - --> tests/ui/macro_named_argument.rs:21:12 + --> tests/ui/macro_named_argument.rs:21:21 | -21 | #[template(source = "{%- macro thrice(param1, param2) -%} - | ^^^^^^ +21 | #[template(source = "{%- macro thrice(param1, param2) -%} + | _____________________^ +22 | | {{ param1 }} {{ param2 }} +23 | | {%- endmacro -%} +24 | | +25 | | {%- call thrice(3, param1=2) | filter(param1=12) -%}", ext = "html")] + | |_____________________________________________________^ error: named arguments must always be passed last --> :4:15 "(param1=2, 3) -%}" - --> tests/ui/macro_named_argument.rs:30:12 + --> tests/ui/macro_named_argument.rs:30:21 | -30 | #[template(source = "{%- macro thrice(param1, param2) -%} - | ^^^^^^ +30 | #[template(source = "{%- macro thrice(param1, param2) -%} + | _____________________^ +31 | | {{ param1 }} {{ param2 }} +32 | | {%- endmacro -%} +33 | | {%- call thrice(param1=2, 3) -%}", ext = "html")] + | |_________________________________^ error: cannot have unnamed argument (`param2`) after named argument in macro "thrice" --> InvalidNamedArg5.html:4:2 "- call thrice(3, param1=2) -%}" - --> tests/ui/macro_named_argument.rs:38:12 + --> tests/ui/macro_named_argument.rs:38:21 | -38 | #[template(source = "{%- macro thrice(param1, param2) -%} - | ^^^^^^ +38 | #[template(source = "{%- macro thrice(param1, param2) -%} + | _____________________^ +39 | | {{ param1 }} {{ param2 }} +40 | | {%- endmacro -%} +41 | | {%- call thrice(3, param1=2) -%}", ext = "html")] + | |_________________________________^ diff --git a/testing/tests/ui/match_with_extra.stderr b/testing/tests/ui/match_with_extra.stderr index 9f5bdae7d..16c80b56d 100644 --- a/testing/tests/ui/match_with_extra.stderr +++ b/testing/tests/ui/match_with_extra.stderr @@ -1,7 +1,14 @@ error: failed to parse template source --> :3:4 "// Help, I forgot how to write comments!\n {%- when true %}\n good\n {%- when _ -%}\n bad\n{%- endmatch -%}" - --> tests/ui/match_with_extra.rs:6:5 - | -6 | source = r#" - | ^^^^^^ + --> tests/ui/match_with_extra.rs:6:14 + | +6 | source = r#" + | ______________^ +7 | | {%- match good -%} +8 | | // Help, I forgot how to write comments! +9 | | {%- when true %} +... | +12 | | bad +13 | | {%- endmatch -%}"# + | |__________________^ diff --git a/testing/tests/ui/multiple_extends.stderr b/testing/tests/ui/multiple_extends.stderr index 241279505..8b1960295 100644 --- a/testing/tests/ui/multiple_extends.stderr +++ b/testing/tests/ui/multiple_extends.stderr @@ -1,7 +1,11 @@ error: multiple extend blocks found --> MyTemplate4.txt:3:2 " extends \"foo.html\" %}\n" - --> tests/ui/multiple_extends.rs:4:12 + --> tests/ui/multiple_extends.rs:4:21 | -4 | #[template(source = r#" - | ^^^^^^ +4 | #[template(source = r#" + | _____________________^ +5 | | {% extends "let.html" %} +6 | | {% extends "foo.html" %} +7 | | "#, ext = "txt")] + | |__^ diff --git a/testing/tests/ui/name_mismatch_endblock.stderr b/testing/tests/ui/name_mismatch_endblock.stderr index 156ef683a..3ae992aee 100644 --- a/testing/tests/ui/name_mismatch_endblock.stderr +++ b/testing/tests/ui/name_mismatch_endblock.stderr @@ -1,7 +1,7 @@ error: expected name `foo` in `endblock` tag, found `not_foo` --> :1:27 "not_foo %}" - --> tests/ui/name_mismatch_endblock.rs:4:12 + --> tests/ui/name_mismatch_endblock.rs:4:21 | 4 | #[template(source = "{% block foo %}{% endblock not_foo %}", ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/name_mismatch_endmacro.stderr b/testing/tests/ui/name_mismatch_endmacro.stderr index bf160c305..ed0985f10 100644 --- a/testing/tests/ui/name_mismatch_endmacro.stderr +++ b/testing/tests/ui/name_mismatch_endmacro.stderr @@ -1,7 +1,7 @@ error: expected name `foo` in `endmacro` tag, found `not_foo` --> :1:41 "not_foo %}" - --> tests/ui/name_mismatch_endmacro.rs:4:12 + --> tests/ui/name_mismatch_endmacro.rs:4:21 | 4 | #[template(source = "{% macro foo(arg) %} {{arg}} {% endmacro not_foo %}", ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/no-such-escaper.stderr b/testing/tests/ui/no-such-escaper.stderr index 42f5db27f..7952c0783 100644 --- a/testing/tests/ui/no-such-escaper.stderr +++ b/testing/tests/ui/no-such-escaper.stderr @@ -1,19 +1,19 @@ error: invalid escaper 'latex' for `escape` filter. The available extensions are: "", "htm", "html", "j2", "jinja", "jinja2", "md", "none", "svg", "txt", "xml", "yml" --> LocalEscaper.html:1:38 "text|escape(\"latex\")}}`." - --> tests/ui/no-such-escaper.rs:6:5 + --> tests/ui/no-such-escaper.rs:6:14 | 6 | source = r#"In LaTeX you write `{{text}}` like `{{text|escape("latex")}}`."#, - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: no escaper defined for extension 'tex'. The available extensions are: "", "htm", "html", "j2", "jinja", "jinja2", "md", "none", "svg", "txt", "xml", "yml" - --> tests/ui/no-such-escaper.rs:14:5 + --> tests/ui/no-such-escaper.rs:14:11 | 14 | ext = "tex", - | ^^^ + | ^^^^^ error: no escaper defined for extension 'tex'. The available extensions are: "", "htm", "html", "j2", "jinja", "jinja2", "md", "none", "svg", "txt", "xml", "yml" - --> tests/ui/no-such-escaper.rs:22:12 + --> tests/ui/no-such-escaper.rs:22:19 | 22 | #[template(path = "latex-file.tex")] - | ^^^^ + | ^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/num-suffix.stderr b/testing/tests/ui/num-suffix.stderr index c4a0726f9..2e1446288 100644 --- a/testing/tests/ui/num-suffix.stderr +++ b/testing/tests/ui/num-suffix.stderr @@ -1,23 +1,23 @@ error: unknown integer suffix `x` --> :1:3 "0x0x }}" - --> tests/ui/num-suffix.rs:7:5 + --> tests/ui/num-suffix.rs:7:14 | 7 | source = "{{ 0x0x }}", - | ^^^^^^ + | ^^^^^^^^^^^^ error: unknown float suffix `f127` --> :1:3 "0.0_f127 }}" - --> tests/ui/num-suffix.rs:14:5 + --> tests/ui/num-suffix.rs:14:14 | 14 | source = "{{ 0.0_f127 }}", - | ^^^^^^ + | ^^^^^^^^^^^^^^^^ error: unknown number suffix `u321` --> :1:3 "654u321 }}" - --> tests/ui/num-suffix.rs:21:5 + --> tests/ui/num-suffix.rs:21:14 | 21 | source = "{{ 654u321 }}", - | ^^^^^^ + | ^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/ref_deref.stderr b/testing/tests/ui/ref_deref.stderr index 347f3c6ef..eb93a2121 100644 --- a/testing/tests/ui/ref_deref.stderr +++ b/testing/tests/ui/ref_deref.stderr @@ -1,7 +1,7 @@ error: failed to parse template source --> :1:7 "*x = 2 %}" - --> tests/ui/ref_deref.rs:4:12 + --> tests/ui/ref_deref.rs:4:21 | 4 | #[template(source = "{% let *x = 2 %}", ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/space-pipe.stderr b/testing/tests/ui/space-pipe.stderr index 6fb8f7504..ca16646ad 100644 --- a/testing/tests/ui/space-pipe.stderr +++ b/testing/tests/ui/space-pipe.stderr @@ -2,16 +2,16 @@ error: the filter operator `|` must not be preceded by any whitespace characters the binary OR operator is called `bitor` in rinja --> :1:3 " |lower}}" - --> tests/ui/space-pipe.rs:10:25 + --> tests/ui/space-pipe.rs:10:34 | 10 | #[template(ext = "txt", source = "{{a |lower}}")] - | ^^^^^^ + | ^^^^^^^^^^^^^^ error: the filter operator `|` must not be preceded by any whitespace characters the binary OR operator is called `bitor` in rinja --> :1:3 " | lower}}" - --> tests/ui/space-pipe.rs:22:25 + --> tests/ui/space-pipe.rs:22:34 | 22 | #[template(ext = "txt", source = "{{a | lower}}")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/transclude-missing.stderr b/testing/tests/ui/transclude-missing.stderr index 3d4e110ab..70ae829cf 100644 --- a/testing/tests/ui/transclude-missing.stderr +++ b/testing/tests/ui/transclude-missing.stderr @@ -1,15 +1,15 @@ error: template "transclude-missing.html" not found in directories ["$WORKSPACE/target/tests/trybuild/rinja_testing/templates"] --> testing/templates/transclude-there.html:1:2 " include \"transclude-missing.html\" %}" - --> tests/ui/transclude-missing.rs:4:12 + --> tests/ui/transclude-missing.rs:4:19 | 4 | #[template(path = "transclude-there.html")] - | ^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ error: template "transclude-missing.html" not found in directories ["$WORKSPACE/target/tests/trybuild/rinja_testing/templates"] --> testing/templates/transclude-there.html:1:2 " include \"transclude-missing.html\" %}" - --> tests/ui/transclude-missing.rs:8:12 + --> tests/ui/transclude-missing.rs:8:21 | 8 | #[template(source = r#"{% include "transclude-there.html" %}"#, ext = "html")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/typo_in_keyword.stderr b/testing/tests/ui/typo_in_keyword.stderr index 0bb2e3745..b18eccee7 100644 --- a/testing/tests/ui/typo_in_keyword.stderr +++ b/testing/tests/ui/typo_in_keyword.stderr @@ -1,7 +1,7 @@ error: failed to parse template source --> :1:26 "endfo%}\n1234567890123456789012345678901234567890" - --> tests/ui/typo_in_keyword.rs:5:5 + --> tests/ui/typo_in_keyword.rs:5:14 | 5 | source = "{%for i in 1..=10%}{{i}}{%endfo%}\n1234567890123456789012345678901234567890", - | ^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/testing/tests/ui/unclosed-nodes.stderr b/testing/tests/ui/unclosed-nodes.stderr index cf5b19eb9..7f81e25d2 100644 --- a/testing/tests/ui/unclosed-nodes.stderr +++ b/testing/tests/ui/unclosed-nodes.stderr @@ -1,95 +1,95 @@ error: unclosed expression, missing "}}" --> :1:0 "{{ expr" - --> tests/ui/unclosed-nodes.rs:4:12 + --> tests/ui/unclosed-nodes.rs:4:21 | 4 | #[template(source = "{{ expr", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^ error: unclosed expression, missing "}}" --> :1:0 "{{ expr " - --> tests/ui/unclosed-nodes.rs:8:12 + --> tests/ui/unclosed-nodes.rs:8:21 | 8 | #[template(source = "{{ expr ", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^ error: unclosed expression, missing "}}" --> :1:0 "{{ expr -" - --> tests/ui/unclosed-nodes.rs:12:12 + --> tests/ui/unclosed-nodes.rs:12:21 | 12 | #[template(source = "{{ expr -", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^^ error: failed to parse template source --> :1:9 "}" - --> tests/ui/unclosed-nodes.rs:16:12 + --> tests/ui/unclosed-nodes.rs:16:21 | 16 | #[template(source = "{{ expr -}", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^^^ error: unclosed block, missing "%}" --> :1:0 "{% let x" - --> tests/ui/unclosed-nodes.rs:20:12 + --> tests/ui/unclosed-nodes.rs:20:21 | 20 | #[template(source = "{% let x", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^ error: unclosed block, missing "%}" --> :1:0 "{% let x " - --> tests/ui/unclosed-nodes.rs:24:12 + --> tests/ui/unclosed-nodes.rs:24:21 | 24 | #[template(source = "{% let x ", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^^ error: unclosed block, missing "%}" --> :1:0 "{% let x -" - --> tests/ui/unclosed-nodes.rs:28:12 + --> tests/ui/unclosed-nodes.rs:28:21 | 28 | #[template(source = "{% let x -", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^^^ error: failed to parse template source --> :1:10 "%" - --> tests/ui/unclosed-nodes.rs:32:12 + --> tests/ui/unclosed-nodes.rs:32:21 | 32 | #[template(source = "{% let x -%", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^^^^ error: unclosed comment, missing "#}" --> :1:2 " comment" - --> tests/ui/unclosed-nodes.rs:36:12 + --> tests/ui/unclosed-nodes.rs:36:21 | 36 | #[template(source = "{# comment", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^^^ error: unclosed comment, missing "#}" --> :1:2 " comment " - --> tests/ui/unclosed-nodes.rs:40:12 + --> tests/ui/unclosed-nodes.rs:40:21 | 40 | #[template(source = "{# comment ", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^^^^ error: unclosed comment, missing "#}" --> :1:2 " comment -" - --> tests/ui/unclosed-nodes.rs:44:12 + --> tests/ui/unclosed-nodes.rs:44:21 | 44 | #[template(source = "{# comment -", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^^^^^ error: unclosed comment, missing "#}" --> :1:2 " comment -#" - --> tests/ui/unclosed-nodes.rs:48:12 + --> tests/ui/unclosed-nodes.rs:48:21 | 48 | #[template(source = "{# comment -#", ext = "txt")] - | ^^^^^^ + | ^^^^^^^^^^^^^^^