diff --git a/rs_bindings_from_cc/generate_bindings/database/code_snippet.rs b/rs_bindings_from_cc/generate_bindings/database/code_snippet.rs index d2d21086f..377e74a33 100644 --- a/rs_bindings_from_cc/generate_bindings/database/code_snippet.rs +++ b/rs_bindings_from_cc/generate_bindings/database/code_snippet.rs @@ -8,6 +8,7 @@ use crate::db::BindingsGenerator; use crate::rs_snippet::{PrimitiveName, RsTypeKind}; use arc_anyhow::{Error, Result}; use code_gen_utils::{expect_format_cc_type_name, make_rs_ident, CcInclude}; +use crubit_feature::CrubitFeature; use error_report::{anyhow, bail, ensure}; use ffi_types::FfiU8SliceBox; use flagset::FlagSet; @@ -20,7 +21,7 @@ use proc_macro2::{Ident, Literal, TokenStream}; use quote::format_ident; use quote::{quote, ToTokens}; use std::collections::HashMap; -use std::fmt::{Display, Formatter}; +use std::fmt::Display; use std::num::NonZeroUsize; use std::rc::Rc; @@ -105,38 +106,6 @@ pub struct BindingsTokens { pub rs_api_impl: TokenStream, } -/// A missing set of crubit features caused by a capability that requires that -/// feature. -/// -/// For example, if addition is not implemented due to missing the Experimental -/// feature on //foo, then we might have something like: -/// -/// ``` -/// RequiredCrubitFeature { -/// target: "//foo".into(), -/// item: "kFoo".into(), -/// missing_features: CrubitFeature::Experimental.into(), -/// capability_description: "int addition".into(), -/// } -/// ``` -#[derive(Clone, PartialEq, Eq, Debug)] -pub struct RequiredCrubitFeature { - pub target: BazelLabel, - pub item: Rc, - pub missing_features: flagset::FlagSet, - pub capability_description: Rc, -} - -impl Display for RequiredCrubitFeature { - fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { - let Self { capability_description, .. } = self; - if !capability_description.is_empty() { - write!(f, "{capability_description}")?; - } - Ok(()) - } -} - /// Returns the list of features required to use the item which are not yet /// enabled. /// @@ -145,224 +114,164 @@ impl Display for RequiredCrubitFeature { /// /// If the item does have a defining target, and it doesn't enable the specified /// features, then bindings are suppressed for this item. -pub fn required_crubit_features( - db: &BindingsGenerator, - item: &Item, -) -> Result> { +pub fn missing_feature_descriptions(db: &BindingsGenerator, item: &Item) -> Result> { let mut missing_features = vec![]; let ir = &db.ir(); - let require_any_feature = - |missing_features: &mut Vec, - alternative_required_features: flagset::FlagSet, - capability_description: &dyn Fn() -> Rc| { - // We refuse to generate bindings if either the definition of an item, or - // instantiation (if it is a template) of an item are in a translation unit - // which doesn't have the required Crubit features. - for target in db - .defining_target(item.id()) - .as_ref() - .into_iter() - .chain(item.owning_target().as_ref()) - { - let enabled_features = ir.target_crubit_features(target); - if (alternative_required_features & enabled_features).is_empty() { - missing_features.push(RequiredCrubitFeature { - target: target.clone(), - item: db.debug_name(item.id()), - missing_features: alternative_required_features, - capability_description: capability_description(), - }); - } + struct TargetAndFeatures { + target: BazelLabel, + features: flagset::FlagSet, + } + let defining_and_owning_target: Vec = db + .defining_target(item.id()) + .into_iter() + .chain(item.owning_target().into_iter()) + .map(|target| TargetAndFeatures { features: ir.target_crubit_features(&target), target }) + .collect(); + + let have_feature = |feature: CrubitFeature| -> bool { + // We refuse to generate bindings if either the definition of an item, or + // instantiation (if it is a template) of an item are in a translation unit + // which doesn't have the required Crubit features. + for TargetAndFeatures { target, .. } in &defining_and_owning_target { + let enabled_features = ir.target_crubit_features(target); + if !enabled_features.contains(feature) { + return false; } - }; + } + true + }; - let require_rs_type_kind = |missing_features: &mut Vec, - rs_type_kind: &RsTypeKind, - context: &dyn Fn() -> Rc| { - for target in - db.defining_target(item.id()).as_ref().into_iter().chain(item.owning_target().as_ref()) - { - let (missing, desc) = - rs_type_kind.required_crubit_features(ir.target_crubit_features(target)); - if !missing.is_empty() { - let context = context(); - let capability_description = if desc.is_empty() { - context - } else if context.is_empty() { - desc.into() - } else { - format!("{context}: {desc}").into() - }; - missing_features.push(RequiredCrubitFeature { - target: target.clone(), - item: db.debug_name(item.id()), - missing_features: missing, - capability_description, - }); + let missing_features_of_type = |rs_type_kind: &RsTypeKind| -> Option> { + for TargetAndFeatures { target, features } in &defining_and_owning_target { + let descriptions = + rs_type_kind.missing_feature_descriptions_of_type(target, features.clone()); + if !descriptions.is_empty() { + return Some(descriptions); } } + None }; - if let Some(unknown_attr) = item.unknown_attr() { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| { - format!("crubit.rs/errors/unknown_attribute: unknown attribute(s): {unknown_attr}") - .into() - }, - ); - } - match item { - Item::Constant(c) => { - if c.deprecated.is_some() { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| "[[deprecated]] attribute".into(), - ); - } + let missing_features_of_cc_type = |cc_type: ir::CcType| -> Option> { + match db.rs_type_kind(cc_type) { + Ok(rs_type_kind) => missing_features_of_type(&rs_type_kind), + Err(e) => Some(vec![e.to_string()]), } - Item::GlobalVar(g) => { - if g.deprecated.is_some() { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| "[[deprecated]] attribute".into(), - ); - } + }; + + let join_missing_with_context = |context: &str, missing: &[String]| -> String { + let desc = missing.join("\n").replace('\n', "\n "); + format!("{context}:\n {desc}") + }; + + if !have_feature(CrubitFeature::Experimental.into()) { + if let Some(unknown_attr) = item.unknown_attr() { + missing_features.push(format!( + "crubit.rs/errors/unknown_attribute: unknown attribute(s): {unknown_attr}" + )); } - Item::Comment { .. } | Item::UnsupportedItem(..) | Item::UseMod { .. } => {} + if let Item::Enum(e) = &item { + if e.nodiscard.is_some() { + missing_features.push("[[nodiscard]] attribute".to_string()); + }; + } + let is_deprecated = match item { + Item::Constant(c) => c.deprecated.is_some(), + Item::Enum(e) => e.deprecated.is_some(), + Item::Func(f) => f.deprecated.is_some(), + Item::GlobalVar(g) => g.deprecated.is_some(), + Item::Namespace(n) => n.deprecated.is_some(), + Item::Record(r) => r.deprecated.is_some(), + Item::TypeAlias(t) => t.deprecated.is_some(), + _ => false, + }; + if is_deprecated { + missing_features.push("[[deprecated]] attribute".to_string()); + } + } + + match item { + Item::Constant(_) + | Item::Comment { .. } + | Item::GlobalVar(_) + | Item::Namespace(_) + | Item::UnsupportedItem(..) + | Item::UseMod { .. } => {} Item::Func(func) => { if func.rs_name == UnqualifiedIdentifier::Destructor { // We support destructors in supported even though they use some features we // don't generally support with that feature set, because in this // particular case, it's safe. - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Types.into(), - &|| "destructors".into(), - ); - } else { - let return_type = db.rs_type_kind(func.return_type.clone())?; - require_rs_type_kind(&mut missing_features, &return_type, &|| { - "Unsupported return type".into() - }); - for (i, param) in func.params.iter().enumerate() { - let param_type = db.rs_type_kind(param.type_.clone())?; - require_rs_type_kind(&mut missing_features, ¶m_type, &|| { - format!("Unsupported parameter #{i} ({})", ¶m.identifier).into() - }); - } - if !func.has_c_calling_convention { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| "non-C calling convention".into(), - ); - } - if func.is_variadic { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| "variadic function".into(), - ); + if !have_feature(CrubitFeature::Types) { + missing_features.push("destructors".to_string()); } - if func.is_noreturn { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| "[[noreturn]] attribute".into(), - ); - } - if func.nodiscard.is_some() { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| "[[nodiscard]] attribute".into(), - ); + } else { + for param in &func.params { + if let Some(missing) = missing_features_of_cc_type(param.type_.clone()) { + missing_features.push(join_missing_with_context( + &format!( + "Unsupported parameter type `{} {}`", + db.cc_type_debug_name(¶m.type_), + param.identifier + ), + &missing, + )); + } } - if func.deprecated.is_some() { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| "[[deprecated]] attribute".into(), - ); + if let Some(missing) = missing_features_of_cc_type(func.return_type.clone()) { + missing_features.push(join_missing_with_context( + &format!( + "Unsupported return type `{}`", + db.cc_type_debug_name(&func.return_type) + ), + &missing, + )); } - for param in &func.params { - if let Some(unknown_attr) = ¶m.unknown_attr { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| { - format!( - "crubit.rs/errors/unknown_attribute: param {param} has unknown attribute(s): {unknown_attr}", - param = ¶m.identifier.identifier - ) - .into() - }, - ); + if !have_feature(CrubitFeature::Experimental) { + if !func.has_c_calling_convention { + missing_features.push("non-C calling convention".to_string()); + } + if func.is_variadic { + missing_features.push("variadic function".to_string()); + } + if func.is_noreturn { + missing_features.push("[[noreturn]] attribute".to_string()); + } + if func.nodiscard.is_some() { + missing_features.push("[[nodiscard]] attribute".to_string()); + } + for param in &func.params { + if let Some(unknown_attr) = ¶m.unknown_attr { + missing_features.push(format!( + "crubit.rs/errors/unknown_attribute: param {param} has unknown attribute(s): {unknown_attr}", + param = ¶m.identifier.identifier + )); + } } } } } Item::Record(_) | Item::TypeAlias(_) | Item::Enum(_) | Item::ExistingRustType(_) => { - require_rs_type_kind( - &mut missing_features, - // We use from_item_raw here because required_crubit_features is itself called - // by `BindingsGenerator::rs_type_kind()` in order to decide if it should return - // an error. - &RsTypeKind::from_item_raw( - db, - item.clone(), - /*have_reference_param=*/ false, - /*is_return_type=*/ true, - /*lifetimes=*/ &[], - )?, - &|| "".into(), - ); - let deprecated = match item { - Item::Record(r) => r.deprecated.clone(), - Item::TypeAlias(t) => t.deprecated.clone(), - Item::Enum(e) => { - if e.nodiscard.is_some() { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| "[[nodiscard]] attribute".into(), - ); - }; - e.deprecated.clone() - } - Item::ExistingRustType(_) => None, - _ => unreachable!(), - }; - if deprecated.is_some() { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| "[[deprecated]] attribute".into(), - ); - } - } - Item::Namespace(n) => { - if n.deprecated.is_some() { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Experimental.into(), - &|| "[[deprecated]] attribute".into(), - ); + // We use from_item_raw here because missing_feature_descriptions is itself called + // by `BindingsGenerator::rs_type_kind()` in order to decide if it should return + // an error. + if let Some(missing) = missing_features_of_type(&RsTypeKind::from_item_raw( + db, + item.clone(), + /*have_reference_param=*/ false, + /*is_return_type=*/ true, + /*lifetimes=*/ &[], + )?) { + missing_features.extend(missing); } } Item::IncompleteRecord(_) => { - require_any_feature( - &mut missing_features, - crubit_feature::CrubitFeature::Wrapper.into(), - &|| "incomplete type".into(), - ); + if !have_feature(CrubitFeature::Wrapper) { + missing_features.push("incomplete type".to_string()); + } } } Ok(missing_features) @@ -417,26 +326,24 @@ pub struct BindingsInfo { #[derive(Clone, PartialEq, Eq)] pub enum NoBindingsReason { MissingRequiredFeatures { - missing_features: Vec, + missing_features: Vec, }, DependencyFailed { - context: Rc, - error: Error, + type_name: String, + reason: String, }, LeadingDunder { - name: Rc, + name: String, }, + Visibility(Error), /// This is directly unsupported. - Unsupported { - context: Rc, - error: Error, - }, + Unsupported(Error), /// This item's parent was a record, but no nested items module could be generated because there /// were other records with nested items whose nested items module mapped to the same name. ParentModuleNameNotUnique { - conflicting_name: Rc, + conflicting_name: String, /// Invariant: more than 1 element. - parent_names_that_map_to_same_name: Vec>, + parent_names_that_map_to_same_name: Vec, }, /// This item's parent was a record, but no nested items module could be generated because there /// were other items that occupied the name in that parent's namespace. For example, a struct @@ -463,19 +370,15 @@ impl From for Error { fn from(reason: NoBindingsReason) -> Error { match reason { NoBindingsReason::MissingRequiredFeatures { missing_features } => { - let mut all_missing = vec![]; - for missing in missing_features { - all_missing.push(missing.to_string()); - } - anyhow!(all_missing.join("\n")) + anyhow!(missing_features.join("\n")) } - NoBindingsReason::DependencyFailed { error, .. } => { - anyhow!("depends on type with missing bindings: {error:#}") + NoBindingsReason::DependencyFailed { type_name, reason } => { + anyhow!("depends on `{type_name}` which cannot be bound because {reason}") } NoBindingsReason::LeadingDunder { name } => { anyhow!("Skipping generating bindings for '{name}' because it has a leading `__`") } - NoBindingsReason::Unsupported { error, .. } => error, + NoBindingsReason::Visibility(error) | NoBindingsReason::Unsupported(error) => error, NoBindingsReason::ParentModuleNameNotUnique { conflicting_name, parent_names_that_map_to_same_name, diff --git a/rs_bindings_from_cc/generate_bindings/database/db.rs b/rs_bindings_from_cc/generate_bindings/database/db.rs index 094791a89..5eb2c72ac 100644 --- a/rs_bindings_from_cc/generate_bindings/database/db.rs +++ b/rs_bindings_from_cc/generate_bindings/database/db.rs @@ -113,7 +113,6 @@ memoized::query_group! { /// Implementation: rs_bindings_from_cc/generate_bindings/generate_function.rs?q=function:generate_function fn generate_function(&self, func: Rc, derived_record: Option>) -> Result>; - /// You should call is_function_ambiguous() instead. /// /// Identifies all functions having overloads that we can't import (yet). @@ -217,7 +216,11 @@ impl<'db> BindingsGenerator<'db> { match self.type_target_restriction(rs_type_kind.clone())? { Some(label) if &label != library => { let rs_type_kind = rs_type_kind.display(self); - Err(anyhow!("{rs_type_kind} is `pub(crate)` in {label}")) + Err(anyhow!( + "crubit.rs/errors/visibility: Support for `{rs_type_kind}` is experimental.\n\ + Its use is restricted to `pub(crate)` in defining target:\n\ + `{label}`" + )) } Some(_) => Ok(Visibility::PubCrate), None => { @@ -322,6 +325,79 @@ impl<'db> BindingsGenerator<'db> { return format! {"{qualifier}{name}"}.into(); } + pub fn cc_type_debug_name(&self, cc_type: &CcType) -> String { + let base_name = match &cc_type.variant { + ir::CcTypeVariant::Primitive(p) => match p { + ir::Primitive::Bool => "bool", + ir::Primitive::Void => "void", + ir::Primitive::Float => "float", + ir::Primitive::Double => "double", + ir::Primitive::Char => "char", + ir::Primitive::SignedChar => "signed char", + ir::Primitive::UnsignedChar => "unsigned char", + ir::Primitive::Short => "short", + ir::Primitive::Int => "int", + ir::Primitive::Long => "long", + ir::Primitive::LongLong => "long long", + ir::Primitive::UnsignedShort => "unsigned short", + ir::Primitive::UnsignedInt => "unsigned int", + ir::Primitive::UnsignedLong => "unsigned long", + ir::Primitive::UnsignedLongLong => "unsigned long long", + ir::Primitive::Char16T => "char16_t", + ir::Primitive::Char32T => "char32_t", + ir::Primitive::PtrdiffT => "ptrdiff_t", + ir::Primitive::IntptrT => "intptr_t", + ir::Primitive::SizeT => "size_t", + ir::Primitive::UintptrT => "uintptr_t", + ir::Primitive::StdPtrdiffT => "std::ptrdiff_t", + ir::Primitive::StdIntptrT => "std::intptr_t", + ir::Primitive::StdSizeT => "std::size_t", + ir::Primitive::StdUintptrT => "std::uintptr_t", + ir::Primitive::Int8T => "int8_t", + ir::Primitive::Int16T => "int16_t", + ir::Primitive::Int32T => "int32_t", + ir::Primitive::Int64T => "int64_t", + ir::Primitive::StdInt8T => "std::int8_t", + ir::Primitive::StdInt16T => "std::int16_t", + ir::Primitive::StdInt32T => "std::int32_t", + ir::Primitive::StdInt64T => "std::int64_t", + ir::Primitive::Uint8T => "uint8_t", + ir::Primitive::Uint16T => "uint16_t", + ir::Primitive::Uint32T => "uint32_t", + ir::Primitive::Uint64T => "uint64_t", + ir::Primitive::StdUint8T => "std::uint8_t", + ir::Primitive::StdUint16T => "std::uint16_t", + ir::Primitive::StdUint32T => "std::uint32_t", + ir::Primitive::StdUint64T => "std::uint64_t", + } + .to_string(), + ir::CcTypeVariant::Pointer(ptr) => { + let ptr_str = match ptr.kind { + ir::PointerTypeKind::LValueRef => "&", + ir::PointerTypeKind::RValueRef => "&&", + ir::PointerTypeKind::Nullable + | ir::PointerTypeKind::NonNull + | ir::PointerTypeKind::Owned => "*", + }; + let pointee_name = self.cc_type_debug_name(&ptr.pointee_type); + format!("{pointee_name}{ptr_str}") + } + ir::CcTypeVariant::FuncPointer { .. } => "function pointer".to_string(), + ir::CcTypeVariant::Decl(id) => self.debug_name(*id).to_string(), + ir::CcTypeVariant::Error(err) => format!("", err.message), + }; + + if cc_type.is_const { + if matches!(cc_type.variant, ir::CcTypeVariant::Pointer(_)) { + format!("{} const", base_name) + } else { + format!("const {}", base_name) + } + } else { + base_name + } + } + pub fn new_unsupported_item( &self, item: &impl GenericItem, diff --git a/rs_bindings_from_cc/generate_bindings/database/rs_snippet.rs b/rs_bindings_from_cc/generate_bindings/database/rs_snippet.rs index 7f0acfb2a..cdd46627d 100644 --- a/rs_bindings_from_cc/generate_bindings/database/rs_snippet.rs +++ b/rs_bindings_from_cc/generate_bindings/database/rs_snippet.rs @@ -13,7 +13,6 @@ use crubit_feature::CrubitFeature; use error_report::{bail, ensure}; use flagset::FlagSet; use ir::*; -use itertools::Itertools; use proc_macro2::{Delimiter, Group, Ident, TokenStream, TokenTree}; use quote::{format_ident, quote, ToTokens}; use std::collections::HashSet; @@ -325,7 +324,8 @@ impl UniformReprTemplateType { let arg_type_kind = db.rs_type_kind(template_arg.clone())?; ensure!( !arg_type_kind.is_bridge_type(), - "Bridge types cannot be used as template arguments" + "`{}` cannot be used as a template argument because it is a bridged type\nSee crubit.rs/types.", + arg_type_kind.display(db), ); // We don't do this in required_crubit_features() because it doesn't know which // template arguments actually need to be free of errors. (For example, @@ -338,13 +338,19 @@ impl UniformReprTemplateType { match template_specialization_kind { Some(TemplateSpecializationKind::StdUniquePtr { element_type }) => { let element_type = type_arg(element_type)?; - ensure!(element_type.is_complete(), "Rust std::unique_ptr cannot be used with incomplete types, and `{}` is incomplete", element_type.display(db)); - ensure!(element_type.is_destructible(), "Rust std::unique_ptr requires that `T` be destructible, but the destructor of `{}` is non-public or deleted", element_type.display(db)); + ensure!(element_type.is_complete(), + "`{}` can't be used in a Rust std::unique_ptr because it is an incomplete type", + element_type.display(db)); + ensure!(element_type.is_destructible(), + "`{}` can't be used in a Rust std::unique_ptr because it has a deleted or non-public destructor", + element_type.display(db)); Ok(Some(Rc::new(UniformReprTemplateType::StdUniquePtr { element_type }))) } Some(TemplateSpecializationKind::StdVector { element_type }) => { let element_type = type_arg(element_type)?; - ensure!(element_type.is_destructible(), "Rust std::vector requires that `T` be destructible, but the destructor of `{}` is non-public or deleted", element_type.display(db)); + ensure!(element_type.is_destructible(), + "`{}` can't be used in a Rust std::vector becuase it has a deleted or non-public destructor", + element_type.display(db)); if element_type.overloads_operator_delete() { return Ok(None); } @@ -720,7 +726,12 @@ fn new_c9_co_record( }; let arg_type_kind = db.rs_type_kind(element_type.clone())?; if let RsTypeKind::Error { error, .. } = arg_type_kind { - return Err(error); + let element_name = db.cc_type_debug_name(element_type); + let desc = error.to_string().replace("\n", "\n "); + return Err(anyhow!( + "`c9::Co<{element_name}>` is unsupported because `{element_name}` is unavailable:\n\ + {desc}" + )); }; Ok(Some(BridgeRsTypeKind::C9Co { has_reference_param, result_type: Rc::new(arg_type_kind) })) } @@ -977,59 +988,53 @@ impl RsTypeKind { /// for both the template definition and its instantiation, and so both /// would need to be passed in to rs_type_kind() in order to be able to /// merge these two functions. - pub fn required_crubit_features<'a>( + pub fn missing_feature_descriptions_of_type<'a>( &self, + target: &BazelLabel, enabled_features: flagset::FlagSet, - ) -> (flagset::FlagSet, String) { + ) -> Vec { let mut missing_features = >::default(); - let mut reasons = >>::new(); - let mut require_feature = - |required_feature: CrubitFeature, - reason: Option<&dyn Fn() -> std::borrow::Cow<'static, str>>| { - let required_features = >::from(required_feature); - let missing = required_features - enabled_features; - if !missing.is_empty() { - missing_features |= missing; - if let Some(reason) = reason { - reasons.insert(reason()); - } - } - }; + let mut reasons = std::collections::BTreeSet::::new(); + let mut require_feature = |required_feature: CrubitFeature, reason: std::fmt::Arguments| { + let required_features = >::from(required_feature); + let missing = required_features - enabled_features; + if !missing.is_empty() { + missing_features |= missing; + reasons.insert(reason.to_string()); + } + }; + + if !enabled_features.contains(CrubitFeature::Types) { + require_feature( + CrubitFeature::Types, + format_args!("Crubit is not enabled on defining target:\n {target}"), + ); + } for rs_type_kind in self.dfs_iter() { match rs_type_kind { RsTypeKind::Error { error, visibility_override, .. } => { - if visibility_override.is_some() { - require_feature(CrubitFeature::Types, None) - } else { - require_feature( - CrubitFeature::Wrapper, - Some(&|| std::borrow::Cow::from(error.to_string())), - ) + if visibility_override.is_none() { + require_feature(CrubitFeature::Wrapper, format_args!("{error}")) } } - RsTypeKind::Pointer { .. } => require_feature(CrubitFeature::Types, None), RsTypeKind::Reference { .. } | RsTypeKind::RvalueReference { .. } => { require_feature( CrubitFeature::Experimental, - Some(&|| "references are not yet supported".into()), + format_args!("references are not yet supported"), ); } RsTypeKind::FuncPtr { cc_calling_conv, .. } => { - if *cc_calling_conv == CcCallingConv::C { - require_feature(CrubitFeature::Types, None); - } else { + if *cc_calling_conv != CcCallingConv::C { require_feature( CrubitFeature::Experimental, - Some(&|| { - "function pointers using a non-`C` calling convention are not yet supported".into() - }), + format_args!("function pointers using a non-`C` calling convention are not yet supported"), ); } } RsTypeKind::IncompleteRecord { .. } => require_feature( CrubitFeature::Wrapper, - Some(&|| "forward declared types are not yet supported".into()), + format_args!("forward declared types are not yet supported"), ), // Here, we can very carefully be non-recursive into the _structure_ of the type. // @@ -1046,23 +1051,23 @@ impl RsTypeKind { // temporary solution until we have a better way to handle template // instantiations. - if uniform_repr_template_type.is_some() || record.has_unique_owning_target() { - require_feature(CrubitFeature::Types, None); - } else { + if uniform_repr_template_type.is_none() && !record.has_unique_owning_target() { require_feature( CrubitFeature::Wrapper, - Some(&|| "template instantiation is not yet supported".into()), + format_args!("template instantiation is not yet supported"), ) } } - RsTypeKind::BridgeType { .. } => require_feature(CrubitFeature::Types, None), - RsTypeKind::ExistingRustType { .. } + + RsTypeKind::Pointer { .. } + | RsTypeKind::BridgeType { .. } + | RsTypeKind::ExistingRustType { .. } | RsTypeKind::Enum { .. } | RsTypeKind::TypeAlias { .. } - | RsTypeKind::Primitive { .. } => require_feature(CrubitFeature::Types, None), + | RsTypeKind::Primitive { .. } => {} } } - (missing_features, reasons.into_iter().join(", ")) + reasons.into_iter().collect() } // If the type is pointer annotated with CRUBIT_OWNED_POINTER, returns the pointee type. @@ -1138,11 +1143,11 @@ impl RsTypeKind { /// it can't. pub fn check_by_value(&self) -> Result<()> { match self.unalias() { - RsTypeKind::Error { error, .. } => bail!("Cannot use an error type by value: {error}"), + RsTypeKind::Error { error, .. } => Err(error.clone()), RsTypeKind::Record { record, .. } => record.check_by_value(), RsTypeKind::IncompleteRecord { incomplete_record, .. } => { bail!( - "Attempted to pass incomplete record type `{}` by-value", + "`{}` cannot be passed by-value because it is an incomplete type", incomplete_record.cc_name ) } diff --git a/rs_bindings_from_cc/generate_bindings/generate_struct_and_union.rs b/rs_bindings_from_cc/generate_bindings/generate_struct_and_union.rs index 9926feea7..28cc65a05 100644 --- a/rs_bindings_from_cc/generate_bindings/generate_struct_and_union.rs +++ b/rs_bindings_from_cc/generate_bindings/generate_struct_and_union.rs @@ -153,8 +153,8 @@ fn get_field_rs_type_kind_for_layout( db.defining_target(record.id()).as_ref().into_iter().chain([&record.owning_target]) { let enabled_features = ir.target_crubit_features(target); - let (missing_features, reason) = type_kind.required_crubit_features(enabled_features); - ensure!(missing_features.is_empty(), reason); + let reasons = type_kind.missing_feature_descriptions_of_type(target, enabled_features); + ensure!(reasons.is_empty(), reasons.join(", ")); } // In supported, we replace nontrivial fields with opaque blobs. diff --git a/rs_bindings_from_cc/generate_bindings/has_bindings.rs b/rs_bindings_from_cc/generate_bindings/has_bindings.rs index 2c72664d3..189b504ca 100644 --- a/rs_bindings_from_cc/generate_bindings/has_bindings.rs +++ b/rs_bindings_from_cc/generate_bindings/has_bindings.rs @@ -4,8 +4,7 @@ use arc_anyhow::{Context, Error, Result}; use database::code_snippet::{ - required_crubit_features, BindingsInfo, NoBindingsReason, RequiredCrubitFeature, ResolvedName, - Visibility, + missing_feature_descriptions, BindingsInfo, NoBindingsReason, ResolvedName, Visibility, }; use database::rs_snippet::RsTypeKind; use database::BindingsGenerator; @@ -20,21 +19,16 @@ pub fn has_bindings(db: &BindingsGenerator, item: Item) -> Result {} Ok(missing_features) => { return Err(NoBindingsReason::MissingRequiredFeatures { missing_features }); } - Err(error) => { - return Err(NoBindingsReason::DependencyFailed { - context: db.debug_name(item.id()), - error, - }); - } + Err(error) => return Err(NoBindingsReason::Unsupported(error)), } if let Some(parent) = item.enclosing_item_id() { @@ -42,8 +36,8 @@ pub fn has_bindings(db: &BindingsGenerator, item: Item) -> Result Result Result 1 { return Err(NoBindingsReason::ParentModuleNameNotUnique { - conflicting_name: parent_module_name, + conflicting_name: parent_module_name.to_string(), parent_names_that_map_to_same_name: parent_records_that_map_to_this_name .iter() .map(|&parent_record_id| { @@ -110,7 +100,7 @@ pub fn has_bindings(db: &BindingsGenerator, item: Item) -> Result Result Result;`. if let Err(error) = db.rs_type_kind(enum_.underlying_type.clone()) { return Err(NoBindingsReason::DependencyFailed { - context: db.debug_name(enum_.id()), - error, + type_name: db.debug_name(enum_.id()).to_string(), + reason: error.to_string(), }); } } @@ -146,8 +133,8 @@ pub fn has_bindings(db: &BindingsGenerator, item: Item) -> Result Result Result { if matches!(item, Item::TypeAlias(_)) && rs_type_kind.unalias().is_bridge_type() { - return Err(NoBindingsReason::Unsupported { - context: db.debug_name(item.id()), - error: anyhow!( - "Type alias for {cpp_type} suppressed due to being a bridge type", - cpp_type = db.debug_name(item.id()), - ), - }); + return Err(NoBindingsReason::Unsupported(anyhow!( + "Type alias for {cpp_type} suppressed due to being a bridge type", + cpp_type = db.debug_name(item.id()), + ))); } let visibility = type_visibility(db, &item, rs_type_kind)?; Ok(BindingsInfo { visibility }) } Err(error) => Err(NoBindingsReason::DependencyFailed { - context: db.debug_name(item.id()), - error, + type_name: db.debug_name(item.id()).to_string(), + reason: error.to_string(), }), } } @@ -215,9 +196,10 @@ pub fn has_bindings(db: &BindingsGenerator, item: Item) -> Result { - Err(NoBindingsReason::DependencyFailed { context: db.debug_name(item.id()), error }) - } + Err(error) => Err(NoBindingsReason::DependencyFailed { + type_name: db.debug_name(item.id()).to_string(), + reason: error.to_string(), + }), }, // Other items are public. Item::Comment(_) @@ -234,10 +216,9 @@ fn func_has_bindings( func: Rc, ) -> Result { if func.is_consteval { - return Err(NoBindingsReason::Unsupported { - context: db.debug_name(func.id()), - error: anyhow!("consteval functions are not supported"), - }); + return Err(NoBindingsReason::Unsupported(anyhow!( + "consteval functions are not supported" + ))); } let ir = db.ir(); @@ -250,13 +231,10 @@ fn func_has_bindings( && func.rs_name != ir::UnqualifiedIdentifier::Destructor && !enabled_features.contains(crubit_feature::CrubitFeature::Experimental) { - missing_features.push(RequiredCrubitFeature { - target: target.clone(), - item: db.debug_name(func.id()), - missing_features: crubit_feature::CrubitFeature::Experimental.into(), - capability_description: - "b/248542210: template instantiation of member function cannot reliably get bindings".into(), - }); + missing_features.push( + "b/248542210: template instantiation of member function cannot reliably get bindings" + .to_string(), + ); } let mut visibility = Visibility::Public; @@ -273,7 +251,7 @@ fn func_has_bindings( missing_features.extend(new_missing_features); // Keep going using public for now, we're not going to generate bindings anyway. } - Err(other_reason) => unreachable!("{:#?}", Error::from(other_reason)), + Err(other_reason) => return Err(other_reason), }; } @@ -309,27 +287,24 @@ pub fn type_target_restriction( db: &BindingsGenerator, rs_type_kind: RsTypeKind, ) -> Result> { - // We visit `self` twice, but it doesn't matter, we just need a starting value. - let mut most_restricted_subtype = type_target_restriction_shallow(db, rs_type_kind.clone()); - for child_type in rs_type_kind.dfs_iter() { + let mut dfs_iter = rs_type_kind.dfs_iter(); + // `unwrap()` is safe because we know there is at least the `Self type. + let mut most_restricted_subtype = type_target_restriction_shallow(db, dfs_iter.next().unwrap()); + for child_type in dfs_iter { intersect_target_restrictions( db, + &rs_type_kind, &mut most_restricted_subtype, - type_target_restriction_shallow(db, child_type.clone()), - ) - .with_context(|| { - format!("crubit.rs/errors/visibility: {} has child types which are `pub(crate)` in two different crates, and cannot be used", rs_type_kind.display(db)) - })?; + type_target_restriction_shallow(db, child_type), + )?; } - Ok(most_restricted_subtype.target) + Ok(most_restricted_subtype.map(|r| r.target)) } -/// A type representing a visibility restriction: if `target == Some("//foo:bar")`, the type -/// is a `pub(crate)` type defined in `//foo:bar`. If `target == None`, the type is `pub` and usable -/// by any crate in any target. +/// A visibility restriction indicating that a type is `pub(crate)` within a specific target. struct TargetRestriction { - /// If `None`, the type is `pub`. Otherwise, it's the target the type is pub(crate) for. - target: Option, + /// The target which provides the `pub(crate)` type. + target: BazelLabel, /// The type which is `pub(crate)`, used for error messages. exemplar_type: RsTypeKind, } @@ -341,25 +316,30 @@ struct TargetRestriction { /// The error contains just a list of the types it found that are incompatible. fn intersect_target_restrictions( db: &BindingsGenerator, - old_restriction: &mut TargetRestriction, - new_restriction: TargetRestriction, + original_type: &RsTypeKind, + old_restriction: &mut Option, + new_restriction: Option, ) -> Result<()> { - match (&old_restriction.target, &new_restriction.target) { - (_, None) => {} - (Some(old_label), Some(new_label)) => { - if old_label != new_label { - let old_type = old_restriction.exemplar_type.display(db); - let new_type = new_restriction.exemplar_type.display(db); - // The top-line error message is built in the caller, with these as - // a list of causes. - return Err(anyhow!("{old_type} is `pub(crate)` in {old_label}") - .context(format!("{new_type} is `pub(crate)` in {new_label}"))); - } - } - (_, _) => { - *old_restriction = new_restriction; + if let (Some(old_restriction), Some(new_restriction)) = (&old_restriction, &new_restriction) { + let old_target = &old_restriction.target; + let new_target = &new_restriction.target; + if old_target != new_target { + let original_type = original_type.display(db); + let old_type = old_restriction.exemplar_type.display(db); + let new_type = new_restriction.exemplar_type.display(db); + // The top-line error message is built in the caller, with these as + // a list of causes. + return Err(anyhow!( + "`{original_type}` depends on `pub(crate)` types from other targets:\n\ + {old_type} is `pub(crate)` in {old_target}\n\ + {new_type} is `pub(crate)` in {new_target}\n\ + See http://crubit.rs/errors/visibility" + )); } } + if old_restriction.is_none() { + *old_restriction = new_restriction; + } Ok(()) } @@ -369,33 +349,29 @@ fn intersect_target_restrictions( /// pointers are never `pub(crate)`, only their pointees can be. fn type_target_restriction_shallow( db: &BindingsGenerator, - rs_type_kind: RsTypeKind, -) -> TargetRestriction { - let mut target = match rs_type_kind.unalias() { - // Template types (except for the special-cased ones like `[w]string_view`). - RsTypeKind::Record { record, .. } if !record.has_unique_owning_target() => { - Some(&record.owning_target) - } - // All other types are `pub` if they receive bindings. - _ => None, + rs_type_kind: &RsTypeKind, +) -> Option { + let RsTypeKind::Record { record, .. } = rs_type_kind.unalias() else { + // All non-record types are `pub` if they receive bindings. + return None; }; - + // Template types (except for the special-cased ones like `[w]string_view`) + // are the only types whose bindings have restrictions, and they do not have + // unique owning targets. + if record.has_unique_owning_target() { + return None; + } // Instantiations of UniformReprTemplateTypes are unrestricted. if matches!(&rs_type_kind, RsTypeKind::Record { uniform_repr_template_type: Some(_), .. }) { - target = None; + return None; } - + let target = &record.owning_target; // Targets with experimental features generate `pub` bindings (for now?), no matter what. - if let Some(some_target) = target { - if db - .ir() - .target_crubit_features(some_target) - .contains(crubit_feature::CrubitFeature::Experimental) - { - target = None; - } + if db.ir().target_crubit_features(target).contains(crubit_feature::CrubitFeature::Experimental) + { + return None; } - TargetRestriction { target: target.cloned(), exemplar_type: rs_type_kind } + Some(TargetRestriction { target: target.clone(), exemplar_type: rs_type_kind.clone() }) } fn type_visibility( @@ -406,22 +382,7 @@ fn type_visibility( let Some(target) = item.owning_target() else { return Ok(Visibility::Public); }; - match db.type_visibility(&target, rs_type_kind.clone()) { - Ok(vis) => Ok(vis), - Err(error) => { - let missing_features = vec![RequiredCrubitFeature { - target: target.clone(), - // slightly hacky: we didn't keep track of which item in the type in particular - // is causing a visibility restriction, but we can stringify the whole type. - item: rs_type_kind.display(db).to_string().into(), - // All visibility restrictions are turned off in `:experimental`. - missing_features: crubit_feature::CrubitFeature::Experimental.into(), - // again a slight hack. - capability_description: error.to_string().into(), - }]; - Err(NoBindingsReason::MissingRequiredFeatures { missing_features }) - } - } + db.type_visibility(&target, rs_type_kind.clone()).map_err(NoBindingsReason::Visibility) } enum NameConflictAction { diff --git a/rs_bindings_from_cc/ir.rs b/rs_bindings_from_cc/ir.rs index 54ad4b3f7..1041c7d17 100644 --- a/rs_bindings_from_cc/ir.rs +++ b/rs_bindings_from_cc/ir.rs @@ -1352,12 +1352,12 @@ impl Record { pub fn check_by_value(&self) -> Result<()> { ensure!( self.destructor != SpecialMemberFunc::Unavailable, - "Can't directly construct values of type `{}` as it has a non-public or deleted destructor", + "`{}` can't be used by-value because it has a non-public or deleted destructor", self.cc_name ); ensure!( !self.is_abstract, - "Can't directly construct values of type `{}`: it is abstract", + "`{}` can be used by-value because it has pure virtual functions that are not overridden", self.cc_name ); Ok(()) diff --git a/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.rs b/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.rs index feafb7473..8b61c48a8 100644 --- a/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.rs +++ b/rs_bindings_from_cc/test/consume_absl/absl_functional.golden.rs @@ -488,17 +488,20 @@ pub fn MyOptionIntMapper() -> ::alloc::boxed::Box< // Generated from: third_party/absl/functional/internal/any_invocable.h;l=413 // error: class `absl::internal_any_invocable::CoreImpl, MyOption>` could not be bound -// template instantiation is not yet supported +// Crubit is not enabled on defining target: +// third_party/absl/functional/internal/any_invocable.h // template instantiation is not yet supported // Generated from: third_party/absl/functional/internal/any_invocable.h;l=413 // error: class `absl::internal_any_invocable::CoreImpl` could not be bound -// template instantiation is not yet supported +// Crubit is not enabled on defining target: +// third_party/absl/functional/internal/any_invocable.h // template instantiation is not yet supported // Generated from: third_party/absl/functional/internal/any_invocable.h;l=413 // error: class `absl::internal_any_invocable::CoreImpl` could not be bound -// template instantiation is not yet supported +// Crubit is not enabled on defining target: +// third_party/absl/functional/internal/any_invocable.h // template instantiation is not yet supported mod detail { diff --git a/rs_bindings_from_cc/test/display/displayables_api.rs b/rs_bindings_from_cc/test/display/displayables_api.rs index c04c4d362..b6bea1bdc 100644 --- a/rs_bindings_from_cc/test/display/displayables_api.rs +++ b/rs_bindings_from_cc/test/display/displayables_api.rs @@ -169,8 +169,10 @@ impl Default for CanOstream { // Generated from: rs_bindings_from_cc/test/display/displayables.h;l=46 // error: function `operator<<` could not be bound -// Unsupported return type: template instantiation is not yet supported -// Unsupported parameter #0 (out): template instantiation is not yet supported +// Unsupported parameter type `std::__u::ostream& out`: +// template instantiation is not yet supported +// Unsupported return type `std::__u::ostream&`: +// template instantiation is not yet supported /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=51 #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] @@ -215,8 +217,10 @@ impl Default for CanAbslStringifyAndOstream { // Generated from: rs_bindings_from_cc/test/display/displayables.h;l=61 // error: function `operator<<` could not be bound -// Unsupported return type: template instantiation is not yet supported -// Unsupported parameter #0 (out): template instantiation is not yet supported +// Unsupported parameter type `std::__u::ostream& out`: +// template instantiation is not yet supported +// Unsupported return type `std::__u::ostream&`: +// template instantiation is not yet supported /// Generated from: rs_bindings_from_cc/test/display/displayables.h;l=67 #[repr(transparent)] diff --git a/rs_bindings_from_cc/test/golden/clang_attrs_rs_api.rs b/rs_bindings_from_cc/test/golden/clang_attrs_rs_api.rs index 66b8e1dc4..83f5660c2 100644 --- a/rs_bindings_from_cc/test/golden/clang_attrs_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/clang_attrs_rs_api.rs @@ -120,7 +120,6 @@ pub mod template_with_preferred_name { // error: class `template_with_preferred_ // error: type alias `template_with_preferred_name::SpecializedTypeAlias` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported // Based on `llvm/include/c++/v1/string_view` - mimics definition of // `basic_string_view` class template (focusing on the attributes related to the @@ -131,7 +130,6 @@ pub mod template_with_preferred_name { // error: class `template_with_preferred_ // error: struct `template_with_preferred_name::SomeTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported mod detail { #[allow(unused_imports)] diff --git a/rs_bindings_from_cc/test/golden/compatibility_rs_api.rs b/rs_bindings_from_cc/test/golden/compatibility_rs_api.rs index 06cd39601..51393042f 100644 --- a/rs_bindings_from_cc/test/golden/compatibility_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/compatibility_rs_api.rs @@ -44,11 +44,14 @@ impl CompatibleType { } // error: constructor `CompatibleType::CompatibleType` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const CompatibleType& __param_0`: +// references are not yet supported // error: function `CompatibleType::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const CompatibleType& __param_0`: +// references are not yet supported +// Unsupported return type `CompatibleType&`: +// references are not yet supported pub mod compatible_type { #[inline(always)] diff --git a/rs_bindings_from_cc/test/golden/do_not_eagerly_import_template_type_args_rs_api.rs b/rs_bindings_from_cc/test/golden/do_not_eagerly_import_template_type_args_rs_api.rs index 41f95055f..105f86f0c 100644 --- a/rs_bindings_from_cc/test/golden/do_not_eagerly_import_template_type_args_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/do_not_eagerly_import_template_type_args_rs_api.rs @@ -23,20 +23,18 @@ // is incomplete, which is false. // error: function `ImportedFirst` could not be bound -// Unsupported parameter #0 (__param_0): template instantiation is not yet supported -// template instantiation is not yet supported +// Unsupported parameter type `DoesNotUse> __param_0`: +// template instantiation is not yet supported // We expect ImportedSecond to fail because we need wrapper mode, _not_ because // `DoesNotUse` is incomplete. // error: function `ImportedSecond` could not be bound -// Unsupported parameter #0 (__param_0): template instantiation is not yet supported -// template instantiation is not yet supported +// Unsupported parameter type `DoesNotUse __param_0`: +// template instantiation is not yet supported // error: struct `DoesNotUse>` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: struct `DoesNotUse` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported diff --git a/rs_bindings_from_cc/test/golden/doc_comment_rs_api.rs b/rs_bindings_from_cc/test/golden/doc_comment_rs_api.rs index 282524bad..60ae4aa99 100644 --- a/rs_bindings_from_cc/test/golden/doc_comment_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/doc_comment_rs_api.rs @@ -49,18 +49,24 @@ impl DocCommentSlashes { } // error: constructor `DocCommentSlashes::DocCommentSlashes` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const DocCommentSlashes& __param_0`: +// references are not yet supported // error: constructor `DocCommentSlashes::DocCommentSlashes` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `DocCommentSlashes&& __param_0`: +// references are not yet supported // error: function `DocCommentSlashes::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const DocCommentSlashes& __param_0`: +// references are not yet supported +// Unsupported return type `DocCommentSlashes&`: +// references are not yet supported // error: function `DocCommentSlashes::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `DocCommentSlashes&& __param_0`: +// references are not yet supported +// Unsupported return type `DocCommentSlashes&`: +// references are not yet supported /// The default constructor which will get translated into /// `impl Default for DocCommentSlashes`. @@ -154,18 +160,24 @@ impl Default for DocCommentBang { } // error: constructor `DocCommentBang::DocCommentBang` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const DocCommentBang& __param_0`: +// references are not yet supported // error: constructor `DocCommentBang::DocCommentBang` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `DocCommentBang&& __param_0`: +// references are not yet supported // error: function `DocCommentBang::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const DocCommentBang& __param_0`: +// references are not yet supported +// Unsupported return type `DocCommentBang&`: +// references are not yet supported // error: function `DocCommentBang::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `DocCommentBang&& __param_0`: +// references are not yet supported +// Unsupported return type `DocCommentBang&`: +// references are not yet supported /// Multiline comment /// @@ -196,18 +208,24 @@ impl Default for MultilineCommentTwoStars { } // error: constructor `MultilineCommentTwoStars::MultilineCommentTwoStars` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MultilineCommentTwoStars& __param_0`: +// references are not yet supported // error: constructor `MultilineCommentTwoStars::MultilineCommentTwoStars` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `MultilineCommentTwoStars&& __param_0`: +// references are not yet supported // error: function `MultilineCommentTwoStars::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MultilineCommentTwoStars& __param_0`: +// references are not yet supported +// Unsupported return type `MultilineCommentTwoStars&`: +// references are not yet supported // error: function `MultilineCommentTwoStars::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `MultilineCommentTwoStars&& __param_0`: +// references are not yet supported +// Unsupported return type `MultilineCommentTwoStars&`: +// references are not yet supported /// Line comment /// @@ -238,18 +256,24 @@ impl Default for LineComment { } // error: constructor `LineComment::LineComment` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const LineComment& __param_0`: +// references are not yet supported // error: constructor `LineComment::LineComment` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `LineComment&& __param_0`: +// references are not yet supported // error: function `LineComment::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const LineComment& __param_0`: +// references are not yet supported +// Unsupported return type `LineComment&`: +// references are not yet supported // error: function `LineComment::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `LineComment&& __param_0`: +// references are not yet supported +// Unsupported return type `LineComment&`: +// references are not yet supported /// Multiline comment /// @@ -280,18 +304,24 @@ impl Default for MultilineOneStar { } // error: constructor `MultilineOneStar::MultilineOneStar` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MultilineOneStar& __param_0`: +// references are not yet supported // error: constructor `MultilineOneStar::MultilineOneStar` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `MultilineOneStar&& __param_0`: +// references are not yet supported // error: function `MultilineOneStar::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MultilineOneStar& __param_0`: +// references are not yet supported +// Unsupported return type `MultilineOneStar&`: +// references are not yet supported // error: function `MultilineOneStar::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `MultilineOneStar&& __param_0`: +// references are not yet supported +// Unsupported return type `MultilineOneStar&`: +// references are not yet supported /// A function #[inline(always)] @@ -313,11 +343,9 @@ pub type MyTypeAlias = crate::DocCommentSlashes; // error: type alias `MyInstantiation` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: type alias `MySpecializedInstantiation` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `OuterTemplate` could not be bound // Class templates are not yet supported @@ -327,15 +355,12 @@ pub type MyTypeAlias = crate::DocCommentSlashes; // error: struct `MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: struct `MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: struct `OuterTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported mod detail { #[allow(unused_imports)] diff --git a/rs_bindings_from_cc/test/golden/enums_rs_api.rs b/rs_bindings_from_cc/test/golden/enums_rs_api.rs index a3c427834..85863efc7 100644 --- a/rs_bindings_from_cc/test/golden/enums_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/enums_rs_api.rs @@ -314,7 +314,7 @@ impl From for ::ffi_11::c_char { // b/322391132: Forward-declared (opaque) enums are not implemented yet // error: function `do_not_generate_bindings_for_me` could not be bound -// Cannot use an error type by value: b/322391132: Forward-declared (opaque) enums are not implemented yet +// b/322391132: Forward-declared (opaque) enums are not implemented yet pub const kAnonRed: ::ffi_11::c_uint = ::ffi_11::new_c_uint(0); diff --git a/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs b/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs index ab6639a2b..1cdab8ff6 100644 --- a/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/inheritance_rs_api.rs @@ -41,18 +41,24 @@ impl Default for Base0 { } // error: constructor `Base0::Base0` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Base0& __param_0`: +// references are not yet supported // error: constructor `Base0::Base0` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Base0&& __param_0`: +// references are not yet supported // error: function `Base0::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Base0& __param_0`: +// references are not yet supported +// Unsupported return type `Base0&`: +// references are not yet supported // error: function `Base0::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Base0&& __param_0`: +// references are not yet supported +// Unsupported return type `Base0&`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(8))] @@ -85,18 +91,24 @@ impl Default for Base1 { } // error: constructor `Base1::Base1` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Base1& __param_0`: +// references are not yet supported // error: constructor `Base1::Base1` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Base1&& __param_0`: +// references are not yet supported // error: function `Base1::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Base1& __param_0`: +// references are not yet supported +// Unsupported return type `Base1&`: +// references are not yet supported // error: function `Base1::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Base1&& __param_0`: +// references are not yet supported +// Unsupported return type `Base1&`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(2))] @@ -126,18 +138,24 @@ impl Default for Base2 { } // error: constructor `Base2::Base2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Base2& __param_0`: +// references are not yet supported // error: constructor `Base2::Base2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Base2&& __param_0`: +// references are not yet supported // error: function `Base2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Base2& __param_0`: +// references are not yet supported +// Unsupported return type `Base2&`: +// references are not yet supported // error: function `Base2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Base2&& __param_0`: +// references are not yet supported +// Unsupported return type `Base2&`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(8))] @@ -165,18 +183,24 @@ impl Default for Derived { } // error: constructor `Derived::Derived` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Derived& __param_0`: +// references are not yet supported // error: constructor `Derived::Derived` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Derived&& __param_0`: +// references are not yet supported // error: function `Derived::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Derived& __param_0`: +// references are not yet supported +// Unsupported return type `Derived&`: +// references are not yet supported // error: function `Derived::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Derived&& __param_0`: +// references are not yet supported +// Unsupported return type `Derived&`: +// references are not yet supported #[::ctor::recursively_pinned] #[repr(C, align(8))] @@ -208,18 +232,24 @@ impl ::ctor::CtorNew<()> for VirtualBase1 { } // error: constructor `VirtualBase1::VirtualBase1` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const VirtualBase1& __param_0`: +// references are not yet supported // error: constructor `VirtualBase1::VirtualBase1` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `VirtualBase1&& __param_0`: +// references are not yet supported // error: function `VirtualBase1::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const VirtualBase1& __param_0`: +// references are not yet supported +// Unsupported return type `VirtualBase1&`: +// references are not yet supported // error: function `VirtualBase1::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `VirtualBase1&& __param_0`: +// references are not yet supported +// Unsupported return type `VirtualBase1&`: +// references are not yet supported #[::ctor::recursively_pinned] #[repr(C, align(8))] @@ -251,18 +281,24 @@ impl ::ctor::CtorNew<()> for VirtualBase2 { } // error: constructor `VirtualBase2::VirtualBase2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const VirtualBase2& __param_0`: +// references are not yet supported // error: constructor `VirtualBase2::VirtualBase2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `VirtualBase2&& __param_0`: +// references are not yet supported // error: function `VirtualBase2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const VirtualBase2& __param_0`: +// references are not yet supported +// Unsupported return type `VirtualBase2&`: +// references are not yet supported // error: function `VirtualBase2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `VirtualBase2&& __param_0`: +// references are not yet supported +// Unsupported return type `VirtualBase2&`: +// references are not yet supported #[::ctor::recursively_pinned] #[repr(C, align(8))] @@ -294,18 +330,24 @@ impl ::ctor::CtorNew<()> for VirtualDerived { } // error: constructor `VirtualDerived::VirtualDerived` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const VirtualDerived& __param_0`: +// references are not yet supported // error: constructor `VirtualDerived::VirtualDerived` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `VirtualDerived&& __param_0`: +// references are not yet supported // error: function `VirtualDerived::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const VirtualDerived& __param_0`: +// references are not yet supported +// Unsupported return type `VirtualDerived&`: +// references are not yet supported // error: function `VirtualDerived::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `VirtualDerived&& __param_0`: +// references are not yet supported +// Unsupported return type `VirtualDerived&`: +// references are not yet supported #[::ctor::recursively_pinned] #[repr(C, align(8))] @@ -321,14 +363,16 @@ unsafe impl ::cxx::ExternType for MyAbstractClass { } // error: constructor `MyAbstractClass::MyAbstractClass` could not be bound -// Can't directly construct values of type `MyAbstractClass` as it has a non-public or deleted destructor +// `MyAbstractClass` can't be used by-value because it has a non-public or deleted destructor // error: constructor `MyAbstractClass::MyAbstractClass` could not be bound -// Can't directly construct values of type `MyAbstractClass` as it has a non-public or deleted destructor +// `MyAbstractClass` can't be used by-value because it has a non-public or deleted destructor // error: function `MyAbstractClass::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MyAbstractClass& __param_0`: +// references are not yet supported +// Unsupported return type `MyAbstractClass&`: +// references are not yet supported /// Method inheritance #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] @@ -378,18 +422,24 @@ impl Default for MethodBase1 { } // error: constructor `MethodBase1::MethodBase1` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MethodBase1& __param_0`: +// references are not yet supported // error: constructor `MethodBase1::MethodBase1` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `MethodBase1&& __param_0`: +// references are not yet supported // error: function `MethodBase1::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MethodBase1& __param_0`: +// references are not yet supported +// Unsupported return type `MethodBase1&`: +// references are not yet supported // error: function `MethodBase1::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `MethodBase1&& __param_0`: +// references are not yet supported +// Unsupported return type `MethodBase1&`: +// references are not yet supported pub mod method_base1 { #[inline(always)] @@ -452,18 +502,24 @@ impl Default for MethodBase2 { } // error: constructor `MethodBase2::MethodBase2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MethodBase2& __param_0`: +// references are not yet supported // error: constructor `MethodBase2::MethodBase2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `MethodBase2&& __param_0`: +// references are not yet supported // error: function `MethodBase2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MethodBase2& __param_0`: +// references are not yet supported +// Unsupported return type `MethodBase2&`: +// references are not yet supported // error: function `MethodBase2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `MethodBase2&& __param_0`: +// references are not yet supported +// Unsupported return type `MethodBase2&`: +// references are not yet supported pub mod method_base2 { #[inline(always)] @@ -501,18 +557,24 @@ impl Default for MethodDerived { } // error: constructor `MethodDerived::MethodDerived` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MethodDerived& __param_0`: +// references are not yet supported // error: constructor `MethodDerived::MethodDerived` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `MethodDerived&& __param_0`: +// references are not yet supported // error: function `MethodDerived::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const MethodDerived& __param_0`: +// references are not yet supported +// Unsupported return type `MethodDerived&`: +// references are not yet supported // error: function `MethodDerived::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `MethodDerived&& __param_0`: +// references are not yet supported +// Unsupported return type `MethodDerived&`: +// references are not yet supported // error: function `MethodDerived::Colliding1` could not be bound // Function aliases are not yet supported. diff --git a/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs b/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs index 0f5eb16d8..7739b0f71 100644 --- a/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/lifetimes_rs_api.rs @@ -47,7 +47,7 @@ pub unsafe fn ConsumeArray(pair: *mut ::ffi_11::c_int) { } // error: type alias `Arr` could not be bound -// depends on type with missing bindings: Unsupported type 'int[2]': Unsupported clang::Type class 'ConstantArray' +// Unsupported type 'int[2]': Unsupported clang::Type class 'ConstantArray' /// # Safety /// diff --git a/rs_bindings_from_cc/test/golden/no_unique_address_rs_api.rs b/rs_bindings_from_cc/test/golden/no_unique_address_rs_api.rs index 4a07a29fa..15597cf2e 100644 --- a/rs_bindings_from_cc/test/golden/no_unique_address_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/no_unique_address_rs_api.rs @@ -57,18 +57,24 @@ impl Default for Struct { } // error: constructor `Struct::Struct` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Struct& __param_0`: +// references are not yet supported // error: constructor `Struct::Struct` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Struct&& __param_0`: +// references are not yet supported // error: function `Struct::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Struct& __param_0`: +// references are not yet supported +// Unsupported return type `Struct&`: +// references are not yet supported // error: function `Struct::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Struct&& __param_0`: +// references are not yet supported +// Unsupported return type `Struct&`: +// references are not yet supported pub mod r#struct { #[inline(always)] @@ -128,18 +134,24 @@ impl Default for PaddingBetweenFields { } // error: constructor `PaddingBetweenFields::PaddingBetweenFields` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const PaddingBetweenFields& __param_0`: +// references are not yet supported // error: constructor `PaddingBetweenFields::PaddingBetweenFields` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `PaddingBetweenFields&& __param_0`: +// references are not yet supported // error: function `PaddingBetweenFields::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const PaddingBetweenFields& __param_0`: +// references are not yet supported +// Unsupported return type `PaddingBetweenFields&`: +// references are not yet supported // error: function `PaddingBetweenFields::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `PaddingBetweenFields&& __param_0`: +// references are not yet supported +// Unsupported return type `PaddingBetweenFields&`: +// references are not yet supported pub mod padding_between_fields { #[inline(always)] @@ -194,11 +206,14 @@ impl ::ctor::CtorNew<()> for FieldInTailPadding_InnerStruct { } // error: constructor `FieldInTailPadding_InnerStruct::FieldInTailPadding_InnerStruct` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const FieldInTailPadding_InnerStruct& __param_0`: +// references are not yet supported // error: function `FieldInTailPadding_InnerStruct::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const FieldInTailPadding_InnerStruct& __param_0`: +// references are not yet supported +// Unsupported return type `FieldInTailPadding_InnerStruct&`: +// references are not yet supported /// User-defined destructor to make this struct non-POD for the purposes of /// layout. @@ -236,10 +251,12 @@ unsafe impl ::cxx::ExternType for FieldInTailPadding { } // error: constructor `FieldInTailPadding::FieldInTailPadding` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const FieldInTailPadding& __param_0`: +// references are not yet supported // error: constructor `FieldInTailPadding::FieldInTailPadding` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `FieldInTailPadding&& __param_0`: +// references are not yet supported impl ::ctor::PinnedDrop for FieldInTailPadding { #[inline(always)] @@ -249,12 +266,16 @@ impl ::ctor::PinnedDrop for FieldInTailPadding { } // error: function `FieldInTailPadding::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const FieldInTailPadding& __param_0`: +// references are not yet supported +// Unsupported return type `FieldInTailPadding&`: +// references are not yet supported // error: function `FieldInTailPadding::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `FieldInTailPadding&& __param_0`: +// references are not yet supported +// Unsupported return type `FieldInTailPadding&`: +// references are not yet supported impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_char, ::ffi_11::c_char)> for FieldInTailPadding { type CtorType = ::ctor::Ctor![Self]; diff --git a/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api.rs b/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api.rs index 4bcc40fd7..0827534fa 100644 --- a/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/nontrivial_type_rs_api.rs @@ -109,21 +109,28 @@ impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_int)> for Nontrivial { } // error: constructor `Nontrivial::Nontrivial` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Nontrivial& __param_0`: +// references are not yet supported // error: constructor `Nontrivial::Nontrivial` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Nontrivial&& __param_0`: +// references are not yet supported // error: function `Nontrivial::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Nontrivial& __param_0`: +// references are not yet supported +// Unsupported return type `Nontrivial&`: +// references are not yet supported // error: function `Nontrivial::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Nontrivial&& __param_0`: +// references are not yet supported +// Unsupported return type `Nontrivial&`: +// references are not yet supported // error: function `Nontrivial::operator=` could not be bound -// Unsupported return type: references are not yet supported +// Unsupported return type `Nontrivial&`: +// references are not yet supported impl ::ctor::Assign for Nontrivial { #[inline(always)] @@ -148,22 +155,28 @@ impl ::ctor::PinnedDrop for Nontrivial { } // error: function `Nontrivial::RvalueRefQualified` could not be bound -// Unsupported parameter #0 (__this): references are not yet supported +// Unsupported parameter type `Nontrivial&& __this`: +// references are not yet supported // error: function `Nontrivial::ConstRvalueRefQualified` could not be bound -// Unsupported parameter #0 (__this): references are not yet supported +// Unsupported parameter type `const Nontrivial&& __this`: +// references are not yet supported // error: function `Nontrivial::operator==` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const Nontrivial& rhs`: +// references are not yet supported // error: function `Nontrivial::operator!=` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const Nontrivial& rhs`: +// references are not yet supported // error: function `Nontrivial::operator<` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const Nontrivial& rhs`: +// references are not yet supported // error: function `Nontrivial::operator+` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const Nontrivial& rhs`: +// references are not yet supported // error: function `Nontrivial::operator+=` could not be bound // Compound assignment operators are not supported for non-Unpin types, found ::core::pin::Pin<&'a mut crate::Nontrivial> @@ -272,21 +285,28 @@ impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_int)> for NontrivialInline { } // error: constructor `NontrivialInline::NontrivialInline` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const NontrivialInline& __param_0`: +// references are not yet supported // error: constructor `NontrivialInline::NontrivialInline` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NontrivialInline&& __param_0`: +// references are not yet supported // error: function `NontrivialInline::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const NontrivialInline& __param_0`: +// references are not yet supported +// Unsupported return type `NontrivialInline&`: +// references are not yet supported // error: function `NontrivialInline::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NontrivialInline&& __param_0`: +// references are not yet supported +// Unsupported return type `NontrivialInline&`: +// references are not yet supported // error: function `NontrivialInline::operator=` could not be bound -// Unsupported return type: references are not yet supported +// Unsupported return type `NontrivialInline&`: +// references are not yet supported impl ::ctor::PinnedDrop for NontrivialInline { #[inline(always)] @@ -339,10 +359,12 @@ impl ::ctor::CtorNew<()> for NontrivialMembers { } // error: constructor `NontrivialMembers::NontrivialMembers` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const NontrivialMembers& __param_0`: +// references are not yet supported // error: constructor `NontrivialMembers::NontrivialMembers` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NontrivialMembers&& __param_0`: +// references are not yet supported impl ::ctor::PinnedDrop for NontrivialMembers { #[inline(always)] @@ -352,12 +374,16 @@ impl ::ctor::PinnedDrop for NontrivialMembers { } // error: function `NontrivialMembers::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const NontrivialMembers& __param_0`: +// references are not yet supported +// Unsupported return type `NontrivialMembers&`: +// references are not yet supported // error: function `NontrivialMembers::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NontrivialMembers&& __param_0`: +// references are not yet supported +// Unsupported return type `NontrivialMembers&`: +// references are not yet supported /// Nontrivial, but trivially relocatable and final (and therefore Unpin). #[repr(C)] @@ -435,24 +461,32 @@ impl ::ctor::CtorNew<(::ffi_11::c_int, ::ffi_11::c_int)> for NontrivialUnpin { } // error: constructor `NontrivialUnpin::NontrivialUnpin` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const NontrivialUnpin& __param_0`: +// references are not yet supported // error: constructor `NontrivialUnpin::NontrivialUnpin` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NontrivialUnpin&& __param_0`: +// references are not yet supported // error: constructor `NontrivialUnpin::NontrivialUnpin` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Nontrivial&& __param_0`: +// references are not yet supported // error: function `NontrivialUnpin::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const NontrivialUnpin& __param_0`: +// references are not yet supported +// Unsupported return type `NontrivialUnpin&`: +// references are not yet supported // error: function `NontrivialUnpin::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NontrivialUnpin&& __param_0`: +// references are not yet supported +// Unsupported return type `NontrivialUnpin&`: +// references are not yet supported // error: function `NontrivialUnpin::operator=` could not be bound -// Unsupported return type: references are not yet supported +// Unsupported return type `NontrivialUnpin&`: +// references are not yet supported impl Drop for NontrivialUnpin { #[inline(always)] @@ -509,36 +543,52 @@ pub fn TakesByValueUnpin(mut nontrivial: crate::NontrivialUnpin) -> crate::Nontr } // error: function `TakesByReference` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #0 (nontrivial): references are not yet supported +// Unsupported parameter type `Nontrivial& nontrivial`: +// references are not yet supported +// Unsupported return type `Nontrivial&`: +// references are not yet supported // error: function `TakesUnpinByReference` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #0 (nontrivial): references are not yet supported +// Unsupported parameter type `NontrivialUnpin& nontrivial`: +// references are not yet supported +// Unsupported return type `NontrivialUnpin&`: +// references are not yet supported // error: function `TakesByConstReference` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #0 (nontrivial): references are not yet supported +// Unsupported parameter type `const Nontrivial& nontrivial`: +// references are not yet supported +// Unsupported return type `const Nontrivial&`: +// references are not yet supported // error: function `TakesUnpinByConstReference` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #0 (nontrivial): references are not yet supported +// Unsupported parameter type `const NontrivialUnpin& nontrivial`: +// references are not yet supported +// Unsupported return type `const NontrivialUnpin&`: +// references are not yet supported // error: function `TakesByRvalueReference` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #0 (nontrivial): references are not yet supported +// Unsupported parameter type `Nontrivial&& nontrivial`: +// references are not yet supported +// Unsupported return type `Nontrivial&&`: +// references are not yet supported // error: function `TakesUnpinByRvalueReference` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #0 (nontrivial): references are not yet supported +// Unsupported parameter type `NontrivialUnpin&& nontrivial`: +// references are not yet supported +// Unsupported return type `NontrivialUnpin&&`: +// references are not yet supported // error: function `TakesByConstRvalueReference` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #0 (nontrivial): references are not yet supported +// Unsupported parameter type `const Nontrivial&& nontrivial`: +// references are not yet supported +// Unsupported return type `const Nontrivial&&`: +// references are not yet supported // error: function `TakesUnpinByConstRvalueReference` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #0 (nontrivial): references are not yet supported +// Unsupported parameter type `const NontrivialUnpin&& nontrivial`: +// references are not yet supported +// Unsupported return type `const NontrivialUnpin&&`: +// references are not yet supported /// Finally, testing for strange by-value APIs. #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] @@ -555,18 +605,24 @@ unsafe impl ::cxx::ExternType for NontrivialByValue { } // error: constructor `NontrivialByValue::NontrivialByValue` could not be bound -// Unsupported parameter #1 (other): references are not yet supported +// Unsupported parameter type `const NontrivialByValue& other`: +// references are not yet supported // error: constructor `NontrivialByValue::NontrivialByValue` could not be bound -// Unsupported parameter #1 (other): references are not yet supported +// Unsupported parameter type `NontrivialByValue&& other`: +// references are not yet supported // error: function `NontrivialByValue::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (other): references are not yet supported +// Unsupported parameter type `const NontrivialByValue& other`: +// references are not yet supported +// Unsupported return type `NontrivialByValue&`: +// references are not yet supported // error: function `NontrivialByValue::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (other): references are not yet supported +// Unsupported parameter type `NontrivialByValue&& other`: +// references are not yet supported +// Unsupported return type `NontrivialByValue&`: +// references are not yet supported impl<'other> ::ctor::UnpinAssign<::ctor::RvalueReference<'other, crate::Nontrivial>> for NontrivialByValue diff --git a/rs_bindings_from_cc/test/golden/operators_rs_api.rs b/rs_bindings_from_cc/test/golden/operators_rs_api.rs index 74a593719..b8126f227 100644 --- a/rs_bindings_from_cc/test/golden/operators_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/operators_rs_api.rs @@ -41,21 +41,28 @@ impl Default for AddableConstMember { } // error: constructor `AddableConstMember::AddableConstMember` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableConstMember& __param_0`: +// references are not yet supported // error: constructor `AddableConstMember::AddableConstMember` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableConstMember&& __param_0`: +// references are not yet supported // error: function `AddableConstMember::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableConstMember& __param_0`: +// references are not yet supported +// Unsupported return type `AddableConstMember&`: +// references are not yet supported // error: function `AddableConstMember::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableConstMember&& __param_0`: +// references are not yet supported +// Unsupported return type `AddableConstMember&`: +// references are not yet supported // error: function `AddableConstMember::operator+` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const AddableConstMember& rhs`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] @@ -85,21 +92,28 @@ impl Default for AddableNonConstMember { } // error: constructor `AddableNonConstMember::AddableNonConstMember` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableNonConstMember& __param_0`: +// references are not yet supported // error: constructor `AddableNonConstMember::AddableNonConstMember` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableNonConstMember&& __param_0`: +// references are not yet supported // error: function `AddableNonConstMember::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableNonConstMember& __param_0`: +// references are not yet supported +// Unsupported return type `AddableNonConstMember&`: +// references are not yet supported // error: function `AddableNonConstMember::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableNonConstMember&& __param_0`: +// references are not yet supported +// Unsupported return type `AddableNonConstMember&`: +// references are not yet supported // error: function `AddableNonConstMember::operator+` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const AddableNonConstMember& rhs`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] @@ -129,22 +143,30 @@ impl Default for AddableFriend { } // error: constructor `AddableFriend::AddableFriend` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableFriend& __param_0`: +// references are not yet supported // error: constructor `AddableFriend::AddableFriend` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableFriend&& __param_0`: +// references are not yet supported // error: function `AddableFriend::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableFriend& __param_0`: +// references are not yet supported +// Unsupported return type `AddableFriend&`: +// references are not yet supported // error: function `AddableFriend::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableFriend&& __param_0`: +// references are not yet supported +// Unsupported return type `AddableFriend&`: +// references are not yet supported // error: function `operator+` could not be bound -// Unsupported parameter #0 (lhs): references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const AddableFriend& lhs`: +// references are not yet supported +// Unsupported parameter type `const AddableFriend& rhs`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -171,18 +193,24 @@ impl Default for AddableFreeByConstRef { } // error: constructor `AddableFreeByConstRef::AddableFreeByConstRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableFreeByConstRef& __param_0`: +// references are not yet supported // error: constructor `AddableFreeByConstRef::AddableFreeByConstRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableFreeByConstRef&& __param_0`: +// references are not yet supported // error: function `AddableFreeByConstRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableFreeByConstRef& __param_0`: +// references are not yet supported +// Unsupported return type `AddableFreeByConstRef&`: +// references are not yet supported // error: function `AddableFreeByConstRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableFreeByConstRef&& __param_0`: +// references are not yet supported +// Unsupported return type `AddableFreeByConstRef&`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -209,18 +237,24 @@ impl Default for AddableFreeByMutRef { } // error: constructor `AddableFreeByMutRef::AddableFreeByMutRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableFreeByMutRef& __param_0`: +// references are not yet supported // error: constructor `AddableFreeByMutRef::AddableFreeByMutRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableFreeByMutRef&& __param_0`: +// references are not yet supported // error: function `AddableFreeByMutRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableFreeByMutRef& __param_0`: +// references are not yet supported +// Unsupported return type `AddableFreeByMutRef&`: +// references are not yet supported // error: function `AddableFreeByMutRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableFreeByMutRef&& __param_0`: +// references are not yet supported +// Unsupported return type `AddableFreeByMutRef&`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -247,18 +281,24 @@ impl Default for AddableFreeByValue { } // error: constructor `AddableFreeByValue::AddableFreeByValue` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableFreeByValue& __param_0`: +// references are not yet supported // error: constructor `AddableFreeByValue::AddableFreeByValue` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableFreeByValue&& __param_0`: +// references are not yet supported // error: function `AddableFreeByValue::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableFreeByValue& __param_0`: +// references are not yet supported +// Unsupported return type `AddableFreeByValue&`: +// references are not yet supported // error: function `AddableFreeByValue::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableFreeByValue&& __param_0`: +// references are not yet supported +// Unsupported return type `AddableFreeByValue&`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -285,26 +325,36 @@ impl Default for AddableFreeByRValueRef { } // error: constructor `AddableFreeByRValueRef::AddableFreeByRValueRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableFreeByRValueRef& __param_0`: +// references are not yet supported // error: constructor `AddableFreeByRValueRef::AddableFreeByRValueRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableFreeByRValueRef&& __param_0`: +// references are not yet supported // error: function `AddableFreeByRValueRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableFreeByRValueRef& __param_0`: +// references are not yet supported +// Unsupported return type `AddableFreeByRValueRef&`: +// references are not yet supported // error: function `AddableFreeByRValueRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableFreeByRValueRef&& __param_0`: +// references are not yet supported +// Unsupported return type `AddableFreeByRValueRef&`: +// references are not yet supported // error: function `operator+` could not be bound -// Unsupported parameter #0 (lhs): references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const AddableFreeByConstRef& lhs`: +// references are not yet supported +// Unsupported parameter type `const AddableFreeByConstRef& rhs`: +// references are not yet supported // error: function `operator+` could not be bound -// Unsupported parameter #0 (lhs): references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `AddableFreeByMutRef& lhs`: +// references are not yet supported +// Unsupported parameter type `AddableFreeByMutRef& rhs`: +// references are not yet supported impl ::core::ops::Add for crate::AddableFreeByValue { type Output = crate::AddableFreeByValue; @@ -350,24 +400,32 @@ impl Default for Overloaded { } // error: constructor `Overloaded::Overloaded` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Overloaded& __param_0`: +// references are not yet supported // error: constructor `Overloaded::Overloaded` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Overloaded&& __param_0`: +// references are not yet supported // error: function `Overloaded::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Overloaded& __param_0`: +// references are not yet supported +// Unsupported return type `Overloaded&`: +// references are not yet supported // error: function `Overloaded::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Overloaded&& __param_0`: +// references are not yet supported +// Unsupported return type `Overloaded&`: +// references are not yet supported // error: function `operator+` could not be bound -// Unsupported parameter #0 (lhs): references are not yet supported +// Unsupported parameter type `const Overloaded& lhs`: +// references are not yet supported // error: function `operator+` could not be bound -// Unsupported parameter #0 (lhs): references are not yet supported +// Unsupported parameter type `const Overloaded& lhs`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -394,18 +452,24 @@ impl Default for IncompatibleLHS { } // error: constructor `IncompatibleLHS::IncompatibleLHS` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const IncompatibleLHS& __param_0`: +// references are not yet supported // error: constructor `IncompatibleLHS::IncompatibleLHS` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `IncompatibleLHS&& __param_0`: +// references are not yet supported // error: function `IncompatibleLHS::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const IncompatibleLHS& __param_0`: +// references are not yet supported +// Unsupported return type `IncompatibleLHS&`: +// references are not yet supported // error: function `IncompatibleLHS::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `IncompatibleLHS&& __param_0`: +// references are not yet supported +// Unsupported return type `IncompatibleLHS&`: +// references are not yet supported // error: function `operator+` could not be bound // Non-record-nor-reference operator parameters are not yet supported, found ::ffi_11::c_int @@ -441,21 +505,28 @@ impl Default for AddableReturnsVoid { } // error: constructor `AddableReturnsVoid::AddableReturnsVoid` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableReturnsVoid& __param_0`: +// references are not yet supported // error: constructor `AddableReturnsVoid::AddableReturnsVoid` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableReturnsVoid&& __param_0`: +// references are not yet supported // error: function `AddableReturnsVoid::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableReturnsVoid& __param_0`: +// references are not yet supported +// Unsupported return type `AddableReturnsVoid&`: +// references are not yet supported // error: function `AddableReturnsVoid::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddableReturnsVoid&& __param_0`: +// references are not yet supported +// Unsupported return type `AddableReturnsVoid&`: +// references are not yet supported // error: function `AddableReturnsVoid::operator+` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const AddableReturnsVoid& rhs`: +// references are not yet supported #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C, align(4))] @@ -490,14 +561,18 @@ impl ::ctor::CtorNew<()> for AddableConstMemberNonunpin { } // error: constructor `AddableConstMemberNonunpin::AddableConstMemberNonunpin` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableConstMemberNonunpin& __param_0`: +// references are not yet supported // error: function `AddableConstMemberNonunpin::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddableConstMemberNonunpin& __param_0`: +// references are not yet supported +// Unsupported return type `AddableConstMemberNonunpin&`: +// references are not yet supported // error: function `AddableConstMemberNonunpin::operator+` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const AddableConstMemberNonunpin& rhs`: +// references are not yet supported impl ::ctor::PinnedDrop for AddableConstMemberNonunpin { #[inline(always)] @@ -531,18 +606,24 @@ impl Default for AddAssignMemberInt { } // error: constructor `AddAssignMemberInt::AddAssignMemberInt` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignMemberInt& __param_0`: +// references are not yet supported // error: constructor `AddAssignMemberInt::AddAssignMemberInt` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignMemberInt&& __param_0`: +// references are not yet supported // error: function `AddAssignMemberInt::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignMemberInt& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignMemberInt&`: +// references are not yet supported // error: function `AddAssignMemberInt::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignMemberInt&& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignMemberInt&`: +// references are not yet supported impl ::core::ops::AddAssign<::ffi_11::c_int> for AddAssignMemberInt { #[inline(always)] @@ -578,22 +659,30 @@ impl Default for AddAssignMemberByConstRef { } // error: constructor `AddAssignMemberByConstRef::AddAssignMemberByConstRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignMemberByConstRef& __param_0`: +// references are not yet supported // error: constructor `AddAssignMemberByConstRef::AddAssignMemberByConstRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignMemberByConstRef&& __param_0`: +// references are not yet supported // error: function `AddAssignMemberByConstRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignMemberByConstRef& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignMemberByConstRef&`: +// references are not yet supported // error: function `AddAssignMemberByConstRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignMemberByConstRef&& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignMemberByConstRef&`: +// references are not yet supported // error: function `AddAssignMemberByConstRef::operator+=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const AddAssignMemberByConstRef& rhs`: +// references are not yet supported +// Unsupported return type `AddAssignMemberByConstRef&`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -620,18 +709,24 @@ impl Default for AddAssignFreeByConstRef { } // error: constructor `AddAssignFreeByConstRef::AddAssignFreeByConstRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignFreeByConstRef& __param_0`: +// references are not yet supported // error: constructor `AddAssignFreeByConstRef::AddAssignFreeByConstRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignFreeByConstRef&& __param_0`: +// references are not yet supported // error: function `AddAssignFreeByConstRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignFreeByConstRef& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignFreeByConstRef&`: +// references are not yet supported // error: function `AddAssignFreeByConstRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignFreeByConstRef&& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignFreeByConstRef&`: +// references are not yet supported impl ::core::ops::AddAssign<&Self> for crate::AddAssignFreeByConstRef { #[inline(always)] @@ -667,22 +762,30 @@ impl Default for AddAssignFreeByValue { } // error: constructor `AddAssignFreeByValue::AddAssignFreeByValue` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignFreeByValue& __param_0`: +// references are not yet supported // error: constructor `AddAssignFreeByValue::AddAssignFreeByValue` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignFreeByValue&& __param_0`: +// references are not yet supported // error: function `AddAssignFreeByValue::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignFreeByValue& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignFreeByValue&`: +// references are not yet supported // error: function `AddAssignFreeByValue::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignFreeByValue&& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignFreeByValue&`: +// references are not yet supported // error: function `operator+=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #0 (lhs): references are not yet supported +// Unsupported parameter type `AddAssignFreeByValue& lhs`: +// references are not yet supported +// Unsupported return type `AddAssignFreeByValue&`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -709,18 +812,24 @@ impl Default for AddAssignFriendByConstRef { } // error: constructor `AddAssignFriendByConstRef::AddAssignFriendByConstRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignFriendByConstRef& __param_0`: +// references are not yet supported // error: constructor `AddAssignFriendByConstRef::AddAssignFriendByConstRef` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignFriendByConstRef&& __param_0`: +// references are not yet supported // error: function `AddAssignFriendByConstRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignFriendByConstRef& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignFriendByConstRef&`: +// references are not yet supported // error: function `AddAssignFriendByConstRef::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignFriendByConstRef&& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignFriendByConstRef&`: +// references are not yet supported impl ::core::ops::AddAssign<&Self> for crate::AddAssignFriendByConstRef { #[inline(always)] @@ -756,22 +865,30 @@ impl Default for AddAssignFriendByValue { } // error: constructor `AddAssignFriendByValue::AddAssignFriendByValue` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignFriendByValue& __param_0`: +// references are not yet supported // error: constructor `AddAssignFriendByValue::AddAssignFriendByValue` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignFriendByValue&& __param_0`: +// references are not yet supported // error: function `AddAssignFriendByValue::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignFriendByValue& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignFriendByValue&`: +// references are not yet supported // error: function `AddAssignFriendByValue::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignFriendByValue&& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignFriendByValue&`: +// references are not yet supported // error: function `operator+=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #0 (lhs): references are not yet supported +// Unsupported parameter type `AddAssignFriendByValue& lhs`: +// references are not yet supported +// Unsupported return type `AddAssignFriendByValue&`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -800,18 +917,24 @@ impl Default for AddAssignProhibitedConstMember { } // error: constructor `AddAssignProhibitedConstMember::AddAssignProhibitedConstMember` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignProhibitedConstMember& __param_0`: +// references are not yet supported // error: constructor `AddAssignProhibitedConstMember::AddAssignProhibitedConstMember` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignProhibitedConstMember&& __param_0`: +// references are not yet supported // error: function `AddAssignProhibitedConstMember::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignProhibitedConstMember& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignProhibitedConstMember&`: +// references are not yet supported // error: function `AddAssignProhibitedConstMember::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignProhibitedConstMember&& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignProhibitedConstMember&`: +// references are not yet supported #[diagnostic::on_unimplemented( message = "binding generation for function failed\nCompound assignment with const left-hand side is not supported, found &'a crate::AddAssignProhibitedConstMember" @@ -858,21 +981,28 @@ impl Default for AddAssignProhibitedFriendConstLhs { } // error: constructor `AddAssignProhibitedFriendConstLhs::AddAssignProhibitedFriendConstLhs` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignProhibitedFriendConstLhs& __param_0`: +// references are not yet supported // error: constructor `AddAssignProhibitedFriendConstLhs::AddAssignProhibitedFriendConstLhs` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignProhibitedFriendConstLhs&& __param_0`: +// references are not yet supported // error: function `AddAssignProhibitedFriendConstLhs::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const AddAssignProhibitedFriendConstLhs& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignProhibitedFriendConstLhs&`: +// references are not yet supported // error: function `AddAssignProhibitedFriendConstLhs::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `AddAssignProhibitedFriendConstLhs&& __param_0`: +// references are not yet supported +// Unsupported return type `AddAssignProhibitedFriendConstLhs&`: +// references are not yet supported // error: function `operator+=` could not be bound -// Unsupported parameter #0 (lhs): references are not yet supported +// Unsupported parameter type `const AddAssignProhibitedFriendConstLhs& lhs`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -905,18 +1035,24 @@ impl Default for ManyOperators { } // error: constructor `ManyOperators::ManyOperators` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const ManyOperators& __param_0`: +// references are not yet supported // error: constructor `ManyOperators::ManyOperators` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `ManyOperators&& __param_0`: +// references are not yet supported // error: function `ManyOperators::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const ManyOperators& __param_0`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported // error: function `ManyOperators::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `ManyOperators&& __param_0`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported impl<'a> ::core::ops::Neg for &'a crate::ManyOperators { type Output = crate::ManyOperators; @@ -952,74 +1088,104 @@ impl<'a> ::core::ops::Not for &'a crate::ManyOperators { // Bindings for this kind of operator (operator ~ with 1 parameter(s)) are not supported // error: function `ManyOperators::operator+` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported // error: function `ManyOperators::operator-` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported // error: function `ManyOperators::operator*` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported // error: function `ManyOperators::operator/` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported // error: function `ManyOperators::operator%` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported // error: function `ManyOperators::operator&` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported // error: function `ManyOperators::operator|` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported // error: function `ManyOperators::operator^` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported // error: function `ManyOperators::operator<<` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported // error: function `ManyOperators::operator>>` could not be bound -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported // error: function `ManyOperators::operator+=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported // error: function `ManyOperators::operator-=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported // error: function `ManyOperators::operator*=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported // error: function `ManyOperators::operator/=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported // error: function `ManyOperators::operator%=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported // error: function `ManyOperators::operator&=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported // error: function `ManyOperators::operator|=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported // error: function `ManyOperators::operator^=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported // error: function `ManyOperators::operator<<=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported // error: function `ManyOperators::operator>>=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (rhs): references are not yet supported +// Unsupported parameter type `const ManyOperators& rhs`: +// references are not yet supported +// Unsupported return type `ManyOperators&`: +// references are not yet supported pub mod many_operators { #[inline(always)] diff --git a/rs_bindings_from_cc/test/golden/overloads_rs_api.rs b/rs_bindings_from_cc/test/golden/overloads_rs_api.rs index bbebc4863..d9f560a20 100644 --- a/rs_bindings_from_cc/test/golden/overloads_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/overloads_rs_api.rs @@ -86,12 +86,12 @@ impl Default for Foo { } // error: function `Foo::Bar` could not be bound -// Unsupported parameter #1 (__param_0): template instantiation is not yet supported -// template instantiation is not yet supported +// Unsupported parameter type `Sizeof __param_0`: +// template instantiation is not yet supported // error: function `Foo::Bar` could not be bound -// Unsupported parameter #1 (__param_0): template instantiation is not yet supported -// template instantiation is not yet supported +// Unsupported parameter type `Sizeof __param_0`: +// template instantiation is not yet supported pub mod foo { /// # Safety @@ -106,11 +106,9 @@ pub mod foo { // error: struct `Sizeof` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: struct `Sizeof` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported mod detail { #[allow(unused_imports)] diff --git a/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs b/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs index a0a3704ae..e7c2165ff 100644 --- a/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/polymorphic_rs_api.rs @@ -43,11 +43,14 @@ impl ::ctor::CtorNew<()> for PolymorphicBase { } // error: constructor `PolymorphicBase::PolymorphicBase` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const PolymorphicBase& __param_0`: +// references are not yet supported // error: function `PolymorphicBase::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const PolymorphicBase& __param_0`: +// references are not yet supported +// Unsupported return type `PolymorphicBase&`: +// references are not yet supported impl ::ctor::PinnedDrop for PolymorphicBase { #[inline(always)] @@ -101,11 +104,14 @@ impl ::ctor::CtorNew<()> for PolymorphicBase2 { } // error: constructor `PolymorphicBase2::PolymorphicBase2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const PolymorphicBase2& __param_0`: +// references are not yet supported // error: function `PolymorphicBase2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const PolymorphicBase2& __param_0`: +// references are not yet supported +// Unsupported return type `PolymorphicBase2&`: +// references are not yet supported impl ::ctor::PinnedDrop for PolymorphicBase2 { #[inline(always)] @@ -160,10 +166,12 @@ impl ::ctor::CtorNew<()> for PolymorphicDerived { } // error: constructor `PolymorphicDerived::PolymorphicDerived` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const PolymorphicDerived& __param_0`: +// references are not yet supported // error: constructor `PolymorphicDerived::PolymorphicDerived` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `PolymorphicDerived&& __param_0`: +// references are not yet supported impl ::ctor::PinnedDrop for PolymorphicDerived { #[inline(always)] @@ -173,12 +181,16 @@ impl ::ctor::PinnedDrop for PolymorphicDerived { } // error: function `PolymorphicDerived::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const PolymorphicDerived& __param_0`: +// references are not yet supported +// Unsupported return type `PolymorphicDerived&`: +// references are not yet supported // error: function `PolymorphicDerived::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `PolymorphicDerived&& __param_0`: +// references are not yet supported +// Unsupported return type `PolymorphicDerived&`: +// references are not yet supported unsafe impl ::operator::Delete for crate::PolymorphicDerived { #[inline(always)] diff --git a/rs_bindings_from_cc/test/golden/private_members_rs_api.rs b/rs_bindings_from_cc/test/golden/private_members_rs_api.rs index 576156e04..2f342c574 100644 --- a/rs_bindings_from_cc/test/golden/private_members_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/private_members_rs_api.rs @@ -55,18 +55,24 @@ pub mod test_namespace_bindings { } // error: constructor `test_namespace_bindings::SomeClass::SomeClass` could not be bound - // Unsupported parameter #1 (__param_0): references are not yet supported + // Unsupported parameter type `const test_namespace_bindings::SomeClass& __param_0`: + // references are not yet supported // error: constructor `test_namespace_bindings::SomeClass::SomeClass` could not be bound - // Unsupported parameter #1 (__param_0): references are not yet supported + // Unsupported parameter type `test_namespace_bindings::SomeClass&& __param_0`: + // references are not yet supported // error: function `test_namespace_bindings::SomeClass::operator=` could not be bound - // Unsupported return type: references are not yet supported - // Unsupported parameter #1 (__param_0): references are not yet supported + // Unsupported parameter type `const test_namespace_bindings::SomeClass& __param_0`: + // references are not yet supported + // Unsupported return type `test_namespace_bindings::SomeClass&`: + // references are not yet supported // error: function `test_namespace_bindings::SomeClass::operator=` could not be bound - // Unsupported return type: references are not yet supported - // Unsupported parameter #1 (__param_0): references are not yet supported + // Unsupported parameter type `test_namespace_bindings::SomeClass&& __param_0`: + // references are not yet supported + // Unsupported return type `test_namespace_bindings::SomeClass&`: + // references are not yet supported pub mod some_class { #[inline(always)] diff --git a/rs_bindings_from_cc/test/golden/templates_rs_api.rs b/rs_bindings_from_cc/test/golden/templates_rs_api.rs index dce89d754..cd29008ad 100644 --- a/rs_bindings_from_cc/test/golden/templates_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/templates_rs_api.rs @@ -43,11 +43,9 @@ pub mod test_namespace_bindings { // error: type alias `test_namespace_bindings::MyTypeAlias` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported // error: type alias `test_namespace_bindings::OtherTypeAliasInSameTarget` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -77,22 +75,18 @@ pub mod test_namespace_bindings { // error: type alias `test_namespace_bindings::TemplateWithStructTemplateParam` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported // error: type alias `test_namespace_bindings::ParamFromDifferentScope` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported // error: class `test_namespace_bindings::TemplateWithTwoParams` could not be bound // Class templates are not yet supported // error: type alias `test_namespace_bindings::AliasToTemplateWithTwoParams` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported // error: type alias `test_namespace_bindings::AliasToTemplateOfATemplate` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported // error: class `test_namespace_bindings::MyStruct` could not be bound // Class templates are not yet supported @@ -105,7 +99,6 @@ pub mod test_namespace_bindings { // error: type alias `test_namespace_bindings::MyCharStruct` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported // Forward declared explicit class template specialization should be imported // so the forward declaration code is generated (`forward_declare!`). @@ -125,10 +118,10 @@ pub mod test_namespace_bindings { // error: type alias `TopLevelTemplateWithNonTopLevelParam` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: function `processForwardDeclaredSpecialization` could not be bound -// Unsupported parameter #0 (i): incomplete type +// Unsupported parameter type `MyTopLevelTemplate* i`: +// incomplete type pub mod template_template_params { // error: class `template_template_params::Policy` could not be bound // Class templates are not yet supported @@ -138,7 +131,6 @@ pub mod template_template_params { // error: class `template_template_params::Po // error: type alias `template_template_params::MyTypeAlias` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported } // namespace template_template_params @@ -171,42 +163,33 @@ pub mod private_classes { // error: class `test_namespace_bindings::MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `test_namespace_bindings::MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `test_namespace_bindings::MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: struct `test_namespace_bindings::TemplateWithTwoParams, int>` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: struct `test_namespace_bindings::TemplateWithTwoParams` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: struct `test_namespace_bindings::TemplateWithTwoParams` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: struct `test_namespace_bindings::MyStruct` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: struct `MyTopLevelTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: struct `MyTopLevelTemplate` could not be bound // incomplete type // error: class `template_template_params::MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `forward_declared_template::ForwardDeclaredTemplate` could not be bound // incomplete type diff --git a/rs_bindings_from_cc/test/golden/templates_source_order_rs_api.rs b/rs_bindings_from_cc/test/golden/templates_source_order_rs_api.rs index c053b353d..3fe8b3811 100644 --- a/rs_bindings_from_cc/test/golden/templates_source_order_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/templates_source_order_rs_api.rs @@ -42,27 +42,21 @@ impl Default for TopLevel { // error: type alias `Alias1` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: type alias `Alias2` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: type alias `Alias3` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: type alias `Alias4` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: type alias `Alias5` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: type alias `Alias6` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported pub mod test_namespace_bindings { #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] @@ -93,54 +87,42 @@ pub mod test_namespace_bindings { // error: type alias `test_namespace_bindings::Alias7` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported // error: type alias `test_namespace_bindings::Alias8` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported // error: type alias `test_namespace_bindings::Alias9` could not be bound // template instantiation is not yet supported - // template instantiation is not yet supported } // namespace test_namespace_bindings // error: class `MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `MyTemplate>` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `MyTemplate>` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // error: class `MyTemplate` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported mod detail { #[allow(unused_imports)] diff --git a/rs_bindings_from_cc/test/golden/trivial_type_rs_api.rs b/rs_bindings_from_cc/test/golden/trivial_type_rs_api.rs index 5bf4a1c64..03077c546 100644 --- a/rs_bindings_from_cc/test/golden/trivial_type_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/trivial_type_rs_api.rs @@ -59,24 +59,32 @@ pub mod ns { } // error: constructor `ns::Trivial::Trivial` could not be bound - // Unsupported parameter #1 (__param_0): references are not yet supported + // Unsupported parameter type `const ns::Trivial& __param_0`: + // references are not yet supported // error: constructor `ns::Trivial::Trivial` could not be bound - // Unsupported parameter #1 (__param_0): references are not yet supported + // Unsupported parameter type `ns::Trivial&& __param_0`: + // references are not yet supported // error: function `ns::Trivial::operator=` could not be bound - // Unsupported return type: references are not yet supported - // Unsupported parameter #1 (__param_0): references are not yet supported + // Unsupported parameter type `const ns::Trivial& __param_0`: + // references are not yet supported + // Unsupported return type `ns::Trivial&`: + // references are not yet supported // error: function `ns::Trivial::operator=` could not be bound - // Unsupported return type: references are not yet supported - // Unsupported parameter #1 (__param_0): references are not yet supported + // Unsupported parameter type `ns::Trivial&& __param_0`: + // references are not yet supported + // Unsupported return type `ns::Trivial&`: + // references are not yet supported // error: function `ns::Trivial::RvalueRefQualified` could not be bound - // Unsupported parameter #0 (__this): references are not yet supported + // Unsupported parameter type `ns::Trivial&& __this`: + // references are not yet supported // error: function `ns::Trivial::ConstRvalueRefQualified` could not be bound - // Unsupported parameter #0 (__this): references are not yet supported + // Unsupported parameter type `const ns::Trivial&& __this`: + // references are not yet supported pub mod trivial { #[inline(always)] @@ -112,20 +120,28 @@ pub mod ns { } // error: function `ns::TakesByReference` could not be bound - // Unsupported return type: references are not yet supported - // Unsupported parameter #0 (trivial): references are not yet supported + // Unsupported parameter type `ns::Trivial& trivial`: + // references are not yet supported + // Unsupported return type `ns::Trivial&`: + // references are not yet supported // error: function `ns::TakesByConstReference` could not be bound - // Unsupported return type: references are not yet supported - // Unsupported parameter #0 (trivial): references are not yet supported + // Unsupported parameter type `const ns::Trivial& trivial`: + // references are not yet supported + // Unsupported return type `const ns::Trivial&`: + // references are not yet supported // error: function `ns::TakesByRvalueReference` could not be bound - // Unsupported return type: references are not yet supported - // Unsupported parameter #0 (trivial): references are not yet supported + // Unsupported parameter type `ns::Trivial&& trivial`: + // references are not yet supported + // Unsupported return type `ns::Trivial&&`: + // references are not yet supported // error: function `ns::TakesByConstRvalueReference` could not be bound - // Unsupported return type: references are not yet supported - // Unsupported parameter #0 (trivial): references are not yet supported + // Unsupported parameter type `const ns::Trivial&& trivial`: + // references are not yet supported + // Unsupported return type `const ns::Trivial&&`: + // references are not yet supported } // namespace ns 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 94b4500ca..329855259 100644 --- a/rs_bindings_from_cc/test/golden/types_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/types_rs_api.rs @@ -14,10 +14,10 @@ #![deny(warnings)] // error: type alias `PtrDiff` could not be bound -// depends on type with missing bindings: Unsupported type 'decltype(static_cast(nullptr) - static_cast(nullptr))': Unsupported type '__ptrdiff_t': Unsupported clang::Type class 'PredefinedSugar' +// Unsupported type 'decltype(static_cast(nullptr) - static_cast(nullptr))': Unsupported type '__ptrdiff_t': Unsupported clang::Type class 'PredefinedSugar' // error: type alias `Size` could not be bound -// depends on type with missing bindings: Unsupported type 'decltype(sizeof (0))': Unsupported type '__size_t': Unsupported clang::Type class 'PredefinedSugar' +// Unsupported type 'decltype(sizeof (0))': Unsupported type '__size_t': Unsupported clang::Type class 'PredefinedSugar' #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -44,18 +44,24 @@ impl Default for SomeStruct { } // error: constructor `SomeStruct::SomeStruct` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const SomeStruct& __param_0`: +// references are not yet supported // error: constructor `SomeStruct::SomeStruct` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `SomeStruct&& __param_0`: +// references are not yet supported // error: function `SomeStruct::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const SomeStruct& __param_0`: +// references are not yet supported +// Unsupported return type `SomeStruct&`: +// references are not yet supported // error: function `SomeStruct::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `SomeStruct&& __param_0`: +// references are not yet supported +// Unsupported return type `SomeStruct&`: +// references are not yet supported // error: struct `ForwardDeclaredStruct` could not be bound // incomplete type @@ -136,14 +142,18 @@ unsafe impl ::cxx::ExternType for FieldTypeTestStruct { } // error: constructor `FieldTypeTestStruct::FieldTypeTestStruct` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const FieldTypeTestStruct& __param_0`: +// references are not yet supported // error: constructor `FieldTypeTestStruct::FieldTypeTestStruct` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `FieldTypeTestStruct&& __param_0`: +// references are not yet supported // error: function `FunctionTakingPointersAndReferences` could not be bound -// Unsupported parameter #0 (const_ref_param): references are not yet supported -// Unsupported parameter #1 (mut_ref_param): references are not yet supported +// Unsupported parameter type `const int& const_ref_param`: +// references are not yet supported +// Unsupported parameter type `int& mut_ref_param`: +// references are not yet supported #[inline(always)] pub fn VoidReturningFunction() { diff --git a/rs_bindings_from_cc/test/golden/unions_rs_api.rs b/rs_bindings_from_cc/test/golden/unions_rs_api.rs index 7c67c5f01..de9aac2c7 100644 --- a/rs_bindings_from_cc/test/golden/unions_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/unions_rs_api.rs @@ -42,18 +42,24 @@ impl Default for EmptyUnion { } // error: constructor `EmptyUnion::EmptyUnion` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const EmptyUnion& __param_0`: +// references are not yet supported // error: constructor `EmptyUnion::EmptyUnion` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `EmptyUnion&& __param_0`: +// references are not yet supported // error: function `EmptyUnion::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const EmptyUnion& __param_0`: +// references are not yet supported +// Unsupported return type `EmptyUnion&`: +// references are not yet supported // error: function `EmptyUnion::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `EmptyUnion&& __param_0`: +// references are not yet supported +// Unsupported return type `EmptyUnion&`: +// references are not yet supported #[::ctor::recursively_pinned] #[repr(C)] @@ -84,7 +90,8 @@ impl ::ctor::CtorNew<()> for Nontrivial { } // error: constructor `Nontrivial::Nontrivial` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Nontrivial&& __param_0`: +// references are not yet supported /// # Safety /// @@ -115,18 +122,24 @@ impl Default for RenamedUnion { } // error: constructor `UnionToRename::UnionToRename` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const UnionToRename& __param_0`: +// references are not yet supported // error: constructor `UnionToRename::UnionToRename` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `UnionToRename&& __param_0`: +// references are not yet supported // error: function `UnionToRename::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const UnionToRename& __param_0`: +// references are not yet supported +// Unsupported return type `UnionToRename&`: +// references are not yet supported // error: function `UnionToRename::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `UnionToRename&& __param_0`: +// references are not yet supported +// Unsupported return type `UnionToRename&`: +// references are not yet supported #[::ctor::recursively_pinned(PinnedDrop)] #[repr(C)] @@ -142,11 +155,14 @@ unsafe impl ::cxx::ExternType for TriviallyCopyableButNontriviallyDestructible { } // error: function `TriviallyCopyableButNontriviallyDestructible::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const TriviallyCopyableButNontriviallyDestructible& __param_0`: +// references are not yet supported +// Unsupported return type `TriviallyCopyableButNontriviallyDestructible&`: +// references are not yet supported // error: constructor `TriviallyCopyableButNontriviallyDestructible::TriviallyCopyableButNontriviallyDestructible` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const TriviallyCopyableButNontriviallyDestructible& __param_0`: +// references are not yet supported impl ::ctor::PinnedDrop for TriviallyCopyableButNontriviallyDestructible { #[inline(always)] @@ -189,18 +205,24 @@ impl Default for NonEmptyUnion { } // error: constructor `NonEmptyUnion::NonEmptyUnion` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const NonEmptyUnion& __param_0`: +// references are not yet supported // error: constructor `NonEmptyUnion::NonEmptyUnion` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NonEmptyUnion&& __param_0`: +// references are not yet supported // error: function `NonEmptyUnion::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const NonEmptyUnion& __param_0`: +// references are not yet supported +// Unsupported return type `NonEmptyUnion&`: +// references are not yet supported // error: function `NonEmptyUnion::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NonEmptyUnion&& __param_0`: +// references are not yet supported +// Unsupported return type `NonEmptyUnion&`: +// references are not yet supported /// # Safety /// @@ -239,18 +261,24 @@ unsafe impl ::cxx::ExternType for NonCopyUnion2 { } // error: constructor `NonCopyUnion2::NonCopyUnion2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const NonCopyUnion2& __param_0`: +// references are not yet supported // error: constructor `NonCopyUnion2::NonCopyUnion2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NonCopyUnion2&& __param_0`: +// references are not yet supported // error: function `NonCopyUnion2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const NonCopyUnion2& __param_0`: +// references are not yet supported +// Unsupported return type `NonCopyUnion2&`: +// references are not yet supported // error: function `NonCopyUnion2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NonCopyUnion2&& __param_0`: +// references are not yet supported +// Unsupported return type `NonCopyUnion2&`: +// references are not yet supported /// # Safety /// @@ -285,18 +313,24 @@ impl Default for UnionWithOpaqueField { } // error: constructor `UnionWithOpaqueField::UnionWithOpaqueField` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const UnionWithOpaqueField& __param_0`: +// references are not yet supported // error: constructor `UnionWithOpaqueField::UnionWithOpaqueField` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `UnionWithOpaqueField&& __param_0`: +// references are not yet supported // error: function `UnionWithOpaqueField::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const UnionWithOpaqueField& __param_0`: +// references are not yet supported +// Unsupported return type `UnionWithOpaqueField&`: +// references are not yet supported // error: function `UnionWithOpaqueField::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `UnionWithOpaqueField&& __param_0`: +// references are not yet supported +// Unsupported return type `UnionWithOpaqueField&`: +// references are not yet supported #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C)] @@ -323,18 +357,24 @@ impl Default for TrivialButInheritable { } // error: constructor `TrivialButInheritable::TrivialButInheritable` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const TrivialButInheritable& __param_0`: +// references are not yet supported // error: constructor `TrivialButInheritable::TrivialButInheritable` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `TrivialButInheritable&& __param_0`: +// references are not yet supported // error: function `TrivialButInheritable::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const TrivialButInheritable& __param_0`: +// references are not yet supported +// Unsupported return type `TrivialButInheritable&`: +// references are not yet supported // error: function `TrivialButInheritable::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `TrivialButInheritable&& __param_0`: +// references are not yet supported +// Unsupported return type `TrivialButInheritable&`: +// references are not yet supported /// # Safety /// @@ -365,18 +405,24 @@ impl Default for UnionWithInheritable { } // error: constructor `UnionWithInheritable::UnionWithInheritable` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const UnionWithInheritable& __param_0`: +// references are not yet supported // error: constructor `UnionWithInheritable::UnionWithInheritable` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `UnionWithInheritable&& __param_0`: +// references are not yet supported // error: function `UnionWithInheritable::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const UnionWithInheritable& __param_0`: +// references are not yet supported +// Unsupported return type `UnionWithInheritable&`: +// references are not yet supported // error: function `UnionWithInheritable::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `UnionWithInheritable&& __param_0`: +// references are not yet supported +// Unsupported return type `UnionWithInheritable&`: +// references are not yet supported /// # Safety /// @@ -407,18 +453,24 @@ impl Default for TypedefUnion { } // error: constructor `TypedefUnion::TypedefUnion` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const TypedefUnion& __param_0`: +// references are not yet supported // error: constructor `TypedefUnion::TypedefUnion` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `TypedefUnion&& __param_0`: +// references are not yet supported // error: function `TypedefUnion::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const TypedefUnion& __param_0`: +// references are not yet supported +// Unsupported return type `TypedefUnion&`: +// references are not yet supported // error: function `TypedefUnion::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `TypedefUnion&& __param_0`: +// references are not yet supported +// Unsupported return type `TypedefUnion&`: +// references are not yet supported /// # Safety /// @@ -451,18 +503,24 @@ impl Default for TypedefUnionWithInheritable { } // error: constructor `TypedefUnionWithInheritable::TypedefUnionWithInheritable` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const TypedefUnionWithInheritable& __param_0`: +// references are not yet supported // error: constructor `TypedefUnionWithInheritable::TypedefUnionWithInheritable` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `TypedefUnionWithInheritable&& __param_0`: +// references are not yet supported // error: function `TypedefUnionWithInheritable::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const TypedefUnionWithInheritable& __param_0`: +// references are not yet supported +// Unsupported return type `TypedefUnionWithInheritable&`: +// references are not yet supported // error: function `TypedefUnionWithInheritable::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `TypedefUnionWithInheritable&& __param_0`: +// references are not yet supported +// Unsupported return type `TypedefUnionWithInheritable&`: +// references are not yet supported mod detail { #[allow(unused_imports)] diff --git a/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs b/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs index 1366043ed..4013453ae 100644 --- a/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/unsupported_rs_api.rs @@ -38,18 +38,24 @@ impl Default for TrivialCustomType { } // error: constructor `TrivialCustomType::TrivialCustomType` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const TrivialCustomType& __param_0`: +// references are not yet supported // error: constructor `TrivialCustomType::TrivialCustomType` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `TrivialCustomType&& __param_0`: +// references are not yet supported // error: function `TrivialCustomType::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const TrivialCustomType& __param_0`: +// references are not yet supported +// Unsupported return type `TrivialCustomType&`: +// references are not yet supported // error: function `TrivialCustomType::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `TrivialCustomType&& __param_0`: +// references are not yet supported +// Unsupported return type `TrivialCustomType&`: +// references are not yet supported // error: function `TrivialCustomType::operator||` could not be bound // Bindings for this kind of operator (operator || with 2 parameter(s)) are not supported @@ -72,7 +78,8 @@ unsafe impl ::cxx::ExternType for NontrivialCustomType { } // error: constructor `NontrivialCustomType::NontrivialCustomType` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `NontrivialCustomType&& __param_0`: +// references are not yet supported // error: function `NontrivialCustomType::operator||` could not be bound // Bindings for this kind of operator (operator || with 2 parameter(s)) are not supported diff --git a/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api.rs b/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api.rs index 9da7c740d..930a0b600 100644 --- a/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/user_of_base_class_rs_api.rs @@ -47,18 +47,24 @@ impl ::ctor::CtorNew<()> for Derived2 { } // error: constructor `Derived2::Derived2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Derived2& __param_0`: +// references are not yet supported // error: constructor `Derived2::Derived2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Derived2&& __param_0`: +// references are not yet supported // error: function `Derived2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const Derived2& __param_0`: +// references are not yet supported +// Unsupported return type `Derived2&`: +// references are not yet supported // error: function `Derived2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `Derived2&& __param_0`: +// references are not yet supported +// Unsupported return type `Derived2&`: +// references are not yet supported #[::ctor::recursively_pinned] #[repr(C, align(8))] @@ -90,18 +96,24 @@ impl ::ctor::CtorNew<()> for VirtualDerived2 { } // error: constructor `VirtualDerived2::VirtualDerived2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const VirtualDerived2& __param_0`: +// references are not yet supported // error: constructor `VirtualDerived2::VirtualDerived2` could not be bound -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `VirtualDerived2&& __param_0`: +// references are not yet supported // error: function `VirtualDerived2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `const VirtualDerived2& __param_0`: +// references are not yet supported +// Unsupported return type `VirtualDerived2&`: +// references are not yet supported // error: function `VirtualDerived2::operator=` could not be bound -// Unsupported return type: references are not yet supported -// Unsupported parameter #1 (__param_0): references are not yet supported +// Unsupported parameter type `VirtualDerived2&& __param_0`: +// references are not yet supported +// Unsupported return type `VirtualDerived2&`: +// references are not yet supported mod detail { #[allow(unused_imports)] diff --git a/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api.rs b/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api.rs index 90951167b..c4cc47201 100644 --- a/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api.rs +++ b/rs_bindings_from_cc/test/golden/uses_not_crubit_exposed_rs_api.rs @@ -14,7 +14,9 @@ #![deny(warnings)] // error: function `UseNotCrubitExposed` could not be bound -// Unsupported parameter #0 (not_crubit_exposed) +// Unsupported parameter type `NotCrubitExposed not_crubit_exposed`: +// Crubit is not enabled on defining target: +// rs_bindings_from_cc/test/golden/not_crubit_exposed.h #[derive(Clone, Copy, ::ctor::MoveAndAssignViaCopy)] #[repr(C, align(4))] @@ -47,10 +49,14 @@ pub mod c9 { // error: class `c9::Co` could not be bound // namespace c9 // error: function `ReturnsCo` could not be bound -// Cannot use an error type by value: depends on type with missing bindings: +// `c9::Co` is unsupported because `NotCrubitExposed` is unavailable: +// Crubit is not enabled on defining target: +// rs_bindings_from_cc/test/golden/not_crubit_exposed.h // error: class `c9::Co` could not be bound -// depends on type with missing bindings: +// `c9::Co` is unsupported because `NotCrubitExposed` is unavailable: +// Crubit is not enabled on defining target: +// rs_bindings_from_cc/test/golden/not_crubit_exposed.h mod detail { #[allow(unused_imports)] diff --git a/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api.rs b/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api.rs index c1f4a017c..25a0ee5ee 100644 --- a/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api.rs +++ b/rs_bindings_from_cc/test/templates/regression_401857961/repro_rs_api.rs @@ -59,8 +59,8 @@ pub mod repro { // Generated from: rs_bindings_from_cc/test/templates/regression_401857961/repro.h;l=24 // error: function `repro::crash` could not be bound - // Unsupported parameter #0 (__param_0): template instantiation is not yet supported - // template instantiation is not yet supported + // Unsupported parameter type `repro::Nullable __param_0`: + // template instantiation is not yet supported } // namespace repro @@ -70,12 +70,10 @@ pub mod repro { // Generated from: rs_bindings_from_cc/test/templates/regression_401857961/repro.h;l=11 // error: struct `repro::optional` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported // Generated from: rs_bindings_from_cc/test/templates/regression_401857961/repro.h;l=20 // error: struct `repro::Nullable` could not be bound // template instantiation is not yet supported -// template instantiation is not yet supported mod detail { #[allow(unused_imports)]