From 0aab78c6775493fb13fabce2b5eaef7ac83e6665 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Thu, 3 Feb 2022 19:20:53 +0100 Subject: Enable tracking of the offending span of an error --- askama_derive/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'askama_derive/src') diff --git a/askama_derive/src/lib.rs b/askama_derive/src/lib.rs index 4d81433..2409ba4 100644 --- a/askama_derive/src/lib.rs +++ b/askama_derive/src/lib.rs @@ -9,7 +9,6 @@ use askama_shared::{ generator, get_template_source, read_config_file, CompileError, Config, Integrations, }; use proc_macro::TokenStream; -use proc_macro2::Span; use std::collections::HashMap; use std::path::PathBuf; @@ -19,9 +18,7 @@ pub fn derive_template(input: TokenStream) -> TokenStream { let ast: syn::DeriveInput = syn::parse(input).unwrap(); match build_template(&ast) { Ok(source) => source.parse().unwrap(), - Err(e) => syn::Error::new(Span::call_site(), e) - .to_compile_error() - .into(), + Err(e) => e.to_compile_error().into(), } } -- cgit