Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Error for README Example in 3 Separate Crates #105

Closed
Neightro opened this issue Jul 29, 2023 · 2 comments
Closed

Compilation Error for README Example in 3 Separate Crates #105

Neightro opened this issue Jul 29, 2023 · 2 comments

Comments

@Neightro
Copy link

I'm a newcomer to this crate. I noticed that the documentation mentioned that the interface and implementation generally reside in separate crates, so I was trying to get the example working in that fashion. I commented out the single-crate version of load_root_module_in_directory and uncommented the 3-crate version. However, cargo build -p implementation then results in:

error[E0117]: only traits defined in the current crate can be implemented for types defined outside of the crate
   --> implementation/src/lib.rs:112:1
    |
112 | impl<T> Appender for RVec<T> {
    | ^^^^^^^^^^^^^^^^^^^^^-------
    | |                    |
    | |                    `RVec` is not defined in the current crate
    | impl doesn't use only types from inside the current crate
    |
    = note: define and implement a trait or new type instead

What would be the recommended solution? I don't have enough knowledge of abi_stable to answer that myself.

My example repository, if helpful: https://github.com/Neightro/abi_stable_readme_example

@rodrimati1992
Copy link
Owner

rodrimati1992 commented Jul 30, 2023

Yes, the README example is wrong, apparently I edited it without trying it out in actually separate crates.

I'll fix the code in the README, and make it so that there are crates in the examples directory to run.

@Neightro
Copy link
Author

Perfect! Thanks for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants