Skip to content

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

Description

@vdods
#[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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions