autocxx icon indicating copy to clipboard operation
autocxx copied to clipboard

Fix generated wrapper for nested struct with static fn, alternative PR

Open adetaylor opened this issue 1 year ago • 1 comments

Tests PR #1380 which for some reason didn't run tests.

adetaylor avatar Aug 30 '24 08:08 adetaylor

I just encountered an unusual issue on main branch that's preventing me from testing on my machine: when I run cargo run in the demo, I get the following error:

error[E0599]: no method named `describe` found for struct `Pin<Box<root::Goat>>` in the current scope
  --> demo/src/main.rs:23:14
   |
23 |         goat.describe().as_ref().unwrap().to_string_lossy(),
   |         -----^^^^^^^^--
   |         |    |
   |         |    this is an associated function, not a method
   |         help: use associated function syntax instead: `root::Goat::describe()`
   |
   = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in an impl for the type `root::Goat`
  --> /Users/roife/code/autocxx/target/debug/build/autocxx-demo-a2dd4b564c10039d/out/autocxx-build-dir/rs/autocxx-ffi-default-gen.rs:1:1542
   |
1  | ...orward declaration. If you're sure it didn't, then you may be able to solve this by using instantiable!."] fn describe (_uhoh : autocxx :: BindingGenerationFailure) { } pub fn new () -> impl autocxx :: moveit :: new :: New < Output = Self > { unsafe { autocxx :: moveit ::...
   |                                                                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0599`.

UPDATE: This could be due to the issue that libc++ and autocxx do not work well together yet.

roife avatar Aug 30 '24 09:08 roife

This does seem like a valid fix for a real problem, but the CI isn't green, and we can't seriously consider merging it till it is. I'm going through and closing unmergeable PRs to avoid declaring PR bankruptcy, and so this one unfortunately needs to be closed too. I'd like to reopen it if we can get to a point that this could be merged.

adetaylor avatar Feb 28 '25 15:02 adetaylor