Replies: 1 comment 1 reply
-
At the moment, shebang is not required. It might be useful for tools like rust-analyzer to pick up the role of these files. I have not looked too deeply into shebang detection but my gut says its a messy afair based on perl so I'd prefer for us to not make it a requirement. I also am considering |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
All the examples have the cargo shebang - is this a requirement to identify a cargo-script file? If so, presence of this shebang (or a fallback option like
--as-cargo-script
) could be used to indicate torustc
that it should ignore the specialcargo!
macro or attribute.This would be an alternative to
std
containing thecargo
macro, as mentioned here https://github.com/epage/cargo-script-mvs/blob/b31a41c43634acc8d2358811ba4706d1f3dff4fc/0000-cargo-script.md#embedded-manifest-formatAnother more general option could be for
rustc
to gain a--ignore-macros
option that, well, ignores macros. This would mean that it doesn't need any specific awareness of cargo-script. Additionally, it would open up other tools to doing in-source configuration in a similar way: which could be either good or bad.Beta Was this translation helpful? Give feedback.
All reactions