Closed tgross35 closed 4 months ago
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
Concerns or objections to the proposal should be discussed on Zulip and formally registered here by adding a comment with the following syntax:
@rustbot concern reason-for-concern
<description of the concern>
Concerns can be lifted with:
@rustbot resolve reason-for-concern
See documentation at https://forge.rust-lang.org
cc @rust-lang/compiler @rust-lang/compiler-contributors
Clang seems to preserve asm comments by default: https://github.com/llvm/llvm-project/blob/4232dd586b65c9301304cab2fb166d8df97c591a/clang/include/clang/Driver/Options.td#L3737-L3741
So there's no downside to just always doing this in rustc.
@rustbot second
@rustbot label -final-comment-period +major-change-accepted
Proposal
-Z asm-comments
currently controls two things: stripping all comments from assembly (PreserveAsmComments
), and LLVM emitting its own verbose comments (AsmVerbose
). By default this option is set to false, so even handwritten comments get stripped:The output doesn't have the "hello" and "world" comments anywhere:
Link: https://rust.godbolt.org/z/jxdEWY6oG
There doesn't seem to be a good reason to strip handwritten assembly comments ever (within the string), since a user can just write Rust comments if they don't want something to show up in the binary. So, proposal:
-Z verbose-asm
, which will be consistent with Clang/GCCAsmVerbose
)PreserveAsmComments
to be always true-Z verbose-asm
might wind up stabilized one dayThe flag was originally added at https://github.com/rust-lang/rust/pull/53290
See background discussion at https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Comments.20in.20.60asm!.60
Mentors or Reviewers
I can do the change
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.