-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Reject unsupported naked functions #93153
Reject unsupported naked functions #93153
Conversation
Is there a reason why naked functions are only constrained to a single inline assembly block? This limits the ability to stitch multiple pieces of inline assembly together. Edit: To be a bit clearer/on topic, this affects older projects people may have sitting around. The current error messages give zero context around the new constraints for naked functions, other than the new requirement. In particular, the single block restriction is extremely vague and seems like it should work with multiple blocks. |
ee0ef5f
to
a6c2599
Compare
It is harder to lint all the invariants across multiple blocks. It is also less obvious to read and comprehend. And therefore it is a likely source of bugs. A cleaner method if you need this is separate functions. |
It is possible to stitch multiple pieces of inline assembly together using macros, rust-lang/rfcs#2972 (comment) contains an example.
Regarding the missing context in error messages, I introduced a new error code, so that |
Transition unsupported naked functions future incompatibility lint into an error: * Naked functions must contain a single inline assembly block. Introduced as future incompatibility lint in 1.50 rust-lang#79653. Change into an error fixes a soundness issue described in rust-lang#32489. * Naked functions must not use any forms of inline attribute. Introduced as future incompatibility lint in 1.56 rust-lang#87652.
eeab749
to
beeba4b
Compare
What's up with the CI? |
Seems to be a general GHA issue. @bors r+ |
📌 Commit beeba4b has been approved by |
Ah, I missed the added explanation. I'll file a bug for allowing multiple blocks, since the behavior prior to this PR is well-defined and the current workaround is subpar. |
…nctions, r=Amanieu Reject unsupported naked functions Transition unsupported naked functions future incompatibility lint into an error: * Naked functions must contain a single inline assembly block. Introduced as future incompatibility lint in 1.50 rust-lang#79653. Change into an error fixes a soundness issue described in rust-lang#32489. * Naked functions must not use any forms of inline attribute. Introduced as future incompatibility lint in 1.56 rust-lang#87652. Closes rust-lang#32490. Closes rust-lang#32489. r? `@Amanieu` `@npmccallum` `@joshtriplett`
…nctions, r=Amanieu Reject unsupported naked functions Transition unsupported naked functions future incompatibility lint into an error: * Naked functions must contain a single inline assembly block. Introduced as future incompatibility lint in 1.50 rust-lang#79653. Change into an error fixes a soundness issue described in rust-lang#32489. * Naked functions must not use any forms of inline attribute. Introduced as future incompatibility lint in 1.56 rust-lang#87652. Closes rust-lang#32490. Closes rust-lang#32489. r? ``@Amanieu`` ``@npmccallum`` ``@joshtriplett``
…askrgr Rollup of 9 pull requests Successful merges: - rust-lang#85967 (add support for the l4-bender linker on the x86_64-unknown-l4re-uclibc tier 3 target) - rust-lang#92828 (Print a helpful message if unwinding aborts when it reaches a nounwind function) - rust-lang#93012 (Update pulldown-cmark version to fix markdown list issue) - rust-lang#93116 (Simplify use of `map_or`) - rust-lang#93132 (Increase the format version of rustdoc-json-types) - rust-lang#93147 (Interner cleanups) - rust-lang#93153 (Reject unsupported naked functions) - rust-lang#93170 (Add missing GUI test explanations) - rust-lang#93172 (rustdoc: remove dashed underline under main heading) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Transition unsupported naked functions future incompatibility lint into an error:
Naked functions must contain a single inline assembly block. Introduced as future incompatibility lint in 1.50 Validate naked functions definitions #79653. Change into an error fixes a soundness issue described in Naked functions do not require unsafety #32489.
Naked functions must not use any forms of inline attribute. Introduced as future incompatibility lint in 1.56 Validate that naked functions are never inlined #87652.
Closes #32490.
Closes #32489.
r? @Amanieu @npmccallum @joshtriplett