[Pre-RFC #2]: Inline assembly

On a completly separate note: is there any reason to keep #[naked] (insofar that it is a nightly feature)? I discovered today when trying to write some intrinsics in C (don't ask) that naked functions can't be inlined (which comes as a surprise to no one).

Before I was kind of ambivalent towards naked functions, but now I worry that this behavior is a bit subtle (I didn't realize it until I godbolt'd some things), and I still don't see what naked functions get you that you can't already express.

(This comment might be out-of-scope but I think naked functions are enough of a companion feature to inline assembly that it's worth mentioning).

We already have an intrinsics for this, so inline assembly is not necessary to achieve that. Do you have any other use cases?

"the contents of the string literal must be provided to the underlying platform verbatim[...]"

Instead of verbatim we probably need to say something about interpolation here, e.g., we don't want passing "mov eax, {}" to the assembler, but "mov eax, eax" or whatever {} gets interpolated to.

"[...]upon control reaching the assembly block, the underlying platform must be instructed to reach that verbatim string"

Do we also need to mention how the Rust program continues its execution if the assembly snippet finishes?

Do we? I think trying to optimize empty assembly out by default is still kind of a violation of expectations.

I mean, probably, but I think trying to work out what all the standardsese reads like right now is kind of overkill. There's a lot of terms I used in that stanza that need defining anyway.

I think trying to optimize empty assembly out by default is still kind of a violation of expectations.

I don't disagree, just wondering if there are more use cases that support this.

An empty inline asm actually has well defined semantics and cannot be optimized away (unless you explicitly allow it with pure).

The semantics are that at some point in the program's execution, the program will have all the registers declared as inputs containing the required values, and all globals that may be accessed by the asm will contain their proper values (unless nomem is used).