Repository navigation
Allow global_asm! in statement positions - #156582
Conversation
This comment has been minimized.
This comment has been minimized.
fc5f2bf to
76f8edb
Compare
76f8edb to
d0629e2
Compare
|
I'm happy with the asm part of this but I'm not an expert on the macro infrastructure, so... |
|
Thanks! |
|
Reminder, once the PR becomes ready for a review, use |
3e29858 to
450cdb5
Compare
|
@rustbot ready |
This comment was marked as resolved.
This comment was marked as resolved.
|
@daxpedda: 🔑 Insufficient privileges: not in review users |
This comment was marked as resolved.
This comment was marked as resolved.
|
@daxpedda: 🔑 Insufficient privileges: not in review users |
This comment was marked as resolved.
This comment was marked as resolved.
|
@bors r+ |
…uwer Rollup of 13 pull requests Successful merges: - #156709 (stdarch subtree update) - #155006 (stabilize `feature(cfg_target_has_atomic_equal_alignment)`) - #156444 (Implement `OsStr::split_at`) - #156582 (Allow `global_asm!` in statement positions) - #156661 (Remove `UncheckedIterator`) - #152367 (Derives `Copy` for `ffi::FromBytesUntilNulError`) - #156443 (Fix invalid suggestion for parenthesized break) - #156606 (Add pext/pdep as aliases for extract_bits/deposit_bits) - #156630 (Replace `println!` with `assert!` in HashMap documentation examples) - #156644 (Widen the result of `widening_mul`.) - #156653 (Update `sysinfo` version to `0.39.2`) - #156697 (Add diagnostic items for IoBufReader and StdinLock) - #156704 (reduce usage of `box_patterns` in tests)
Rollup merge of #156582 - daxpedda:global-asm-statement, r=petrochenkov Allow `global_asm!` in statement positions This PR makes it possible to put `global_asm!` in statement positions. This is particularly useful for proc-macros, where you otherwise have to wrap them in `mod foo { global_asm!(...); }`. I'm happy to open an ACP first (or a design meeting?). I would also assume this needs sign-off from the lang-team? Previously discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/216763-project-inline-asm/topic/Item.20position.20global_asm/with/581784943). r? @Amanieu
|
Does this not need some sort of FCP? Currently this extension is effectively instantly stable, and as #156760 shows I think there are some places in the compiler where we just assume that global asm is top-level. |
|
Yeah let's revert this so that the lang team can take a look without time pressure. |
…-item, r=workingjubilee Revert "Allow `global_asm!` in statement positions" This reverts commit 450cdb5. Based on discussion in [#t-lang > insta-stable &rust-lang#96;global_asm!&rust-lang#96; as inner items](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/insta-stable.20.60global_asm.21.60.20as.20inner.20items/with/597411711), rust-lang#156582 should not have been merged without FCP. We've also since found a bug in the implementation (or really, an assumption in the existing code that the PR invalidates), so to re-land this - new behavior should be behind a feature gate - the fix in rust-lang#156855 (comment) should be included (and reviewed by someone familiar with `rustc_resolve`) Then we keep it unstable for a bit, and see if the fuzzer finds anything else. Nothing here is particularly controversial I think, but we need to do our due diligence. r? @ghost
Rollup merge of #156884 - folkertdev:revert-global-asm-inner-item, r=workingjubilee Revert "Allow `global_asm!` in statement positions" This reverts commit 450cdb5. Based on discussion in [#t-lang > insta-stable `global_asm!` as inner items](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/insta-stable.20.60global_asm.21.60.20as.20inner.20items/with/597411711), #156582 should not have been merged without FCP. We've also since found a bug in the implementation (or really, an assumption in the existing code that the PR invalidates), so to re-land this - new behavior should be behind a feature gate - the fix in #156855 (comment) should be included (and reviewed by someone familiar with `rustc_resolve`) Then we keep it unstable for a bit, and see if the fuzzer finds anything else. Nothing here is particularly controversial I think, but we need to do our due diligence. r? @ghost
…uwer Rollup of 13 pull requests Successful merges: - rust-lang/rust#156709 (stdarch subtree update) - rust-lang/rust#155006 (stabilize `feature(cfg_target_has_atomic_equal_alignment)`) - rust-lang/rust#156444 (Implement `OsStr::split_at`) - rust-lang/rust#156582 (Allow `global_asm!` in statement positions) - rust-lang/rust#156661 (Remove `UncheckedIterator`) - rust-lang/rust#152367 (Derives `Copy` for `ffi::FromBytesUntilNulError`) - rust-lang/rust#156443 (Fix invalid suggestion for parenthesized break) - rust-lang/rust#156606 (Add pext/pdep as aliases for extract_bits/deposit_bits) - rust-lang/rust#156630 (Replace `println!` with `assert!` in HashMap documentation examples) - rust-lang/rust#156644 (Widen the result of `widening_mul`.) - rust-lang/rust#156653 (Update `sysinfo` version to `0.39.2`) - rust-lang/rust#156697 (Add diagnostic items for IoBufReader and StdinLock) - rust-lang/rust#156704 (reduce usage of `box_patterns` in tests)
View all comments
This PR makes it possible to put
global_asm!in statement positions. This is particularly useful for proc-macros, where you otherwise have to wrap them inmod foo { global_asm!(...); }.I'm happy to open an ACP first (or a design meeting?).
I would also assume this needs sign-off from the lang-team?
Previously discussed on Zulip.
r? @Amanieu