You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Subclassing does not compile, with the following error:
error[E0277]: the trait bound `Concrete: CppPeerConstructor<ConcreteCpp>` is not satisfied
--> src/main.rs:12:12
|
12 | pub struct Concrete {}
| ^^^^^^^^ the trait `CppPeerConstructor<ConcreteCpp>` is not implemented for `Concrete`
use autocxx::prelude::*;use autocxx::subclass::prelude::*;include_cpp!{
#include "abstract.h"
generate!("Abstract")
subclass!("Abstract", Concrete)}#[subclass]#[derive(Default)]pubstructConcrete{}impl ffi::Abstract_methodsforConcrete{unsafefnfunc(&self){}}
abstract.h:
#pragma once
classAbstract {
public:virtualvoidfunc() const = 0;
};
Expected behavior
Successful compilation
Additional context
I'm not sure what's going on here - I can compile and run the subclassing example in the repo successfully, but trying to do it from a clean project just does not work.
The text was updated successfully, but these errors were encountered:
Supreeeme
changed the title
Subclassing doesn't work - "the trait bound T: CppPeerConstructor<ConcreteCpp> is not satisfied"
Subclassing doesn't work - "the trait bound T: CppPeerConstructor<TCpp> is not satisfied"
Jul 19, 2024
I'm afraid I'm not going to have a chance to dig into this - please do gradually bisect differences relative to the demo. Subclass support is fairly fragile and the diagnostics aren't great - I'd be pleased to merge PRs to improve diagnostics here. (Perhaps the new #[diagnostic::on_unimplemented] can be used)
Describe the bug
Subclassing does not compile, with the following error:
To Reproduce
Cargo.toml:
build.rs:
main.rs:
abstract.h:
Expected behavior
Successful compilation
Additional context
I'm not sure what's going on here - I can compile and run the subclassing example in the repo successfully, but trying to do it from a clean project just does not work.
The text was updated successfully, but these errors were encountered: