Skip to content

Commit

Permalink
Transfer span of mutable_during_default_resolution to mut token t…
Browse files Browse the repository at this point in the history
…o obtain better warnings
  • Loading branch information
idanarye committed Sep 27, 2023
1 parent 969d6ae commit c8d77f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions typed-builder-macro/src/struct_info.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use proc_macro2::{Ident, Span, TokenStream};
use quote::{quote, ToTokens};
use quote::{quote, quote_spanned, ToTokens};
use syn::parse::Error;

use crate::field_info::{FieldBuilderAttr, FieldInfo};
Expand Down Expand Up @@ -461,8 +461,8 @@ impl<'a> StructInfo<'a> {
let assignments = self.fields.iter().map(|field| {
let name = &field.name;

let maybe_mut = if field.builder_attr.mutable_during_default_resolution.is_some() {
quote!(mut)
let maybe_mut = if let Some(span) = field.builder_attr.mutable_during_default_resolution {
quote_spanned!(span => mut)
} else {
quote!()
};
Expand Down

0 comments on commit c8d77f3

Please sign in to comment.