Skip to content

Commit

Permalink
Merge pull request #606 from Veykril/veykril/push-wpzpkktutxso
Browse files Browse the repository at this point in the history
Improve the span used for salsa struct constructors
  • Loading branch information
nikomatsakis authored Oct 25, 2024
2 parents 254c749 + 56b7a23 commit b3b6286
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/salsa-macro-rules/src/setup_tracked_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ macro_rules! setup_tracked_fn {
aux: &dyn $zalsa::JarAux,
first_index: $zalsa::IngredientIndex,
) -> Vec<Box<dyn $zalsa::Ingredient>> {
let mut fn_ingredient = <$zalsa::function::IngredientImpl<$Configuration>>::new(
let fn_ingredient = <$zalsa::function::IngredientImpl<$Configuration>>::new(
first_index,
aux,
);
Expand Down
3 changes: 1 addition & 2 deletions components/salsa-macros/src/salsa_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use crate::{
options::{AllowedOptions, Options},
};
use proc_macro2::{Ident, Literal, Span, TokenStream};
use syn::spanned::Spanned;

pub(crate) struct SalsaStruct<'s, A: SalsaStructAllowedOptions> {
struct_item: &'s syn::ItemStruct,
Expand Down Expand Up @@ -115,7 +114,7 @@ where
pub(crate) fn constructor_name(&self) -> syn::Ident {
match self.args.constructor_name.clone() {
Some(name) => name,
None => Ident::new("new", self.struct_item.span()),
None => Ident::new("new", self.struct_item.ident.span()),
}
}

Expand Down

0 comments on commit b3b6286

Please sign in to comment.