From 1e897351f3f1162ea70d240eb785bc5cd4640cb5 Mon Sep 17 00:00:00 2001 From: vita-dounai Date: Thu, 11 Nov 2021 20:43:23 +0800 Subject: [PATCH] make quepingkong happy --- src/analyzer/callbacks.rs | 5 +++++ src/analyzer/ifds/problems/conflict_fields.rs | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/analyzer/callbacks.rs b/src/analyzer/callbacks.rs index 956a3bf..5885777 100644 --- a/src/analyzer/callbacks.rs +++ b/src/analyzer/callbacks.rs @@ -257,6 +257,11 @@ impl AnalysisCallbacks { conflict_fields.dedup(); let mut composed_conflict_fields: Vec = vec![]; let mut add_to_composed = |field_to_add: FieldDesc| { + if field_to_add.kind == field_kind::LEN { + composed_conflict_fields.push(field_to_add); + return; + } + if composed_conflict_fields .iter() .rposition(|field| { diff --git a/src/analyzer/ifds/problems/conflict_fields.rs b/src/analyzer/ifds/problems/conflict_fields.rs index 97bb669..c011ff8 100644 --- a/src/analyzer/ifds/problems/conflict_fields.rs +++ b/src/analyzer/ifds/problems/conflict_fields.rs @@ -1070,7 +1070,9 @@ impl<'tcx, 'graph> IfdsProblem<'tcx> for ConflictFields<'tcx, 'graph> { results.insert(ConflictField::Field { container: *container, key: Key::Len, - read_only: true, + read_only: matches!(fn_name, + KnownNames::LiquidStorageCollectionsMappingLen + | KnownNames::LiquidStorageCollectionsMappingIsEmpty), }); } results