about summary refs log tree commit diff
path: root/tvix/nix-compat-derive/src/de.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/nix-compat-derive/src/de.rs')
-rw-r--r--tvix/nix-compat-derive/src/de.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/tvix/nix-compat-derive/src/de.rs b/tvix/nix-compat-derive/src/de.rs
index 8dac6964f612..2214254e2b32 100644
--- a/tvix/nix-compat-derive/src/de.rs
+++ b/tvix/nix-compat-derive/src/de.rs
@@ -111,7 +111,9 @@ fn nix_deserialize_struct(style: Style, fields: &[Field<'_>]) -> TokenStream {
         };
         if let Some(version) = f.attrs.version.as_ref() {
             let default = match &f.attrs.default {
-                Default::Default => quote_spanned!(ty.span()=>::std::default::Default::default),
+                Default::Default(span) => {
+                    quote_spanned!(span.span()=>::std::default::Default::default)
+                }
                 Default::Path(path) => path.to_token_stream(),
                 _ => panic!("No default for versioned field"),
             };
@@ -172,7 +174,9 @@ fn nix_deserialize_variant(variant: &Variant<'_>) -> TokenStream {
         };
         if let Some(version) = f.attrs.version.as_ref() {
             let default = match &f.attrs.default {
-                Default::Default => quote_spanned!(ty.span()=>::std::default::Default::default),
+                Default::Default(span) => {
+                    quote_spanned!(span.span()=>::std::default::Default::default)
+                }
                 Default::Path(path) => path.to_token_stream(),
                 _ => panic!("No default for versioned field"),
             };