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

The SAD trait proc macro implicitly requires outer context to have imported several symbols #5

Open
vdods opened this issue Aug 18, 2023 · 0 comments

Comments

@vdods
Copy link

vdods commented Aug 18, 2023

#[derive(Clone, Debug, said::sad::SAD, serde::Deserialize, serde::Serialize)]
pub struct Fancy {
    thing: String,
    #[said]
    id_o: Option<said::SelfAddressingIdentifier>,
}

Produces the errors (abbreviated for clarity) in the invocation of the proc macro:

error: cannot find derive macro `Serialize` in this scope
failed to resolve: use of undeclared type `SerializationFormats`
cannot find trait `SAD` in this scope

This is worked-around by importing those symbols:

use said::sad::{SerializationFormats, SAD};
use serde::Serialize;

But a better solution would be for the SAD trait proc macro to fully qualify them internally so that it doesn't depend on the user to have those symbols imported.

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

1 participant