From 7afecdf1b595433e7a491c041aa82e232dbe04b4 Mon Sep 17 00:00:00 2001 From: Adrian Taylor Date: Thu, 20 Jun 2024 07:37:49 +0000 Subject: [PATCH 1/2] Doc formatting. --- engine/src/builder.rs | 1 + engine/src/conversion/analysis/fun/function_wrapper.rs | 1 + engine/src/conversion/analysis/fun/mod.rs | 3 ++- parser/src/config.rs | 1 + src/lib.rs | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/src/builder.rs b/engine/src/builder.rs index 064056ed4..cfba2b05e 100644 --- a/engine/src/builder.rs +++ b/engine/src/builder.rs @@ -155,6 +155,7 @@ impl Builder<'_, CTX> { /// * You've got usages scattered across files beyond that with the /// `include_cpp` invocation /// * You're using `use` statements to rename mods or items. If this + /// /// proves to be a promising or helpful direction, autocxx would be happy /// to accept pull requests to remove some of these limitations. pub fn auto_allowlist(mut self, do_it: bool) -> Self { diff --git a/engine/src/conversion/analysis/fun/function_wrapper.rs b/engine/src/conversion/analysis/fun/function_wrapper.rs index 04955331c..7bbcd0aae 100644 --- a/engine/src/conversion/analysis/fun/function_wrapper.rs +++ b/engine/src/conversion/analysis/fun/function_wrapper.rs @@ -80,6 +80,7 @@ impl RustConversionType { /// * C++ wrapper function converts `std::unique_ptr` to just /// `std::string` /// * Finally, the actual C++ API receives a `std::string` by value. +/// /// The implementation here is distributed across this file, and /// `function_wrapper_rs` and `function_wrapper_cpp`. /// TODO: we should make this into a single enum, with the Type as enum diff --git a/engine/src/conversion/analysis/fun/mod.rs b/engine/src/conversion/analysis/fun/mod.rs index dc953adba..359c6a2fa 100644 --- a/engine/src/conversion/analysis/fun/mod.rs +++ b/engine/src/conversion/analysis/fun/mod.rs @@ -715,7 +715,8 @@ impl<'a> FnAnalyzer<'a> { /// to [cxx::UniquePtr] /// * We'll need a Rust wrapper if we've got a C++ wrapper and it's a method. /// * We may need wrappers if names conflict. - /// etc. + /// * etc. + /// /// The other major thing we do here is figure out naming for the function. /// This depends on overloads, and what other functions are floating around. /// The output of this analysis phase is used by both Rust and C++ codegen. diff --git a/parser/src/config.rs b/parser/src/config.rs index 3634295b9..2421e09a6 100644 --- a/parser/src/config.rs +++ b/parser/src/config.rs @@ -354,6 +354,7 @@ impl IncludeCppConfig { /// 1) As directives to bindgen /// 2) After bindgen has generated code, to filter the APIs which /// we pass to cxx. + /// /// This second pass may seem redundant. But sometimes bindgen generates /// unnecessary stuff. pub fn is_on_allowlist(&self, cpp_name: &str) -> bool { diff --git a/src/lib.rs b/src/lib.rs index fe235a917..9d2e733db 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -375,6 +375,7 @@ macro_rules! subclass { /// * the 'something else' can't be fully inspected by autocxx, possibly /// becaue it relies on dependent qualified types or some other template /// arrangement that bindgen cannot fully understand. +/// /// In such circumstances, autocxx normally has to err on the side of caution /// and assume that some type within the 'something else' is itself a forward /// declaration. That means, the opaque typedef won't be storable within From 899085c926ec729f986aa6b17ed5dc56444b16fb Mon Sep 17 00:00:00 2001 From: Adrian Taylor Date: Thu, 20 Jun 2024 07:38:47 +0000 Subject: [PATCH 2/2] Mark dead code. --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 9d2e733db..3683e5ee6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -496,6 +496,7 @@ unsafe impl cxx::ExternType for c_char16_t { /// If you come across a method, type or function which refers to this type, /// it indicates that autocxx couldn't generate that binding. A documentation /// comment should be attached indicating the reason. +#[allow(dead_code)] pub struct BindingGenerationFailure { _unallocatable: [*const u8; 0], _pinned: core::marker::PhantomData,