-
Notifications
You must be signed in to change notification settings - Fork 28
Description
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