Fix macro hygene.
This commit is contained in:
@@ -651,7 +651,8 @@ impl ExportedFn {
|
||||
let return_span = self
|
||||
.return_type()
|
||||
.map(|r| r.span())
|
||||
.unwrap_or_else(Span::call_site);
|
||||
.unwrap_or_else(Span::call_site)
|
||||
.resolved_at(Span::call_site());
|
||||
if self.params.return_raw.is_some() {
|
||||
quote_spanned! { return_span =>
|
||||
pub #dynamic_signature {
|
||||
@@ -765,7 +766,7 @@ impl ExportedFn {
|
||||
syn::Type::Path(ref p) if p.path == str_type_path => {
|
||||
is_string = true;
|
||||
is_ref = true;
|
||||
quote_spanned!(arg_type.span() =>
|
||||
quote_spanned!(arg_type.span().resolved_at(Span::call_site()) =>
|
||||
mem::take(args[#i]).into_immutable_string().unwrap()
|
||||
)
|
||||
}
|
||||
@@ -834,7 +835,8 @@ impl ExportedFn {
|
||||
let return_span = self
|
||||
.return_type()
|
||||
.map(|r| r.span())
|
||||
.unwrap_or_else(Span::call_site);
|
||||
.unwrap_or_else(Span::call_site)
|
||||
.resolved_at(Span::call_site());
|
||||
let return_expr = if self.params.return_raw.is_none() {
|
||||
quote_spanned! { return_span =>
|
||||
Ok(Dynamic::from(#sig_name(#(#unpack_exprs),*)))
|
||||
|
Reference in New Issue
Block a user