Delete `IR::is_stdlib_target()`.
I wanted to delete this to see what goes wrong, so that I could see why it was here. Instead, no tests broke. So I guess it doesn't have a reason to be here -- maybe it used to before we moved the standard library into its own (not "fake") BUILD rule?
PiperOrigin-RevId: 509518224
diff --git a/rs_bindings_from_cc/ir.rs b/rs_bindings_from_cc/ir.rs
index 9941436..d01dcc4 100644
--- a/rs_bindings_from_cc/ir.rs
+++ b/rs_bindings_from_cc/ir.rs
@@ -807,21 +807,6 @@
&self.flat_ir.current_target
}
- // Returns whether `target` is the target that corresponds to the C++
- // standard library.
- pub fn is_stdlib_target(&self, target: &BazelLabel) -> bool {
- // TODO(hlopko): Make this be a pointer comparison, now it's comparing string
- // values.
- // TODO(b/208377928): We don't yet have an actual target for the standard
- // library, so instead we're just testing against the "virtual target" that
- // AstVisitor::GetOwningTarget() returns if it can't find the header in the
- // header-to-target map.
- // Once we do have an actual target for the standard library, we may need to
- // query `self` to find out what it is, so we have a `self` parameter on this
- // method even though we currently don't use it.
- target.0.as_ref() == "//:virtual_clang_resource_dir_target"
- }
-
// Returns the standard Debug print string for the `flat_ir`. The reason why we
// don't use the debug print of `Self` is that `Self` contains HashMaps, and
// their debug print produces content that is not valid Rust code.
diff --git a/rs_bindings_from_cc/src_code_gen.rs b/rs_bindings_from_cc/src_code_gen.rs
index f27a0f2..b8d0b3f 100644
--- a/rs_bindings_from_cc/src_code_gen.rs
+++ b/rs_bindings_from_cc/src_code_gen.rs
@@ -2681,7 +2681,7 @@
) -> Result<GeneratedItem> {
let ir = db.ir();
if let Some(owning_target) = item.owning_target() {
- if !ir.is_current_target(owning_target) && !ir.is_stdlib_target(owning_target) {
+ if !ir.is_current_target(owning_target) {
return Ok(GeneratedItem::default());
}
}
@@ -2848,7 +2848,7 @@
/// Returns Some(crate_ident) if this is an imported crate.
fn rs_imported_crate_name(owning_target: &BazelLabel, ir: &IR) -> Option<Ident> {
- if ir.is_current_target(owning_target) || ir.is_stdlib_target(owning_target) {
+ if ir.is_current_target(owning_target){
None
} else {
let owning_crate_name = owning_target.target_name();
@@ -3624,7 +3624,7 @@
}
fn cc_struct_layout_assertion(record: &Record, ir: &IR) -> Result<TokenStream> {
- if !ir.is_current_target(&record.owning_target) && !ir.is_stdlib_target(&record.owning_target) {
+ if !ir.is_current_target(&record.owning_target) {
return Ok(quote! {});
}
let record_ident = format_cc_ident(record.cc_name.as_ref());