From a349968cd740c03f1aa6bfbecc49c80db1e19fda Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Sun, 11 Aug 2024 23:55:09 +0200 Subject: [PATCH] print names of nonmergeable fieldsets. --- src/transform/common.rs | 6 +++++- src/transform/merge_fieldsets.rs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/transform/common.rs b/src/transform/common.rs index e39d149..71a325d 100644 --- a/src/transform/common.rs +++ b/src/transform/common.rs @@ -83,14 +83,18 @@ impl Default for CheckLevel { } pub(crate) fn check_mergeable_fieldsets( + a_name: &str, a: &FieldSet, + b_name: &str, b: &FieldSet, level: CheckLevel, ) -> anyhow::Result<()> { if let Err(e) = check_mergeable_fieldsets_inner(a, b, level) { bail!( - "Cannot merge fieldsets.\nfirst: {:#?}\nsecond: {:#?}\ncause: {:?}", + "Cannot merge fieldsets.\nfirst: {} {:#?}\nsecond: {} {:#?}\ncause: {:?}", + a_name, a, + b_name, b, e ) diff --git a/src/transform/merge_fieldsets.rs b/src/transform/merge_fieldsets.rs index 6e1cbfa..380f420 100644 --- a/src/transform/merge_fieldsets.rs +++ b/src/transform/merge_fieldsets.rs @@ -51,7 +51,7 @@ impl MergeFieldsets { for id in &ids { let fs2 = ir.fieldsets.get(id).unwrap(); - check_mergeable_fieldsets(&fs, fs2, self.check)?; + check_mergeable_fieldsets(&main_id, &fs, id, fs2, self.check)?; } for id in &ids {