Do not emit UnsupportedItems for declarations from other targets

PiperOrigin-RevId: 413618304
diff --git a/rs_bindings_from_cc/ast_visitor.cc b/rs_bindings_from_cc/ast_visitor.cc
index eb80874..ffe584e 100644
--- a/rs_bindings_from_cc/ast_visitor.cc
+++ b/rs_bindings_from_cc/ast_visitor.cc
@@ -53,11 +53,7 @@
 
   const clang::DeclContext* decl_context = decl->getDeclContext();
   if (decl_context && decl_context->isNamespace()) {
-    std::string name = "unnamed";
-    if (const auto* named_decl = llvm::dyn_cast<clang::NamedDecl>(decl)) {
-      name = named_decl->getQualifiedNameAsString();
-    }
-    PushUnsupportedItem(name,
+    PushUnsupportedItem(decl,
                         "Items contained in namespaces are not supported yet",
                         decl->getBeginLoc());
 
@@ -97,8 +93,7 @@
     if (method_decl->isInstance()) {
       auto param_type = ConvertType(method_decl->getThisType());
       if (!param_type.ok()) {
-        PushUnsupportedItem(function_decl->getQualifiedNameAsString(),
-                            param_type.status().ToString(),
+        PushUnsupportedItem(function_decl, param_type.status().ToString(),
                             method_decl->getBeginLoc());
 
         success = false;
@@ -112,7 +107,7 @@
     auto param_type = ConvertType(param->getType());
     if (!param_type.ok()) {
       PushUnsupportedItem(
-          function_decl->getQualifiedNameAsString(),
+          function_decl,
           absl::Substitute("Parameter type '$0' is not supported",
                            param->getType().getAsString()),
           param->getBeginLoc());
@@ -129,7 +124,7 @@
         // currently do not support it.
         if (!record_decl->canPassInRegisters()) {
           PushUnsupportedItem(
-              function_decl->getQualifiedNameAsString(),
+              function_decl,
               absl::Substitute("Non-trivial_abi type '$0' is not "
                                "supported by value as a parameter",
                                param->getType().getAsString()),
@@ -141,7 +136,7 @@
 
     std::optional<Identifier> param_name = GetTranslatedIdentifier(param);
     if (!param_name.has_value()) {
-      PushUnsupportedItem(function_decl->getQualifiedNameAsString(),
+      PushUnsupportedItem(function_decl,
                           "Empty parameter names are not supported",
                           param->getBeginLoc());
       success = false;
@@ -159,7 +154,7 @@
       // currently do not support it.
       if (!record_decl->canPassInRegisters()) {
         PushUnsupportedItem(
-            function_decl->getQualifiedNameAsString(),
+            function_decl,
             absl::Substitute("Non-trivial_abi type '$0' is not supported "
                              "by value as a return type",
                              function_decl->getReturnType().getAsString()),
@@ -172,7 +167,7 @@
   auto return_type = ConvertType(function_decl->getReturnType());
   if (!return_type.ok()) {
     PushUnsupportedItem(
-        function_decl->getQualifiedNameAsString(),
+        function_decl,
         absl::Substitute("Return type '$0' is not supported",
                          function_decl->getReturnType().getAsString()),
         function_decl->getReturnTypeSourceRange());
@@ -183,7 +178,8 @@
   if (auto* method_decl = llvm::dyn_cast<clang::CXXMethodDecl>(function_decl)) {
     if (method_decl->isVirtual()) {
       // TODO(b/202853028): implement virtual functions.
-      PushUnsupportedItem(function_decl->getQualifiedNameAsString(),
+      PushUnsupportedItem(function_decl,
+
                           "Virtual functions are not supported",
                           function_decl->getSourceRange());
       success = false;
@@ -215,7 +211,7 @@
           GetTranslatedIdentifier(method_decl->getParent());
       if (!record_identifier.has_value()) {
         PushUnsupportedItem(
-            function_decl->getQualifiedNameAsString(),
+            function_decl,
             absl::Substitute("The Record for method '$0' could not be found",
                              function_decl->getQualifiedNameAsString()),
             function_decl->getSourceRange());
@@ -263,16 +259,23 @@
 
   if (filename.startswith("./")) filename = filename.substr(2);
   auto target_iterator = headers_to_targets_.find(HeaderName(filename.str()));
-  CHECK(target_iterator != headers_to_targets_.end())
-      << "Couldn't find target for " << filename.str();
+  if (target_iterator == headers_to_targets_.end()) {
+    // TODO(b/208377928): replace this hack with a
+    // CHECK(target_iterator != headers_to_targets_.end()) once we generate
+    // bindings for headers in Clang's resource dir.
+    return Label("//:virtual_clang_resource_dir_target");
+  }
   return target_iterator->second;
 }
 
+bool AstVisitor::IsFromCurrentTarget(const clang::Decl* decl) const {
+  return current_target_ == GetOwningTarget(decl);
+}
+
 bool AstVisitor::VisitRecordDecl(clang::RecordDecl* record_decl) {
   const clang::DeclContext* decl_context = record_decl->getDeclContext();
   if (decl_context && decl_context->isRecord()) {
-    PushUnsupportedItem(record_decl->getQualifiedNameAsString(),
-                        "Nested classes are not supported yet",
+    PushUnsupportedItem(record_decl, "Nested classes are not supported yet",
                         record_decl->getBeginLoc());
     return true;
   }
@@ -327,17 +330,25 @@
   }
 }
 
-void AstVisitor::PushUnsupportedItem(std::string name, std::string message,
+void AstVisitor::PushUnsupportedItem(const clang::Decl* decl,
+                                     std::string message,
                                      clang::SourceLocation source_location) {
-  ir_.items.push_back(
-      UnsupportedItem{.name = name,
-                      .message = message,
-                      .source_loc = ConvertSourceLocation(source_location)});
+  if (!IsFromCurrentTarget(decl)) return;
+
+  std::string name = "unnamed";
+  if (const auto* named_decl = llvm::dyn_cast<clang::NamedDecl>(decl)) {
+    name = named_decl->getQualifiedNameAsString();
+  }
+  ir_.items.push_back(UnsupportedItem{
+      .name = std::move(name),
+      .message = std::move(message),
+      .source_loc = ConvertSourceLocation(std::move(source_location))});
 }
 
-void AstVisitor::PushUnsupportedItem(std::string name, std::string message,
+void AstVisitor::PushUnsupportedItem(const clang::Decl* decl,
+                                     std::string message,
                                      clang::SourceRange source_range) {
-  PushUnsupportedItem(name, message, source_range.getBegin());
+  PushUnsupportedItem(decl, message, source_range.getBegin());
 }
 
 SourceLoc AstVisitor::ConvertSourceLocation(clang::SourceLocation loc) const {
diff --git a/rs_bindings_from_cc/ast_visitor.h b/rs_bindings_from_cc/ast_visitor.h
index 45f30c1..4fa4894 100644
--- a/rs_bindings_from_cc/ast_visitor.h
+++ b/rs_bindings_from_cc/ast_visitor.h
@@ -72,6 +72,10 @@
   std::string GetMangledName(const clang::NamedDecl* named_decl) const;
   Label GetOwningTarget(const clang::Decl* decl) const;
 
+  // Checks if the given decl belongs to the current target. Does not look into
+  // other redeclarations of the decl.
+  bool IsFromCurrentTarget(const clang::Decl* decl) const;
+
   // Gets an IR UnqualifiedIdentifier for the named decl.
   //
   // If the decl's name is an identifier, this returns that identifier as-is.
@@ -97,9 +101,9 @@
   std::optional<std::string> GetComment(const clang::Decl* decl) const;
   absl::StatusOr<MappedType> ConvertType(clang::QualType qual_type) const;
 
-  void PushUnsupportedItem(std::string name, std::string message,
+  void PushUnsupportedItem(const clang::Decl* decl, std::string message,
                            clang::SourceLocation source_location);
-  void PushUnsupportedItem(std::string name, std::string message,
+  void PushUnsupportedItem(const clang::Decl* decl, std::string message,
                            clang::SourceRange source_range);
   SourceLoc ConvertSourceLocation(clang::SourceLocation loc) const;
 
diff --git a/rs_bindings_from_cc/ir.rs b/rs_bindings_from_cc/ir.rs
index 3aa69e9..226ecad 100644
--- a/rs_bindings_from_cc/ir.rs
+++ b/rs_bindings_from_cc/ir.rs
@@ -321,6 +321,13 @@
         })
     }
 
+    pub fn unsupported_items(&self) -> impl Iterator<Item = &UnsupportedItem> {
+        self.items().filter_map(|item| match item {
+            Item::UnsupportedItem(unsupported_item) => Some(unsupported_item),
+            _ => None,
+        })
+    }
+
     pub fn record_for_type<T>(&self, ty: &T) -> Result<&Record>
     where
         T: OwningDeclId + std::fmt::Debug,
diff --git a/rs_bindings_from_cc/ir_from_cc_test.rs b/rs_bindings_from_cc/ir_from_cc_test.rs
index d168170..9e2796c 100644
--- a/rs_bindings_from_cc/ir_from_cc_test.rs
+++ b/rs_bindings_from_cc/ir_from_cc_test.rs
@@ -356,3 +356,47 @@
             .contains(&ir::UnqualifiedIdentifier::Destructor)
     );
 }
+
+#[test]
+fn test_unsupported_items_are_emitted() -> Result<()> {
+    // We will have to rewrite this test to use something else that is unsupported
+    // once we start importing structs from namespaces.
+    let ir = ir_from_cc("namespace my_namespace { struct StructFromNamespaceIsUnsupported {}; }")?;
+    assert_strings_contain(
+        ir.unsupported_items().map(|i| i.name.as_str()).collect_vec().as_slice(),
+        "my_namespace::StructFromNamespaceIsUnsupported",
+    );
+    Ok(())
+}
+
+#[test]
+fn test_unsupported_items_from_dependency_are_not_emitted() -> Result<()> {
+    // We will have to rewrite this test to use something else that is unsupported
+    // once we start importing structs from namespaces.
+    let ir = ir_from_cc_dependency(
+        "struct MyOtherStruct { my_namespace::StructFromNamespaceIsUnsupported my_struct; };",
+        "namespace my_namespace { struct StructFromNamespaceIsUnsupported {}; }",
+    )?;
+    let names = ir.unsupported_items().map(|i| i.name.as_str()).collect_vec();
+    assert_strings_dont_contain(names.as_slice(), "my_namespace::StructFromNamespaceIsUnsupported");
+    assert_strings_contain(names.as_slice(), "MyOtherStruct::MyOtherStruct");
+    Ok(())
+}
+
+fn assert_strings_contain(strings: &[&str], expected_string: &str) {
+    assert!(
+        strings.iter().any(|s| *s == expected_string),
+        "Value '{}' was unexpectedly missing from {:?}",
+        expected_string,
+        strings
+    );
+}
+
+fn assert_strings_dont_contain(strings: &[&str], unexpected_string: &str) {
+    assert!(
+        strings.iter().all(|s| *s != unexpected_string),
+        "Value '{}' was unexpectedly found in {:?}",
+        unexpected_string,
+        strings
+    );
+}
diff --git a/rs_bindings_from_cc/ir_testing.rs b/rs_bindings_from_cc/ir_testing.rs
index 71ba4ee..6d3cf8a 100644
--- a/rs_bindings_from_cc/ir_testing.rs
+++ b/rs_bindings_from_cc/ir_testing.rs
@@ -10,13 +10,37 @@
     IR,
 };
 
-pub fn ir_from_cc(src: &str) -> Result<IR> {
+/// Generates `IR` from a header containing `header_source`.
+pub fn ir_from_cc(header_source: &str) -> Result<IR> {
+    ir_from_cc_dependency(header_source, "// empty header")
+}
+
+const DEPENDENCY_HEADER_NAME: &str = "test/dependency_header.h";
+
+/// Generates `IR` from a header that depends on another header.
+///
+/// `header_source` of the header will be updated to contain the `#include` line
+/// for the header with `dependency_header_source`. The name of the dependency
+/// target is assumed to be `"//test:dependency"`.
+pub fn ir_from_cc_dependency(header_source: &str, dependency_header_source: &str) -> Result<IR> {
     extern "C" {
-        fn json_from_cc(cc_source: FfiU8Slice) -> FfiU8SliceBox;
+        fn json_from_cc_dependency(
+            header_source: FfiU8Slice,
+            dependency_header_source: FfiU8Slice,
+        ) -> FfiU8SliceBox;
     }
 
-    let src_u8 = src.as_bytes();
-    let json_utf8 = unsafe { json_from_cc(FfiU8Slice::from_slice(src_u8)).into_boxed_slice() };
+    let header_source_with_include =
+        format!("#include \"{}\"\n\n{}", DEPENDENCY_HEADER_NAME, header_source);
+    let header_source_with_include_u8 = header_source_with_include.as_bytes();
+    let dependency_header_source_u8 = dependency_header_source.as_bytes();
+    let json_utf8 = unsafe {
+        json_from_cc_dependency(
+            FfiU8Slice::from_slice(header_source_with_include_u8),
+            FfiU8Slice::from_slice(dependency_header_source_u8),
+        )
+        .into_boxed_slice()
+    };
     ir::deserialize_ir(&*json_utf8)
 }
 
diff --git a/rs_bindings_from_cc/json_from_cc.cc b/rs_bindings_from_cc/json_from_cc.cc
index c902284..d67504f 100644
--- a/rs_bindings_from_cc/json_from_cc.cc
+++ b/rs_bindings_from_cc/json_from_cc.cc
@@ -5,6 +5,7 @@
 #include <string>
 
 #include "base/logging.h"
+#include "rs_bindings_from_cc/bazel_types.h"
 #include "rs_bindings_from_cc/ffi_types.h"
 #include "rs_bindings_from_cc/ir.h"
 #include "rs_bindings_from_cc/ir_from_cc.h"
@@ -14,9 +15,23 @@
 
 namespace rs_bindings_from_cc {
 
+// LINT.IfChange
+static constexpr absl::string_view kDependencyTarget = "//test:dependency";
+
+static constexpr absl::string_view kDependencyHeaderName =
+    "test/dependency_header.h";
+// LINT.ThenChange(//depot/rs_bindings_from_cc/ir_testing.rs)
+
 // This is intended to be called from Rust.
-extern "C" FfiU8SliceBox json_from_cc(FfiU8Slice cc_source) {
-  absl::StatusOr<IR> ir = IrFromCc(StringViewFromFfiU8Slice(cc_source));
+extern "C" FfiU8SliceBox json_from_cc_dependency(
+    FfiU8Slice header_source, FfiU8Slice dependency_header_source) {
+  absl::StatusOr<IR> ir = IrFromCc(
+      StringViewFromFfiU8Slice(header_source), Label{"//test:testing_target"},
+      /* public_headers= */ {},
+      {{HeaderName(std::string(kDependencyHeaderName)),
+        std::string(StringViewFromFfiU8Slice(dependency_header_source))}},
+      {{HeaderName(std::string(kDependencyHeaderName)),
+        Label{kDependencyTarget}}});
   // TODO(forster): For now it is good enough to just exit: We are just using
   // this from tests, which are ok to just fail. Clang has already printed error
   // messages. If we start using this for production, then we should bridge the
diff --git a/rs_bindings_from_cc/test/golden/types_rs_api.rs b/rs_bindings_from_cc/test/golden/types_rs_api.rs
index 914825b..db38807 100644
--- a/rs_bindings_from_cc/test/golden/types_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/types_rs_api.rs
@@ -8,154 +8,6 @@
 use memoffset_unstable_const::offset_of;
 use static_assertions::const_assert_eq;
 
-// <unknown location>
-// Error while generating bindings for item 'std::__u':
-// Items contained in namespaces are not supported yet
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::':
-// UNIMPLEMENTED: Unsupported type 'max_align_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='max_align_t *']
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::':
-// The Record for method '(anonymous struct)::' could not be found
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::':
-// UNIMPLEMENTED: Unsupported type 'max_align_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='max_align_t *']
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::':
-// Parameter type 'const max_align_t &' is not supported
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::':
-// The Record for method '(anonymous struct)::' could not be found
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// UNIMPLEMENTED: Unsupported type 'max_align_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='max_align_t *']
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// Parameter type 'const max_align_t &' is not supported
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// Return type 'max_align_t &' is not supported
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// The Record for method '(anonymous struct)::operator=' could not be found
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::':
-// UNIMPLEMENTED: Unsupported type 'max_align_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='max_align_t *']
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::':
-// Parameter type 'max_align_t &&' is not supported
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::':
-// The Record for method '(anonymous struct)::' could not be found
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// UNIMPLEMENTED: Unsupported type 'max_align_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='max_align_t *']
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// Parameter type 'max_align_t &&' is not supported
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// Return type 'max_align_t &' is not supported
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// The Record for method '(anonymous struct)::operator=' could not be found
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::~':
-// UNIMPLEMENTED: Unsupported type 'max_align_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='max_align_t *']
-
-// google3/external/clang/toolchain/lib/clang/google3-trunk/include/__stddef_max_align_t.h;l=19
-// Error while generating bindings for item '(anonymous struct)::~':
-// The Record for method '(anonymous struct)::~' could not be found
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::':
-// UNIMPLEMENTED: Unsupported type '__fsid_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='__fsid_t *']
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::':
-// The Record for method '(anonymous struct)::' could not be found
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::':
-// UNIMPLEMENTED: Unsupported type '__fsid_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='__fsid_t *']
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::':
-// Parameter type 'const __fsid_t &' is not supported
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::':
-// The Record for method '(anonymous struct)::' could not be found
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// UNIMPLEMENTED: Unsupported type '__fsid_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='__fsid_t *']
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// Parameter type 'const __fsid_t &' is not supported
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// Return type '__fsid_t &' is not supported
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// The Record for method '(anonymous struct)::operator=' could not be found
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::':
-// UNIMPLEMENTED: Unsupported type '__fsid_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='__fsid_t *']
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::':
-// Parameter type '__fsid_t &&' is not supported
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::':
-// The Record for method '(anonymous struct)::' could not be found
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// UNIMPLEMENTED: Unsupported type '__fsid_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='__fsid_t *']
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// Parameter type '__fsid_t &&' is not supported
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// Return type '__fsid_t &' is not supported
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::operator=':
-// The Record for method '(anonymous struct)::operator=' could not be found
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::~':
-// UNIMPLEMENTED: Unsupported type '__fsid_t *' [type.googleapis.com/devtools.rust.cc_interop.rs_binding_from_cc.type='__fsid_t *']
-
-// <unknown location>
-// Error while generating bindings for item '(anonymous struct)::~':
-// The Record for method '(anonymous struct)::~' could not be found
-
 #[derive(Clone, Copy)]
 #[repr(C)]
 pub struct SomeStruct {
diff --git a/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs b/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs
index 67c5d9f..d0956e5 100644
--- a/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs
+++ b/rs_bindings_from_cc/test/golden/user_of_unsupported_rs_api.rs
@@ -20,54 +20,6 @@
 
 impl !Unpin for NontrivialCustomType {}
 
-// rs_bindings_from_cc/test/golden/unsupported.h;l=4
-// Error while generating bindings for item 'NontrivialCustomType::NontrivialCustomType':
-// Nested classes are not supported yet
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=5
-// Error while generating bindings for item 'NontrivialCustomType::NontrivialCustomType':
-// Parameter type 'struct NontrivialCustomType &&' is not supported
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=4
-// Error while generating bindings for item 'NontrivialCustomType::NontrivialCustomType':
-// Empty parameter names are not supported
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=4
-// Error while generating bindings for item 'NontrivialCustomType::operator=':
-// Empty parameter names are not supported
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=10
-// Error while generating bindings for item 'UnsupportedParamType':
-// Non-trivial_abi type 'struct NontrivialCustomType' is not supported by value as a parameter
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=11
-// Error while generating bindings for item 'UnsupportedUnnamedParam':
-// Empty parameter names are not supported
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=12
-// Error while generating bindings for item 'UnsupportedReturnType':
-// Non-trivial_abi type 'struct NontrivialCustomType' is not supported by value as a return type
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=14
-// Error while generating bindings for item 'MultipleReasons':
-// Non-trivial_abi type 'struct NontrivialCustomType' is not supported by value as a parameter
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=14
-// Error while generating bindings for item 'MultipleReasons':
-// Empty parameter names are not supported
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=14
-// Error while generating bindings for item 'MultipleReasons':
-// Non-trivial_abi type 'struct NontrivialCustomType' is not supported by value as a return type
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=17
-// Error while generating bindings for item 'ns::FunctionInNamespace':
-// Items contained in namespaces are not supported yet
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=18
-// Error while generating bindings for item 'ns::StructInNamespace':
-// Items contained in namespaces are not supported yet
-
 // namespace ns
 
 #[derive(Clone, Copy)]
@@ -77,34 +29,6 @@
     placeholder: core::mem::MaybeUninit<u8>,
 }
 
-// rs_bindings_from_cc/test/golden/unsupported.h;l=21
-// Error while generating bindings for item 'ContainingStruct::ContainingStruct':
-// Nested classes are not supported yet
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=22
-// Error while generating bindings for item 'ContainingStruct::NestedStruct':
-// Nested classes are not supported yet
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=22
-// Error while generating bindings for item 'ContainingStruct::NestedStruct::NestedStruct':
-// Nested classes are not supported yet
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=21
-// Error while generating bindings for item 'ContainingStruct::ContainingStruct':
-// Empty parameter names are not supported
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=21
-// Error while generating bindings for item 'ContainingStruct::operator=':
-// Empty parameter names are not supported
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=21
-// Error while generating bindings for item 'ContainingStruct::ContainingStruct':
-// Parameter type 'struct ContainingStruct &&' is not supported
-
-// rs_bindings_from_cc/test/golden/unsupported.h;l=21
-// Error while generating bindings for item 'ContainingStruct::operator=':
-// Parameter type 'struct ContainingStruct &&' is not supported
-
 // CRUBIT_RS_BINDINGS_FROM_CC_TEST_GOLDEN_UNSUPPORTED_H_
 
 // rs_bindings_from_cc/test/golden/user_of_unsupported.h;l=6