Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upMacro in path attribute on module results in file not found error #48250
Comments
This comment has been minimized.
This comment has been minimized.
|
There is a new RFC that aims to provide a way to solve this issue: rust-lang/rfcs#2320. |
pietroalbini
added
C-enhancement
A-diagnostics
T-compiler
A-macros-2.0
labels
Feb 20, 2018
This comment has been minimized.
This comment has been minimized.
|
@pietroalbini can you clarify how #2320 addresses this issue? Would built-in attributes such as |
durka
referenced this issue
Mar 3, 2018
Open
Allow macros to be used in literals and/or meta items #1516
This comment has been minimized.
This comment has been minimized.
|
@durka it doesn't directly mention it, but it provides the tools to implement it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CasualX commentedFeb 16, 2018
•
edited
When using a build script to generate code I tried to include it in a submodule in the following way:
However this results in
error[E0583]: file not found for module generated. The error does not display the actual path it tried to access.The closes related issue I could find are #18849 and rust-lang/rfcs#1516 (related rust-lang/cargo#824). However all of these talk about the compile error being a parse error, while I'm getting an error about file not being found.
For reference, here's the build script: (abridged, I apologize if this doesn't compile but you get the idea)
The
include!macro works mostly but has one annoying problem that top-level inner attributes causes a compile error: #18810The unexpected and reason why I don't think this is a duplicate issue is that the compile error has changed. From the error rust reports it appears I've made a simple typo in the
pathwhen in fact this feature is simply not supported.