Merge pull request #606 from Veykril/veykril/push-wpzpkktutxso

Improve the span used for salsa struct constructors
This commit is contained in:
Niko Matsakis 2024-10-25 11:58:46 +00:00 committed by GitHub
commit b3b6286409
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -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,
); );

View file

@ -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()),
} }
} }