DWARF processor: do not apply file filters to types in Rust objects

Rust does not have incomplete types. Therefore it does not make sense
to filter type information for Rust types.

PiperOrigin-RevId: 613908280
Change-Id: Idd486e1912a01749c4760765f3438f2dbdd0e365
diff --git a/dwarf_processor.cc b/dwarf_processor.cc
index 3d1d846..9e84971 100644
--- a/dwarf_processor.cc
+++ b/dwarf_processor.cc
@@ -45,6 +45,10 @@
 
 namespace {
 
+bool HasIncompleteTypes(uint64_t language) {
+  return language != DW_LANG_Rust;
+}
+
 std::string EntryToString(Entry& entry) {
   std::ostringstream os;
   os << "DWARF entry <" << Hex(entry.GetOffset()) << ">";
@@ -467,7 +471,7 @@
   }
 
   bool ShouldKeepDefinition(Entry& entry, const std::string& name) const {
-    if (file_filter_ == nullptr) {
+    if (!HasIncompleteTypes(language_) || file_filter_ == nullptr) {
       return true;
     }
     const auto file = files_.MaybeGetFile(entry, DW_AT_decl_file);