aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src
diff options
context:
space:
mode:
authorLibravatar Juan Aguilar Santillana <mhpoin@gmail.com>2019-01-10 14:44:35 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2019-01-10 17:17:04 +0100
commit7f6263ceddd6586ef2e65a5cbde5ee6555a43c23 (patch)
treefb6e2777d437f4fafa47b22fa171cbf289e12f73 /askama_derive/src
parent0876c8e5d6e983d50e8be2fd4d366da2123c810a (diff)
downloadaskama-7f6263ceddd6586ef2e65a5cbde5ee6555a43c23.tar.gz
askama-7f6263ceddd6586ef2e65a5cbde5ee6555a43c23.tar.bz2
askama-7f6263ceddd6586ef2e65a5cbde5ee6555a43c23.zip
Add warning of deprecated field '_parent'
Diffstat (limited to '')
-rw-r--r--askama_derive/src/input.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/askama_derive/src/input.rs b/askama_derive/src/input.rs
index 72d5d20..c23d30f 100644
--- a/askama_derive/src/input.rs
+++ b/askama_derive/src/input.rs
@@ -4,6 +4,7 @@ use quote::ToTokens;
use askama_shared::{Config, Syntax};
+use std::io::{self, Write};
use std::path::PathBuf;
use syn;
@@ -144,6 +145,15 @@ impl<'a> TemplateInput<'a> {
_ => None,
};
+ if parent.is_some() {
+ io::stderr()
+ .write_fmt(format_args!(
+ " --> in struct {}\n = use of deprecated field '_parent'\n",
+ ast.ident
+ ))
+ .unwrap();
+ }
+
// Validate syntax
let syntax = syntax.map_or_else(
|| config.syntaxes.get(config.default_syntax).unwrap(),