Skip to content

Does not work correctly in procedural macros called from examples #14

@DCNick3

Description

@DCNick3

Suppose we have a library crate smol-lib.

When the library is called in context of an example for this library (i.e. smol-lib/examples/smol.rs) trying to look up the name of the same library (smol-lib), this library resolves that the crate is itself.

This makes sense, but, unfortunately, doesn't correspond to the way you would use the crate from an example: you would not write use crate::SmolStruct as inside the library code, but rather use smol_lib::SmolStruct, the same way as you would in a downstream crate.

This is problematic, because it doesn't allow to write examples for the repo using macros and, at the same time, using macros both inside and outside of smol-lib.

Probably some logic should be added to handle the examples case, not sure how it could be done though

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions