derive: way less noisy error messages

This commit is contained in:
René Kijewski 2024-07-29 13:42:45 +02:00
parent 380ecc1d8e
commit fa8c936cff
39 changed files with 437 additions and 583 deletions

View File

@ -213,10 +213,13 @@ impl Config {
} }
} }
Err(CompileError::no_file_info(format!( Err(CompileError::no_file_info(
"template {:?} not found in directories {:?}", format!(
path, self.dirs "template {:?} not found in directories {:?}",
))) path, self.dirs
),
None,
))
} }
} }
@ -319,13 +322,15 @@ impl<'a> TryInto<Syntax<'a>> for RawSyntax<'a> {
syntax.comment_end, syntax.comment_end,
] { ] {
if s.len() < 2 { if s.len() < 2 {
return Err(CompileError::no_file_info(format!( return Err(CompileError::no_file_info(
"delimiters must be at least two characters long: {s:?}" format!("delimiters must be at least two characters long: {s:?}"),
))); None,
));
} else if s.chars().any(|c| c.is_whitespace()) { } else if s.chars().any(|c| c.is_whitespace()) {
return Err(CompileError::no_file_info(format!( return Err(CompileError::no_file_info(
"delimiters may not contain white spaces: {s:?}" format!("delimiters may not contain white spaces: {s:?}"),
))); None,
));
} }
} }
@ -335,9 +340,12 @@ impl<'a> TryInto<Syntax<'a>> for RawSyntax<'a> {
(syntax.expr_start, syntax.comment_start), (syntax.expr_start, syntax.comment_start),
] { ] {
if s1.starts_with(s2) || s2.starts_with(s1) { if s1.starts_with(s2) || s2.starts_with(s1) {
return Err(CompileError::no_file_info(format!( return Err(CompileError::no_file_info(
"a delimiter may not be the prefix of another delimiter: {s1:?} vs {s2:?}", format!(
))); "a delimiter may not be the prefix of another delimiter: {s1:?} vs {s2:?}",
),
None,
));
} }
} }
@ -358,13 +366,16 @@ impl RawConfig<'_> {
#[cfg(feature = "config")] #[cfg(feature = "config")]
fn from_toml_str(s: &str) -> Result<RawConfig<'_>, CompileError> { fn from_toml_str(s: &str) -> Result<RawConfig<'_>, CompileError> {
basic_toml::from_str(s).map_err(|e| { basic_toml::from_str(s).map_err(|e| {
CompileError::no_file_info(format!("invalid TOML in {CONFIG_FILE_NAME}: {e}")) CompileError::no_file_info(format!("invalid TOML in {CONFIG_FILE_NAME}: {e}"), None)
}) })
} }
#[cfg(not(feature = "config"))] #[cfg(not(feature = "config"))]
fn from_toml_str(_: &str) -> Result<RawConfig<'_>, CompileError> { fn from_toml_str(_: &str) -> Result<RawConfig<'_>, CompileError> {
Err(CompileError::no_file_info("TOML support not available")) Err(CompileError::no_file_info(
"TOML support not available",
None,
))
} }
} }
@ -428,13 +439,13 @@ pub(crate) fn read_config_file(config_path: Option<&str>) -> Result<String, Comp
if filename.exists() { if filename.exists() {
fs::read_to_string(&filename).map_err(|_| { fs::read_to_string(&filename).map_err(|_| {
CompileError::no_file_info(format!("unable to read {:?}", filename.to_str().unwrap())) CompileError::no_file_info(format!("unable to read {}", filename.display()), None)
}) })
} else if config_path.is_some() { } else if config_path.is_some() {
Err(CompileError::no_file_info(format!( Err(CompileError::no_file_info(
"`{}` does not exist", format!("`{}` does not exist", root.display()),
root.display() None,
))) ))
} else { } else {
Ok("".to_string()) Ok("".to_string())
} }

View File

@ -2,14 +2,13 @@ use std::borrow::Cow;
use std::collections::hash_map::{Entry, HashMap}; use std::collections::hash_map::{Entry, HashMap};
use std::fs::read_to_string; use std::fs::read_to_string;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::sync::{Arc, OnceLock}; use std::sync::{Arc, OnceLock};
use mime::Mime; use mime::Mime;
use once_map::OnceMap; use once_map::OnceMap;
use parser::{Node, Parsed}; use parser::{Node, Parsed};
use quote::ToTokens;
use syn::punctuated::Punctuated; use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use crate::config::{Config, SyntaxAndCache}; use crate::config::{Config, SyntaxAndCache};
use crate::{CompileError, FileInfo, MsgValidEscapers}; use crate::{CompileError, FileInfo, MsgValidEscapers};
@ -61,6 +60,7 @@ impl TemplateInput<'_> {
(&Source::Source(_), None) => { (&Source::Source(_), None) => {
return Err(CompileError::no_file_info( return Err(CompileError::no_file_info(
"must include 'ext' attribute when using 'source' attribute", "must include 'ext' attribute when using 'source' attribute",
None,
)); ));
} }
}; };
@ -70,7 +70,7 @@ impl TemplateInput<'_> {
|| Ok(config.syntaxes.get(config.default_syntax).unwrap()), || Ok(config.syntaxes.get(config.default_syntax).unwrap()),
|s| { |s| {
config.syntaxes.get(s).ok_or_else(|| { config.syntaxes.get(s).ok_or_else(|| {
CompileError::no_file_info(format!("attribute syntax {s} not exist")) CompileError::no_file_info(format!("syntax `{s}` is undefined"), None)
}) })
}, },
)?; )?;
@ -90,10 +90,13 @@ impl TemplateInput<'_> {
.then_some(path.as_ref()) .then_some(path.as_ref())
}) })
.ok_or_else(|| { .ok_or_else(|| {
CompileError::no_file_info(format!( CompileError::no_file_info(
"no escaper defined for extension '{escaping}'. {}", format!(
MsgValidEscapers(&config.escapers), "no escaper defined for extension '{escaping}'. {}",
)) MsgValidEscapers(&config.escapers),
),
None,
)
})?; })?;
let mime_type = let mime_type =
@ -265,48 +268,57 @@ pub(crate) struct TemplateArgs {
syntax: Option<String>, syntax: Option<String>,
config: Option<String>, config: Option<String>,
pub(crate) whitespace: Option<String>, pub(crate) whitespace: Option<String>,
pub(crate) span: Option<proc_macro2::Span>,
} }
impl TemplateArgs { impl TemplateArgs {
pub(crate) fn new(ast: &'_ syn::DeriveInput) -> Result<Self, CompileError> { pub(crate) fn new(ast: &'_ syn::DeriveInput) -> Result<Self, CompileError> {
// Check that an attribute called `template()` exists once and that it is // Check that an attribute called `template()` exists once and that it is
// the proper type (list). // the proper type (list).
let mut span = None;
let mut template_args = None; let mut template_args = None;
for attr in &ast.attrs { for attr in &ast.attrs {
if !attr.path().is_ident("template") { let path = &attr.path();
if !path.is_ident("template") {
continue; continue;
} }
span = Some(path.span());
match attr.parse_args_with(Punctuated::<syn::Meta, syn::Token![,]>::parse_terminated) { match attr.parse_args_with(Punctuated::<syn::Meta, syn::Token![,]>::parse_terminated) {
Ok(args) if template_args.is_none() => template_args = Some(args), Ok(args) if template_args.is_none() => template_args = Some(args),
Ok(_) => { Ok(_) => {
return Err(CompileError::no_file_info( return Err(CompileError::no_file_info(
"duplicated 'template' attribute", "duplicated 'template' attribute",
span,
)); ));
} }
Err(e) => { Err(e) => {
return Err(CompileError::no_file_info(format!( return Err(CompileError::no_file_info(
"unable to parse template arguments: {e}" format!("unable to parse template arguments: {e}"),
))); span,
));
} }
}; };
} }
let template_args = template_args let template_args = template_args
.ok_or_else(|| CompileError::no_file_info("no attribute 'template' found"))?; .ok_or_else(|| CompileError::no_file_info("no attribute 'template' found", None))?;
let mut args = Self::default(); let mut args = Self {
span,
..Self::default()
};
// Loop over the meta attributes and find everything that we // Loop over the meta attributes and find everything that we
// understand. Return a CompileError if something is not right. // understand. Return a CompileError if something is not right.
// `source` contains an enum that can represent `path` or `source`. // `source` contains an enum that can represent `path` or `source`.
for item in template_args { for item in &template_args {
let pair = match item { let pair = match item {
syn::Meta::NameValue(pair) => pair, syn::Meta::NameValue(pair) => pair,
_ => { v => {
return Err(CompileError::no_file_info(format!( return Err(CompileError::no_file_info(
"unsupported attribute argument {:?}", "unsupported attribute argument",
item.to_token_stream() Some(v.span()),
))); ));
} }
}; };
@ -315,109 +327,66 @@ impl TemplateArgs {
None => unreachable!("not possible in syn::Meta::NameValue(…)"), None => unreachable!("not possible in syn::Meta::NameValue(…)"),
}; };
let value = match pair.value { let value = match &pair.value {
syn::Expr::Lit(lit) => lit, syn::Expr::Lit(lit) => lit,
syn::Expr::Group(group) => match *group.expr { syn::Expr::Group(group) => match &*group.expr {
syn::Expr::Lit(lit) => lit, syn::Expr::Lit(lit) => lit,
_ => { v => {
return Err(CompileError::no_file_info(format!( return Err(CompileError::no_file_info(
"unsupported argument value type for {ident:?}" format!("unsupported argument value type for `{ident}`"),
))); Some(v.span()),
));
} }
}, },
_ => { v => {
return Err(CompileError::no_file_info(format!( return Err(CompileError::no_file_info(
"unsupported argument value type for {ident:?}" format!("unsupported argument value type for `{ident}`"),
))); Some(v.span()),
));
} }
}; };
if ident == "path" { if ident == "path" {
if let syn::Lit::Str(s) = value.lit { source_or_path(ident, value, &mut args.source, Source::Path)?;
if args.source.is_some() {
return Err(CompileError::no_file_info(
"must specify 'source' or 'path', not both",
));
}
args.source = Some(Source::Path(s.value()));
} else {
return Err(CompileError::no_file_info(
"template path must be string literal",
));
}
} else if ident == "source" { } else if ident == "source" {
if let syn::Lit::Str(s) = value.lit { source_or_path(ident, value, &mut args.source, |s| Source::Source(s.into()))?;
if args.source.is_some() {
return Err(CompileError::no_file_info(
"must specify 'source' or 'path', not both",
));
}
args.source = Some(Source::Source(s.value().into()));
} else {
return Err(CompileError::no_file_info(
"template source must be string literal",
));
}
} else if ident == "block" { } else if ident == "block" {
if let syn::Lit::Str(s) = value.lit { set_template_str_attr(ident, value, &mut args.block)?;
args.block = Some(s.value());
} else {
return Err(CompileError::no_file_info(
"block value must be string literal",
));
}
} else if ident == "print" { } else if ident == "print" {
if let syn::Lit::Str(s) = value.lit { if let syn::Lit::Str(s) = &value.lit {
args.print = s.value().parse()?; args.print = match s.value().as_str() {
"all" => Print::All,
"ast" => Print::Ast,
"code" => Print::Code,
"none" => Print::None,
v => {
return Err(CompileError::no_file_info(
format!("invalid value for `print` option: {v}"),
Some(s.span()),
));
}
};
} else { } else {
return Err(CompileError::no_file_info( return Err(CompileError::no_file_info(
"print value must be string literal", "`print` value must be string literal",
Some(value.lit.span()),
)); ));
} }
} else if ident == "escape" { } else if ident == "escape" {
if let syn::Lit::Str(s) = value.lit { set_template_str_attr(ident, value, &mut args.escaping)?;
args.escaping = Some(s.value());
} else {
return Err(CompileError::no_file_info(
"escape value must be string literal",
));
}
} else if ident == "ext" { } else if ident == "ext" {
if let syn::Lit::Str(s) = value.lit { set_template_str_attr(ident, value, &mut args.ext)?;
args.ext = Some(s.value());
} else {
return Err(CompileError::no_file_info(
"ext value must be string literal",
));
}
} else if ident == "syntax" { } else if ident == "syntax" {
if let syn::Lit::Str(s) = value.lit { set_template_str_attr(ident, value, &mut args.syntax)?;
args.syntax = Some(s.value())
} else {
return Err(CompileError::no_file_info(
"syntax value must be string literal",
));
}
} else if ident == "config" { } else if ident == "config" {
if let syn::Lit::Str(s) = value.lit { set_template_str_attr(ident, value, &mut args.config)?;
args.config = Some(s.value());
} else {
return Err(CompileError::no_file_info(
"config value must be string literal",
));
}
} else if ident == "whitespace" { } else if ident == "whitespace" {
if let syn::Lit::Str(s) = value.lit { set_template_str_attr(ident, value, &mut args.whitespace)?;
args.whitespace = Some(s.value())
} else {
return Err(CompileError::no_file_info(
"whitespace value must be string literal",
));
}
} else { } else {
return Err(CompileError::no_file_info(format!( return Err(CompileError::no_file_info(
"unsupported attribute key {ident:?} found" format!("unsupported attribute key `{ident}` found"),
))); Some(ident.span()),
));
} }
} }
@ -437,6 +406,49 @@ impl TemplateArgs {
} }
} }
fn source_or_path(
name: &syn::Ident,
value: &syn::ExprLit,
dest: &mut Option<Source>,
ctor: fn(String) -> Source,
) -> Result<(), CompileError> {
if dest.is_some() {
Err(CompileError::no_file_info(
"must specify `source` OR `path` exactly once",
Some(name.span()),
))
} else if let syn::Lit::Str(s) = &value.lit {
*dest = Some(ctor(s.value()));
Ok(())
} else {
Err(CompileError::no_file_info(
format!("`{name}` value must be string literal"),
Some(value.lit.span()),
))
}
}
fn set_template_str_attr(
name: &syn::Ident,
value: &syn::ExprLit,
dest: &mut Option<String>,
) -> Result<(), CompileError> {
if dest.is_some() {
Err(CompileError::no_file_info(
format!("attribute `{name}` already set"),
Some(name.span()),
))
} else if let syn::Lit::Str(s) = &value.lit {
*dest = Some(s.value());
Ok(())
} else {
Err(CompileError::no_file_info(
format!("`{name}` value must be string literal"),
Some(value.lit.span()),
))
}
}
#[inline] #[inline]
fn ext_default_to_path<'a>(ext: Option<&'a str>, path: &'a Path) -> Option<&'a str> { fn ext_default_to_path<'a>(ext: Option<&'a str>, path: &'a Path) -> Option<&'a str> {
ext.or_else(|| extension(path)) ext.or_else(|| extension(path))
@ -470,24 +482,6 @@ pub(crate) enum Print {
None, None,
} }
impl FromStr for Print {
type Err = CompileError;
fn from_str(s: &str) -> Result<Print, Self::Err> {
Ok(match s {
"all" => Print::All,
"ast" => Print::Ast,
"code" => Print::Code,
"none" => Print::None,
v => {
return Err(CompileError::no_file_info(format!(
"invalid value for print option: {v}"
)));
}
})
}
}
impl Default for Print { impl Default for Print {
fn default() -> Self { fn default() -> Self {
Self::None Self::None
@ -521,13 +515,16 @@ const TEXT_TYPES: [(Mime, Mime); 7] = [
]; ];
fn cyclic_graph_error(dependency_graph: &[(Arc<Path>, Arc<Path>)]) -> Result<(), CompileError> { fn cyclic_graph_error(dependency_graph: &[(Arc<Path>, Arc<Path>)]) -> Result<(), CompileError> {
Err(CompileError::no_file_info(format!( Err(CompileError::no_file_info(
"cyclic dependency in graph {:#?}", format!(
dependency_graph "cyclic dependency in graph {:#?}",
.iter() dependency_graph
.map(|e| format!("{:#?} --> {:#?}", e.0, e.1)) .iter()
.collect::<Vec<String>>() .map(|e| format!("{:#?} --> {:#?}", e.0, e.1))
))) .collect::<Vec<String>>()
),
None,
))
} }
pub(crate) fn get_template_source( pub(crate) fn get_template_source(

View File

@ -93,7 +93,10 @@ pub fn derive_template(input: TokenStream12) -> TokenStream12 {
let ast = syn::parse2(input.into()).unwrap(); let ast = syn::parse2(input.into()).unwrap();
match build_template(&ast) { match build_template(&ast) {
Ok(source) => source.parse().unwrap(), Ok(source) => source.parse().unwrap(),
Err(e) => { Err(mut e) => {
if e.span.is_none() {
e.span = Some(ast.ident.span());
}
let mut e = e.into_compile_error(); let mut e = e.into_compile_error();
if let Ok(source) = build_skeleton(&ast) { if let Ok(source) = build_skeleton(&ast) {
let source: TokenStream = source.parse().unwrap(); let source: TokenStream = source.parse().unwrap();
@ -131,10 +134,23 @@ fn build_skeleton(ast: &syn::DeriveInput) -> Result<String, CompileError> {
/// value as passed to the `template()` attribute. /// value as passed to the `template()` attribute.
pub(crate) fn build_template(ast: &syn::DeriveInput) -> Result<String, CompileError> { pub(crate) fn build_template(ast: &syn::DeriveInput) -> Result<String, CompileError> {
let template_args = TemplateArgs::new(ast)?; let template_args = TemplateArgs::new(ast)?;
let mut result = build_template_inner(ast, &template_args);
if let Err(err) = &mut result {
if err.span.is_none() {
err.span = template_args.span;
}
}
result
}
fn build_template_inner(
ast: &syn::DeriveInput,
template_args: &TemplateArgs,
) -> Result<String, CompileError> {
let config_path = template_args.config_path(); let config_path = template_args.config_path();
let s = read_config_file(config_path)?; let s = read_config_file(config_path)?;
let config = Config::new(&s, config_path, template_args.whitespace.as_deref())?; let config = Config::new(&s, config_path, template_args.whitespace.as_deref())?;
let input = TemplateInput::new(ast, config, &template_args)?; let input = TemplateInput::new(ast, config, template_args)?;
let mut templates = HashMap::new(); let mut templates = HashMap::new();
input.find_used_templates(&mut templates)?; input.find_used_templates(&mut templates)?;
@ -150,10 +166,10 @@ pub(crate) fn build_template(ast: &syn::DeriveInput) -> Result<String, CompileEr
if let Some(block_name) = input.block { if let Some(block_name) = input.block {
if !heritage.blocks.contains_key(&block_name) { if !heritage.blocks.contains_key(&block_name) {
return Err(CompileError::no_file_info(format!( return Err(CompileError::no_file_info(
"cannot find block {}", format!("cannot find block {}", block_name),
block_name None,
))); ));
} }
} }
@ -184,12 +200,12 @@ pub(crate) fn build_template(ast: &syn::DeriveInput) -> Result<String, CompileEr
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
struct CompileError { struct CompileError {
msg: String, msg: String,
span: Span, span: Option<Span>,
} }
impl CompileError { impl CompileError {
fn new<S: fmt::Display>(msg: S, file_info: Option<FileInfo<'_>>) -> Self { fn new<S: fmt::Display>(msg: S, file_info: Option<FileInfo<'_>>) -> Self {
let span = Span::call_site(); let span = None;
if let Some(FileInfo { if let Some(FileInfo {
path, path,
@ -231,15 +247,15 @@ impl CompileError {
Self { msg, span } Self { msg, span }
} }
fn no_file_info<S: fmt::Display>(msg: S) -> Self { fn no_file_info<S: fmt::Display>(msg: S, span: Option<Span>) -> Self {
Self { Self {
msg: msg.to_string(), msg: msg.to_string(),
span: Span::call_site(), span,
} }
} }
fn into_compile_error(self) -> TokenStream { fn into_compile_error(self) -> TokenStream {
syn::Error::new(self.span, self.msg).to_compile_error() syn::Error::new(self.span.unwrap_or_else(Span::call_site), self.msg).to_compile_error()
} }
} }

View File

@ -4,12 +4,10 @@ error: `as` operator expects the name of a primitive type on its right-hand side
1 | {{ 1234 as 4567 }} 1 | {{ 1234 as 4567 }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/as-primitive-type.rs:3:10 --> tests/ui/as-primitive-type.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = r#"{{ 1234 as 4567 }}"#, ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `as` operator expects the name of a primitive type on its right-hand side error: `as` operator expects the name of a primitive type on its right-hand side
--> <source attribute>:1:9 --> <source attribute>:1:9
@ -17,12 +15,10 @@ error: `as` operator expects the name of a primitive type on its right-hand side
1 | {{ 1234 as ? }} 1 | {{ 1234 as ? }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/as-primitive-type.rs:7:10 --> tests/ui/as-primitive-type.rs:8:3
| |
7 | #[derive(Template)] 8 | #[template(source = r#"{{ 1234 as ? }}"#, ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `as` operator expects the name of a primitive type on its right-hand side, found `u1234` error: `as` operator expects the name of a primitive type on its right-hand side, found `u1234`
--> <source attribute>:1:9 --> <source attribute>:1:9
@ -30,12 +26,10 @@ error: `as` operator expects the name of a primitive type on its right-hand side
1 | {{ 1234 as u1234 }} 1 | {{ 1234 as u1234 }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/as-primitive-type.rs:11:10 --> tests/ui/as-primitive-type.rs:12:3
| |
11 | #[derive(Template)] 12 | #[template(source = r#"{{ 1234 as u1234 }}"#, ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `as` operator expects the name of a primitive type on its right-hand side, found `core` error: `as` operator expects the name of a primitive type on its right-hand side, found `core`
--> <source attribute>:1:9 --> <source attribute>:1:9
@ -43,12 +37,10 @@ error: `as` operator expects the name of a primitive type on its right-hand side
1 | {{ 1234 as core::primitive::u32 }} 1 | {{ 1234 as core::primitive::u32 }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/as-primitive-type.rs:15:10 --> tests/ui/as-primitive-type.rs:16:3
| |
15 | #[derive(Template)] 16 | #[template(source = r#"{{ 1234 as core::primitive::u32 }}"#, ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `as` operator expects the name of a primitive type on its right-hand side, found `int32_t` error: `as` operator expects the name of a primitive type on its right-hand side, found `int32_t`
--> <source attribute>:1:9 --> <source attribute>:1:9
@ -56,12 +48,10 @@ error: `as` operator expects the name of a primitive type on its right-hand side
1 | {{ 1234 as int32_t }} 1 | {{ 1234 as int32_t }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/as-primitive-type.rs:19:10 --> tests/ui/as-primitive-type.rs:20:3
| |
19 | #[derive(Template)] 20 | #[template(source = r#"{{ 1234 as int32_t }}"#, ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `as` operator expects the name of a primitive type on its right-hand side, found `int32_t` error: `as` operator expects the name of a primitive type on its right-hand side, found `int32_t`
--> <source attribute>:1:36 --> <source attribute>:1:36
@ -69,9 +59,7 @@ error: `as` operator expects the name of a primitive type on its right-hand side
1 | {{ (1234 + 4 * 12 / 45675445 - 13) as int32_t }} 1 | {{ (1234 + 4 * 12 / 45675445 - 13) as int32_t }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/as-primitive-type.rs:23:10 --> tests/ui/as-primitive-type.rs:24:3
| |
23 | #[derive(Template)] 24 | #[template(source = r#"{{ (1234 + 4 * 12 / 45675445 - 13) as int32_t }}"#, ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: cannot have a block inside a filter block
7 | {% block title %}New title{% endblock %} 7 | {% block title %}New title{% endblock %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/block_in_filter_block.rs:3:10 --> tests/ui/block_in_filter_block.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,12 +4,10 @@ error: `extends` blocks are not allowed below top level
3 | {% extends "bla.txt" %} 3 | {% extends "bla.txt" %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/blocks_below_top_level.rs:3:10 --> tests/ui/blocks_below_top_level.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = r#"
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `macro` blocks are not allowed below top level error: `macro` blocks are not allowed below top level
--> MyTemplate2.txt:3:3 --> MyTemplate2.txt:3:3
@ -17,12 +15,10 @@ error: `macro` blocks are not allowed below top level
3 | {% macro bla() %} 3 | {% macro bla() %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/blocks_below_top_level.rs:11:10 --> tests/ui/blocks_below_top_level.rs:12:3
| |
11 | #[derive(Template)] 12 | #[template(source = r#"
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `import` blocks are not allowed below top level error: `import` blocks are not allowed below top level
--> MyTemplate3.txt:3:3 --> MyTemplate3.txt:3:3
@ -30,9 +26,7 @@ error: `import` blocks are not allowed below top level
3 | {% import "bla.txt" as blue %} 3 | {% import "bla.txt" as blue %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/blocks_below_top_level.rs:20:10 --> tests/ui/blocks_below_top_level.rs:21:3
| |
20 | #[derive(Template)] 21 | #[template(source = r#"
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: you can only `break` inside a `for` loop
1 | Have a {%break%}, have a parsing error! 1 | Have a {%break%}, have a parsing error!
| ^ close to this token | ^ close to this token
| |
--> tests/ui/break_outside_of_loop.rs:3:10 --> tests/ui/break_outside_of_loop.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,12 +4,10 @@ error: invalid character
1 | {% let s = '\a' %} 1 | {% let s = '\a' %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/char_literal.rs:3:10 --> tests/ui/char_literal.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(path = "char-literals/char-literal-1.txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid character error: invalid character
--> testing/templates/char-literals/char-literal-2.txt:1:12 --> testing/templates/char-literals/char-literal-2.txt:1:12
@ -17,12 +15,10 @@ error: invalid character
1 | {% let s = '\x' %} 1 | {% let s = '\x' %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/char_literal.rs:7:10 --> tests/ui/char_literal.rs:8:3
| |
7 | #[derive(Template)] 8 | #[template(path = "char-literals/char-literal-2.txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid character error: invalid character
--> testing/templates/char-literals/char-literal-3.txt:1:12 --> testing/templates/char-literals/char-literal-3.txt:1:12
@ -30,12 +26,10 @@ error: invalid character
1 | {% let s = '\x1' %} 1 | {% let s = '\x1' %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/char_literal.rs:11:10 --> tests/ui/char_literal.rs:12:3
| |
11 | #[derive(Template)] 12 | #[template(path = "char-literals/char-literal-3.txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: must be a character in the range [\x00-\x7f] error: must be a character in the range [\x00-\x7f]
--> testing/templates/char-literals/char-literal-4.txt:1:12 --> testing/templates/char-literals/char-literal-4.txt:1:12
@ -43,12 +37,10 @@ error: must be a character in the range [\x00-\x7f]
1 | {% let s = '\x80' %} 1 | {% let s = '\x80' %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/char_literal.rs:15:10 --> tests/ui/char_literal.rs:16:3
| |
15 | #[derive(Template)] 16 | #[template(path = "char-literals/char-literal-4.txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid character error: invalid character
--> testing/templates/char-literals/char-literal-5.txt:1:12 --> testing/templates/char-literals/char-literal-5.txt:1:12
@ -56,12 +48,10 @@ error: invalid character
1 | {% let s = '\u' %} 1 | {% let s = '\u' %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/char_literal.rs:19:10 --> tests/ui/char_literal.rs:20:3
| |
19 | #[derive(Template)] 20 | #[template(path = "char-literals/char-literal-5.txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid character error: invalid character
--> testing/templates/char-literals/char-literal-6.txt:1:12 --> testing/templates/char-literals/char-literal-6.txt:1:12
@ -69,12 +59,10 @@ error: invalid character
1 | {% let s = '\u{}' %} 1 | {% let s = '\u{}' %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/char_literal.rs:23:10 --> tests/ui/char_literal.rs:24:3
| |
23 | #[derive(Template)] 24 | #[template(path = "char-literals/char-literal-6.txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unicode escape must be at most 10FFFF error: unicode escape must be at most 10FFFF
--> testing/templates/char-literals/char-literal-7.txt:1:12 --> testing/templates/char-literals/char-literal-7.txt:1:12
@ -82,12 +70,10 @@ error: unicode escape must be at most 10FFFF
1 | {% let s = '\u{110000}' %} 1 | {% let s = '\u{110000}' %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/char_literal.rs:27:10 --> tests/ui/char_literal.rs:28:3
| |
27 | #[derive(Template)] 28 | #[template(path = "char-literals/char-literal-7.txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: invalid character error: invalid character
--> <source attribute>:1:12 --> <source attribute>:1:12
@ -95,9 +81,7 @@ error: invalid character
1 | {% let s = 'aaa' %} 1 | {% let s = 'aaa' %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/char_literal.rs:31:10 --> tests/ui/char_literal.rs:32:3
| |
31 | #[derive(Template)] 32 | #[template(source = "{% let s = 'aaa' %}", ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -2,9 +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/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/"", "\"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/" --> \"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/"",
] ]
--> tests/ui/cycle.rs:3:10 --> tests/ui/cycle.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(path = "cycle2.html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -1,9 +1,7 @@
error: cyclic dependency in graph [ error: cyclic dependency in graph [
"\"$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/" --> \"$WORKSPACE/target/tests/trybuild/rinja_testing/templates/cycle1.html/"",
] ]
--> tests/ui/cycle2.rs:3:10 --> tests/ui/cycle2.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(path = "cycle1.html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -1,7 +1,5 @@
error: duplicated 'template' attribute error: duplicated 'template' attribute
--> tests/ui/duplicated_template_attribute.rs:3:10 --> tests/ui/duplicated_template_attribute.rs:8:3
| |
3 | #[derive(Template)] 8 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,12 +4,10 @@ error: failed to parse template source
1 | {% let 12 = 0 } 1 | {% let 12 = 0 }
| ^ close to this token | ^ close to this token
| |
--> tests/ui/error_file_path.rs:3:10 --> tests/ui/error_file_path.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(path = "invalid_syntax.html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: failed to parse template source error: failed to parse template source
--> testing/templates/invalid_syntax.html:1:15 --> testing/templates/invalid_syntax.html:1:15
@ -17,12 +15,10 @@ error: failed to parse template source
1 | {% let 12 = 0 } 1 | {% let 12 = 0 }
| ^ close to this token | ^ close to this token
| |
--> tests/ui/error_file_path.rs:7:10 --> tests/ui/error_file_path.rs:8:3
| |
7 | #[derive(Template)] 8 | #[template(path = "include_invalid_syntax.html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: failed to parse template source error: failed to parse template source
--> testing/templates/invalid_syntax.html:1:15 --> testing/templates/invalid_syntax.html:1:15
@ -30,9 +26,7 @@ error: failed to parse template source
1 | {% let 12 = 0 } 1 | {% let 12 = 0 }
| ^ close to this token | ^ close to this token
| |
--> tests/ui/error_file_path.rs:11:10 --> tests/ui/error_file_path.rs:12:3
| |
11 | #[derive(Template)] 12 | #[template(source = r#"{% extends "include_invalid_syntax.html" %}"#, ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: your template code is too deeply nested, or last expression is too comple
14 | {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%} 14 | {%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}{%if 1%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/excessive_nesting.rs:3:10 --> tests/ui/excessive_nesting.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,12 +4,10 @@ error: whitespace control is not allowed on `extends`
1 | {%- extends "whatever.html" %} 1 | {%- extends "whatever.html" %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/extends.rs:3:10 --> tests/ui/extends.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: whitespace control is not allowed on `extends` error: whitespace control is not allowed on `extends`
--> <source attribute>:1:3 --> <source attribute>:1:3
@ -17,9 +15,7 @@ error: whitespace control is not allowed on `extends`
1 | {% extends "whatever.html" -%} 1 | {% extends "whatever.html" -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/extends.rs:10:10 --> tests/ui/extends.rs:11:3
| |
10 | #[derive(Template)] 11 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: your template code is too deeply nested, or last expression is too comple
1 | ...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|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... 1 | ...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|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...
| ^ close to this token | ^ close to this token
| |
--> tests/ui/filter-recursion.rs:3:10 --> tests/ui/filter-recursion.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(path = "filter-recursion.html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: failed to parse template source
1 | {% filter lower|indent(2) - %} 1 | {% filter lower|indent(2) - %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/filter_block_ws.rs:3:10 --> tests/ui/filter_block_ws.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = "{% filter lower|indent(2) - %}
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: unable to open template file '$WORKSPACE/target/tests/trybuild/rinja_test
1 | {% include "a_file_that_is_actually_a_folder.html" %} 1 | {% include "a_file_that_is_actually_a_folder.html" %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/include-a-folder.rs:3:10 --> tests/ui/include-a-folder.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(ext = "txt", source = r#"{% include "a_file_that_is_actually_a_folder.html" %}"#)]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -1,7 +1,5 @@
error: template "thisdoesnotexist.html" not found in directories ["$WORKSPACE/target/tests/trybuild/rinja_testing/templates"] error: template "thisdoesnotexist.html" not found in directories ["$WORKSPACE/target/tests/trybuild/rinja_testing/templates"]
--> tests/ui/incorrect_path.rs:3:10 --> tests/ui/incorrect_path.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(path = "thisdoesnotexist.html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,12 +4,10 @@ error: `is defined` operator can only be used on variables, not on their fields
1 | {% if x.y is defined %}{% endif %} 1 | {% if x.y is defined %}{% endif %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/is_defined.rs:3:10 --> tests/ui/is_defined.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `is defined` operator can only be used on variables error: `is defined` operator can only be used on variables
--> <source attribute>:1:7 --> <source attribute>:1:7
@ -17,12 +15,10 @@ error: `is defined` operator can only be used on variables
1 | {% if true is defined %}{% endif %} 1 | {% if true is defined %}{% endif %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/is_defined.rs:10:10 --> tests/ui/is_defined.rs:11:3
| |
10 | #[derive(Template)] 11 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `defined` or `not defined` after `is` error: expected `defined` or `not defined` after `is`
--> <source attribute>:1:7 --> <source attribute>:1:7
@ -30,12 +26,10 @@ error: expected `defined` or `not defined` after `is`
1 | {% if true is %}{% endif %} 1 | {% if true is %}{% endif %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/is_defined.rs:17:10 --> tests/ui/is_defined.rs:18:3
| |
17 | #[derive(Template)] 18 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `defined` or `not defined` after `is` error: expected `defined` or `not defined` after `is`
--> <source attribute>:1:7 --> <source attribute>:1:7
@ -43,12 +37,10 @@ error: expected `defined` or `not defined` after `is`
1 | {% if x is %}{% endif %} 1 | {% if x is %}{% endif %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/is_defined.rs:24:10 --> tests/ui/is_defined.rs:25:3
| |
24 | #[derive(Template)] 25 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `defined` or `not defined` after `is` error: expected `defined` or `not defined` after `is`
--> <source attribute>:1:7 --> <source attribute>:1:7
@ -56,12 +48,10 @@ error: expected `defined` or `not defined` after `is`
1 | {% if x is blue %}{% endif %} 1 | {% if x is blue %}{% endif %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/is_defined.rs:31:10 --> tests/ui/is_defined.rs:32:3
| |
31 | #[derive(Template)] 32 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `defined` or `not defined` after `is` error: expected `defined` or `not defined` after `is`
--> <source attribute>:1:7 --> <source attribute>:1:7
@ -69,9 +59,7 @@ error: expected `defined` or `not defined` after `is`
1 | {% if x is blue.red %}{% endif %} 1 | {% if x is blue.red %}{% endif %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/is_defined.rs:38:10 --> tests/ui/is_defined.rs:39:3
| |
38 | #[derive(Template)] 39 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,12 +4,10 @@ error: the binary AND operator is called `bitand` in rinja
1 | {{ a & b }} 1 | {{ a & b }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/iso646.rs:3:10 --> tests/ui/iso646.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(ext = "txt", source = "{{ a & b }}")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: the filter operator `|` must not be preceded by any whitespace characters error: the filter operator `|` must not be preceded by any whitespace characters
the binary OR operator is called `bitor` in rinja the binary OR operator is called `bitor` in rinja
@ -18,12 +16,10 @@ error: the filter operator `|` must not be preceded by any whitespace characters
1 | {{ a | b }} 1 | {{ a | b }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/iso646.rs:17:10 --> tests/ui/iso646.rs:18:3
| |
17 | #[derive(Template)] 18 | #[template(ext = "txt", source = "{{ a | b }}")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: the binary XOR operator is called `xor` in rinja error: the binary XOR operator is called `xor` in rinja
--> <source attribute>:1:7 --> <source attribute>:1:7
@ -31,9 +27,7 @@ error: the binary XOR operator is called `xor` in rinja
1 | {{ a ^ b }} 1 | {{ a ^ b }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/iso646.rs:31:10 --> tests/ui/iso646.rs:32:3
| |
31 | #[derive(Template)] 32 | #[template(ext = "txt", source = "{{ a ^ b }}")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: unexpected argument(s) in `json` filter
1 | {{ 1|json(2, 3) }} 1 | {{ 1|json(2, 3) }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/json-too-many-args.rs:5:10 --> tests/ui/json-too-many-args.rs:6:3
| |
5 | #[derive(Template)] 6 | #[template(ext = "txt", source = "{{ 1|json(2, 3) }}")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -5,12 +5,10 @@ error: unexpected `,` character after `..`
2 | {%- if let X { a, .., } = x -%}hello {{ a }}{%- endif -%} 2 | {%- if let X { a, .., } = x -%}hello {{ a }}{%- endif -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/let_destructuring_has_rest.rs:8:10 --> tests/ui/let_destructuring_has_rest.rs:9:3
| |
8 | #[derive(Template)] 9 | #[template(source = "
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `,` for more members, or `}` as terminator error: expected `,` for more members, or `}` as terminator
--> <source attribute>:2:18 --> <source attribute>:2:18
@ -18,12 +16,10 @@ error: expected `,` for more members, or `}` as terminator
2 | {%- if let X { a .. } = x -%}hello {{ a }}{%- endif -%} 2 | {%- if let X { a .. } = x -%}hello {{ a }}{%- endif -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/let_destructuring_has_rest.rs:16:10 --> tests/ui/let_destructuring_has_rest.rs:17:3
| |
16 | #[derive(Template)] 17 | #[template(source = "
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected member, or `}` as terminator error: expected member, or `}` as terminator
--> <source attribute>:2:19 --> <source attribute>:2:19
@ -31,12 +27,10 @@ error: expected member, or `}` as terminator
2 | {%- if let X { a, 1 } = x -%}hello {{ a }}{%- endif -%} 2 | {%- if let X { a, 1 } = x -%}hello {{ a }}{%- endif -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/let_destructuring_has_rest.rs:24:10 --> tests/ui/let_destructuring_has_rest.rs:25:3
| |
24 | #[derive(Template)] 25 | #[template(source = "
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected `,` character after `..` error: unexpected `,` character after `..`
note that in a named struct, `..` must come last to ignore other members note that in a named struct, `..` must come last to ignore other members
@ -45,12 +39,10 @@ error: unexpected `,` character after `..`
2 | {%- if let X { a, .., b } = x -%}hello {{ a }}{%- endif -%} 2 | {%- if let X { a, .., b } = x -%}hello {{ a }}{%- endif -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/let_destructuring_has_rest.rs:32:10 --> tests/ui/let_destructuring_has_rest.rs:33:3
| |
32 | #[derive(Template)] 33 | #[template(source = "
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected `,` character after `..` error: unexpected `,` character after `..`
note that in a named struct, `..` must come last to ignore other members note that in a named struct, `..` must come last to ignore other members
@ -59,9 +51,7 @@ error: unexpected `,` character after `..`
2 | {%- if let X { .., b } = x -%}hello {{ a }}{%- endif -%} 2 | {%- if let X { .., b } = x -%}hello {{ a }}{%- endif -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/let_destructuring_has_rest.rs:40:10 --> tests/ui/let_destructuring_has_rest.rs:41:3
| |
40 | #[derive(Template)] 41 | #[template(source = "
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: literals are not allowed on the left-hand side of an assignment
1 | {%let 7=x%} 1 | {%let 7=x%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/lit_on_assignment_lhs.rs:3:10 --> tests/ui/lit_on_assignment_lhs.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: loop.cycle(…) cannot use an empty array
1 | {% for v in values %}{{ loop.cycle([]) }}{{ v }},{% endfor %} 1 | {% for v in values %}{{ loop.cycle([]) }}{{ v }},{% endfor %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/loop_cycle_empty.rs:3:10 --> tests/ui/loop_cycle_empty.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: loop.cycle(…) cannot use an empty array
1 | {% for v in values %}{{ loop.cycle("r", "g", "b") }}{{ v }},{% endfor %} 1 | {% for v in values %}{{ loop.cycle("r", "g", "b") }}{{ v }},{% endfor %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/loop_cycle_wrong_argument_count.rs:3:10 --> tests/ui/loop_cycle_wrong_argument_count.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: 'super' is not a valid name for a macro
1 | {%- macro super() -%}{%- endmacro -%} 1 | {%- macro super() -%}{%- endmacro -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/macro-super.rs:3:10 --> tests/ui/macro-super.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = "{%- macro super() -%}{%- endmacro -%}", ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,12 +4,10 @@ error: macro "thrice" expected 1 argument, found 2
5 | {%- call thrice(2, 3) -%} 5 | {%- call thrice(2, 3) -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/macro.rs:3:10 --> tests/ui/macro.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = "{%- macro thrice(param) -%}
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: macro "thrice" expected 2 arguments, found 0 error: macro "thrice" expected 2 arguments, found 0
--> InvalidNumberOfArgs2.html:5:3 --> InvalidNumberOfArgs2.html:5:3
@ -17,12 +15,10 @@ error: macro "thrice" expected 2 arguments, found 0
5 | {%- call thrice() -%} 5 | {%- call thrice() -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/macro.rs:11:10 --> tests/ui/macro.rs:12:3
| |
11 | #[derive(Template)] 12 | #[template(source = "{%- macro thrice(param, param2) -%}
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: macro "thrice" expected 0 arguments, found 2 error: macro "thrice" expected 0 arguments, found 2
--> InvalidNumberOfArgs3.html:4:3 --> InvalidNumberOfArgs3.html:4:3
@ -30,9 +26,7 @@ error: macro "thrice" expected 0 arguments, found 2
4 | {%- call thrice(1, 2) -%} 4 | {%- call thrice(1, 2) -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/macro.rs:19:10 --> tests/ui/macro.rs:20:3
| |
19 | #[derive(Template)] 20 | #[template(source = "{%- macro thrice() -%}
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,12 +4,10 @@ error: no argument named `param3` in macro "thrice"
5 | {%- call thrice(param1=2, param3=3) -%} 5 | {%- call thrice(param1=2, param3=3) -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/macro_named_argument.rs:3:10 --> tests/ui/macro_named_argument.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = "{%- macro thrice(param1, param2) -%}
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: named argument `param1` was passed more than once error: named argument `param1` was passed more than once
--> <source attribute>:5:16 --> <source attribute>:5:16
@ -17,12 +15,10 @@ error: named argument `param1` was passed more than once
5 | {%- call thrice(param1=2, param1=3) -%} 5 | {%- call thrice(param1=2, param1=3) -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/macro_named_argument.rs:11:10 --> tests/ui/macro_named_argument.rs:12:3
| |
11 | #[derive(Template)] 12 | #[template(source = "{%- macro thrice(param1, param2) -%}
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: failed to parse template source error: failed to parse template source
--> <source attribute>:5:30 --> <source attribute>:5:30
@ -30,12 +26,10 @@ error: failed to parse template source
5 | {%- call thrice(3, param1=2) | filter(param1=12) -%} 5 | {%- call thrice(3, param1=2) | filter(param1=12) -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/macro_named_argument.rs:20:10 --> tests/ui/macro_named_argument.rs:21:3
| |
20 | #[derive(Template)] 21 | #[template(source = "{%- macro thrice(param1, param2) -%}
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: named arguments must always be passed last error: named arguments must always be passed last
--> <source attribute>:4:16 --> <source attribute>:4:16
@ -43,12 +37,10 @@ error: named arguments must always be passed last
4 | {%- call thrice(param1=2, 3) -%} 4 | {%- call thrice(param1=2, 3) -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/macro_named_argument.rs:29:10 --> tests/ui/macro_named_argument.rs:30:3
| |
29 | #[derive(Template)] 30 | #[template(source = "{%- macro thrice(param1, param2) -%}
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: cannot have unnamed argument (`param2`) after named argument in macro "thrice" error: cannot have unnamed argument (`param2`) after named argument in macro "thrice"
--> InvalidNamedArg5.html:4:3 --> InvalidNamedArg5.html:4:3
@ -56,9 +48,7 @@ error: cannot have unnamed argument (`param2`) after named argument in macro "th
4 | {%- call thrice(3, param1=2) -%} 4 | {%- call thrice(3, param1=2) -%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/macro_named_argument.rs:37:10 --> tests/ui/macro_named_argument.rs:38:3
| |
37 | #[derive(Template)] 38 | #[template(source = "{%- macro thrice(param1, param2) -%}
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: failed to parse template source
3 | // Help, I forgot how to write comments! 3 | // Help, I forgot how to write comments!
| ^ close to this token | ^ close to this token
| |
--> tests/ui/match_with_extra.rs:3:10 --> tests/ui/match_with_extra.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: multiple extend blocks found
3 | {% extends "foo.html" %} 3 | {% extends "foo.html" %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/multiple_extends.rs:3:10 --> tests/ui/multiple_extends.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = r#"
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: expected name `foo` in `endblock` tag, found `not_foo`
1 | {% block foo %}{% endblock not_foo %} 1 | {% block foo %}{% endblock not_foo %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/name_mismatch_endblock.rs:3:10 --> tests/ui/name_mismatch_endblock.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = "{% block foo %}{% endblock not_foo %}", ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: expected name `foo` in `endmacro` tag, found `not_foo`
1 | {% macro foo(arg) %} {{arg}} {% endmacro not_foo %} 1 | {% macro foo(arg) %} {{arg}} {% endmacro not_foo %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/name_mismatch_endmacro.rs:3:10 --> tests/ui/name_mismatch_endmacro.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = "{% macro foo(arg) %} {{arg}} {% endmacro not_foo %}", ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,17 +4,13 @@ error: invalid escaper 'latex' for `escape` filter. The available extensions are
1 | In LaTeX you write `{{text}}` like `{{text|escape("latex")}}`. 1 | In LaTeX you write `{{text}}` like `{{text|escape("latex")}}`.
| ^ close to this token | ^ close to this token
| |
--> tests/ui/no-such-escaper.rs:3:10 --> tests/ui/no-such-escaper.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: no escaper defined for extension 'tex'. The available extensions are: "", "htm", "html", "j2", "jinja", "jinja2", "md", "none", "svg", "txt", "xml", "yml" 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:12:10 --> tests/ui/no-such-escaper.rs:13:3
| |
12 | #[derive(Template)] 13 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -1,7 +1,5 @@
error: no attribute 'template' found error: no attribute 'template' found
--> tests/ui/no_template_attribute.rs:3:10 --> tests/ui/no_template_attribute.rs:4:8
| |
3 | #[derive(Template)] 4 | struct NoTemplate;
| ^^^^^^^^ | ^^^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,12 +4,10 @@ error: unknown integer suffix `x`
1 | {{ 0x0x }} 1 | {{ 0x0x }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/num-suffix.rs:4:10 --> tests/ui/num-suffix.rs:5:3
| |
4 | #[derive(Template)] 5 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unknown float suffix `f127` error: unknown float suffix `f127`
--> <source attribute>:1:4 --> <source attribute>:1:4
@ -17,12 +15,10 @@ error: unknown float suffix `f127`
1 | {{ 0.0_f127 }} 1 | {{ 0.0_f127 }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/num-suffix.rs:11:10 --> tests/ui/num-suffix.rs:12:3
| |
11 | #[derive(Template)] 12 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unknown number suffix `u321` error: unknown number suffix `u321`
--> <source attribute>:1:4 --> <source attribute>:1:4
@ -30,9 +26,7 @@ error: unknown number suffix `u321`
1 | {{ 654u321 }} 1 | {{ 654u321 }}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/num-suffix.rs:18:10 --> tests/ui/num-suffix.rs:19:3
| |
18 | #[derive(Template)] 19 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: failed to parse template source
1 | {% let *x = 2 %} 1 | {% let *x = 2 %}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/ref_deref.rs:3:10 --> tests/ui/ref_deref.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = "{% let *x = 2 %}", ext = "html")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -5,12 +5,10 @@ error: the filter operator `|` must not be preceded by any whitespace characters
1 | {{a |lower}} 1 | {{a |lower}}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/space-pipe.rs:9:10 --> tests/ui/space-pipe.rs:10:3
| |
9 | #[derive(Template)] 10 | #[template(ext = "txt", source = "{{a |lower}}")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: the filter operator `|` must not be preceded by any whitespace characters error: the filter operator `|` must not be preceded by any whitespace characters
the binary OR operator is called `bitor` in rinja the binary OR operator is called `bitor` in rinja
@ -19,9 +17,7 @@ error: the filter operator `|` must not be preceded by any whitespace characters
1 | {{a | lower}} 1 | {{a | lower}}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/space-pipe.rs:21:10 --> tests/ui/space-pipe.rs:22:3
| |
21 | #[derive(Template)] 22 | #[template(ext = "txt", source = "{{a | lower}}")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,9 +4,7 @@ error: failed to parse template source
1 | {%for i in 1..=10%}{{i}}{%endfo%} 1 | {%for i in 1..=10%}{{i}}{%endfo%}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/typo_in_keyword.rs:3:10 --> tests/ui/typo_in_keyword.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@ -4,12 +4,10 @@ error: unclosed expression, missing "}}"
1 | {{ expr 1 | {{ expr
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:3:10 --> tests/ui/unclosed-nodes.rs:4:3
| |
3 | #[derive(Template)] 4 | #[template(source = "{{ expr", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unclosed expression, missing "}}" error: unclosed expression, missing "}}"
--> <source attribute>:1:1 --> <source attribute>:1:1
@ -17,12 +15,10 @@ error: unclosed expression, missing "}}"
1 | {{ expr 1 | {{ expr
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:7:10 --> tests/ui/unclosed-nodes.rs:8:3
| |
7 | #[derive(Template)] 8 | #[template(source = "{{ expr ", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unclosed expression, missing "}}" error: unclosed expression, missing "}}"
--> <source attribute>:1:1 --> <source attribute>:1:1
@ -30,12 +26,10 @@ error: unclosed expression, missing "}}"
1 | {{ expr - 1 | {{ expr -
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:11:10 --> tests/ui/unclosed-nodes.rs:12:3
| |
11 | #[derive(Template)] 12 | #[template(source = "{{ expr -", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: failed to parse template source error: failed to parse template source
--> <source attribute>:1:10 --> <source attribute>:1:10
@ -43,12 +37,10 @@ error: failed to parse template source
1 | {{ expr -} 1 | {{ expr -}
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:15:10 --> tests/ui/unclosed-nodes.rs:16:3
| |
15 | #[derive(Template)] 16 | #[template(source = "{{ expr -}", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unclosed block, missing "%}" error: unclosed block, missing "%}"
--> <source attribute>:1:1 --> <source attribute>:1:1
@ -56,12 +48,10 @@ error: unclosed block, missing "%}"
1 | {% let x 1 | {% let x
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:19:10 --> tests/ui/unclosed-nodes.rs:20:3
| |
19 | #[derive(Template)] 20 | #[template(source = "{% let x", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unclosed block, missing "%}" error: unclosed block, missing "%}"
--> <source attribute>:1:1 --> <source attribute>:1:1
@ -69,12 +59,10 @@ error: unclosed block, missing "%}"
1 | {% let x 1 | {% let x
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:23:10 --> tests/ui/unclosed-nodes.rs:24:3
| |
23 | #[derive(Template)] 24 | #[template(source = "{% let x ", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unclosed block, missing "%}" error: unclosed block, missing "%}"
--> <source attribute>:1:1 --> <source attribute>:1:1
@ -82,12 +70,10 @@ error: unclosed block, missing "%}"
1 | {% let x - 1 | {% let x -
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:27:10 --> tests/ui/unclosed-nodes.rs:28:3
| |
27 | #[derive(Template)] 28 | #[template(source = "{% let x -", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: failed to parse template source error: failed to parse template source
--> <source attribute>:1:11 --> <source attribute>:1:11
@ -95,12 +81,10 @@ error: failed to parse template source
1 | {% let x -% 1 | {% let x -%
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:31:10 --> tests/ui/unclosed-nodes.rs:32:3
| |
31 | #[derive(Template)] 32 | #[template(source = "{% let x -%", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unclosed comment, missing "#}" error: unclosed comment, missing "#}"
--> <source attribute>:1:3 --> <source attribute>:1:3
@ -108,12 +92,10 @@ error: unclosed comment, missing "#}"
1 | {# comment 1 | {# comment
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:35:10 --> tests/ui/unclosed-nodes.rs:36:3
| |
35 | #[derive(Template)] 36 | #[template(source = "{# comment", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unclosed comment, missing "#}" error: unclosed comment, missing "#}"
--> <source attribute>:1:3 --> <source attribute>:1:3
@ -121,12 +103,10 @@ error: unclosed comment, missing "#}"
1 | {# comment 1 | {# comment
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:39:10 --> tests/ui/unclosed-nodes.rs:40:3
| |
39 | #[derive(Template)] 40 | #[template(source = "{# comment ", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unclosed comment, missing "#}" error: unclosed comment, missing "#}"
--> <source attribute>:1:3 --> <source attribute>:1:3
@ -134,12 +114,10 @@ error: unclosed comment, missing "#}"
1 | {# comment - 1 | {# comment -
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:43:10 --> tests/ui/unclosed-nodes.rs:44:3
| |
43 | #[derive(Template)] 44 | #[template(source = "{# comment -", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unclosed comment, missing "#}" error: unclosed comment, missing "#}"
--> <source attribute>:1:3 --> <source attribute>:1:3
@ -147,9 +125,7 @@ error: unclosed comment, missing "#}"
1 | {# comment -# 1 | {# comment -#
| ^ close to this token | ^ close to this token
| |
--> tests/ui/unclosed-nodes.rs:47:10 --> tests/ui/unclosed-nodes.rs:48:3
| |
47 | #[derive(Template)] 48 | #[template(source = "{# comment -#", ext = "txt")]
| ^^^^^^^^ | ^^^^^^^^
|
= note: this error originates in the derive macro `Template` (in Nightly builds, run with -Z macro-backtrace for more info)