-
Notifications
You must be signed in to change notification settings - Fork 14k
Don't strip shebang in expr-ctxt include!(…)
#146377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
include!(…)sinclude!(…)
This comment has been minimized.
This comment has been minimized.
c611f6f to
3685183
Compare
This comment has been minimized.
This comment has been minimized.
3685183 to
77cd6d1
Compare
77cd6d1 to
e8ef799
Compare
include!(…)include!(…)
e8ef799 to
e477732
Compare
|
Re.
I-lang-nominated
Dear T-lang, I honestly don't know if we should make this change or not. Therefore I hope you might have an answer. One goal which its RFC establishes is the following: "This [frontmatter stripping] applies anywhere shebang stripping is performed. For example, if include! strips shebangs, then it will also frontmatter.". This goal couldn't be fully accomplished:
We still strip frontmatter in item-context I don't know if this is a good idea. It feels slightly surprising that
PRO: No breaking changes, fully behavior-preserving.
PRO: Consistency between shebang & frontmatter
PRO: Full consistency. Footnotes |
|
@bors2 try |
Don't strip shebang in expr-ctxt `include!(…)`
This comment has been minimized.
This comment has been minimized.
|
We talked about this in today's @rust-lang/lang meeting. We'd like to get some data to back this up, in the form of crater runs. We'd love to see a crater run that validates no Rust code relies on |
|
Speaking for myself, I'd also love to see a crater run that removes all stripping of shebang and frontmatter from |
To clarify: I think the crater runs should be "error if a shebang is stripped in an expr-ctxt This is more important for the item-ctxt shebang stripping, but still better to be prudent here imo and detect all cases, rather than a (potential) subset of them.
I'm a second on this - not blocking this PR on that, because it isn't a strong "logical extension", but I am filing a concern on #148051, since that "closes some doors" as far as decisions if we stabilize frontmatter with or without stripping and later wish to change it. Though - I'm hoping that minimal extra work would need to be done alongside the crater run requested for this PR. |
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
No longer strip shebang interpreter directives in files that were
included in expression (statement) contexts.