mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-02-10 14:14:13 +00:00
Merge pull request #606 from Veykril/veykril/push-wpzpkktutxso
Improve the span used for salsa struct constructors
This commit is contained in:
commit
b3b6286409
2 changed files with 2 additions and 3 deletions
|
@ -204,7 +204,7 @@ macro_rules! setup_tracked_fn {
|
||||||
aux: &dyn $zalsa::JarAux,
|
aux: &dyn $zalsa::JarAux,
|
||||||
first_index: $zalsa::IngredientIndex,
|
first_index: $zalsa::IngredientIndex,
|
||||||
) -> Vec<Box<dyn $zalsa::Ingredient>> {
|
) -> Vec<Box<dyn $zalsa::Ingredient>> {
|
||||||
let mut fn_ingredient = <$zalsa::function::IngredientImpl<$Configuration>>::new(
|
let fn_ingredient = <$zalsa::function::IngredientImpl<$Configuration>>::new(
|
||||||
first_index,
|
first_index,
|
||||||
aux,
|
aux,
|
||||||
);
|
);
|
||||||
|
|
|
@ -30,7 +30,6 @@ use crate::{
|
||||||
options::{AllowedOptions, Options},
|
options::{AllowedOptions, Options},
|
||||||
};
|
};
|
||||||
use proc_macro2::{Ident, Literal, Span, TokenStream};
|
use proc_macro2::{Ident, Literal, Span, TokenStream};
|
||||||
use syn::spanned::Spanned;
|
|
||||||
|
|
||||||
pub(crate) struct SalsaStruct<'s, A: SalsaStructAllowedOptions> {
|
pub(crate) struct SalsaStruct<'s, A: SalsaStructAllowedOptions> {
|
||||||
struct_item: &'s syn::ItemStruct,
|
struct_item: &'s syn::ItemStruct,
|
||||||
|
@ -115,7 +114,7 @@ where
|
||||||
pub(crate) fn constructor_name(&self) -> syn::Ident {
|
pub(crate) fn constructor_name(&self) -> syn::Ident {
|
||||||
match self.args.constructor_name.clone() {
|
match self.args.constructor_name.clone() {
|
||||||
Some(name) => name,
|
Some(name) => name,
|
||||||
None => Ident::new("new", self.struct_item.span()),
|
None => Ident::new("new", self.struct_item.ident.span()),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue