-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Validate that naked functions are never inlined #87652
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
src/test/ui/asm/naked-functions.rs
Outdated
pub unsafe extern "C" fn valid_att_syntax() { | ||
asm!("", options(noreturn, att_syntax)); | ||
} | ||
|
||
#[naked] | ||
//~^ WARN naked functions require #[inline(never)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tracking issue says that this should be an error, but it's a warning in this PR. Is this just a transitional lint to avoid breaking nightly code? If so, seems reasonable to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@josephlr There's a bunch of these lints that should be errors according to the RFC. I wanted to get them all in as warnings first and then file a follow-up which switches the relevant ones to errors. This allows us to reason about them as an entire set.
r? @Amanieu |
860bb50
to
e1cc5c8
Compare
e1cc5c8
to
206b008
Compare
This comment has been minimized.
This comment has been minimized.
Reject all uses of the inline attribute on naked functions. rust-lang/rfcs#2774 rust-lang/rfcs#2972
206b008
to
157e0a0
Compare
@bors r+ |
📌 Commit 157e0a0 has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#87645 (Properly find owner of closure in THIR unsafeck) - rust-lang#87646 (Fix a parser ICE on invalid `fn` body) - rust-lang#87652 (Validate that naked functions are never inlined) - rust-lang#87685 (Write docs for SyncOnceCell From and Default impl) - rust-lang#87693 (Add `aarch64-apple-ios-sim` as a possible target to the manifest) - rust-lang#87708 (Add convenience method for handling ipv4-mapped addresses by canonicalizing them) - rust-lang#87711 (Correct typo) - rust-lang#87716 (Allow generic SIMD array element type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This matches the behavior of the merged PR implementing this criteria. rust-lang/rust#87652
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.
…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``
…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```
Reject all uses of the inline attribute on naked functions.
rust-lang/rfcs#2774
rust-lang/rfcs#2972
cc @joshtriplett @tmiasko @Amanieu