Skip to content
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

Stabilize asm_goto feature gate #133870

Merged
merged 1 commit into from
Mar 17, 2025
Merged

Stabilize asm_goto feature gate #133870

merged 1 commit into from
Mar 17, 2025

Conversation

nbdd0121
Copy link
Contributor

@nbdd0121 nbdd0121 commented Dec 4, 2024

Stabilize asm_goto feature (tracked by #119364). The issue will remain open and be updated to track asm_goto_with_outputs.

Reference PR: rust-lang/reference#1693

Stabilization Report

This feature adds a label <block> operand type to asm!. <block> must be a block expression with type unit or never. The address of the block is substituted and the assembly may jump to the block. When block completes the asm! block returns and continues execution.

The block starts a new safety context and unsafe operations within must have additional unsafes; the effect of unsafe that surrounds asm! block is cancelled. See #119364 (comment) and #131544.

It's currently forbidden to use asm_goto with output operands; that is still unstable under asm_goto_with_outputs.

Example:

unsafe {
    asm!(
        "jmp {}",
        label {
            println!("Jumped from asm!");
        }
    );
}

Tests:

  • tests/ui/asm/x86_64/goto.rs
  • tests/ui/asm/x86_64/goto-block-safe.stderr
  • tests/ui/asm/x86_64/bad-options.rs
  • tests/codegen/asm/goto.rs

@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2024

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 4, 2024
@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Dec 4, 2024

@rustbot label: -T-compiler +T-lang +A-inline-assembly +F-asm

Cc @rust-lang/wg-inline-asm

@rustbot rustbot added A-inline-assembly Area: Inline assembly (`asm!(…)`) F-asm `#![feature(asm)]` (not `llvm_asm`) T-lang Relevant to the language team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 4, 2024
@ehuss
Copy link
Contributor

ehuss commented Dec 4, 2024

r? compiler

cc @Amanieu

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 4, 2024
@rustbot rustbot assigned nnethercote and unassigned ehuss Dec 4, 2024
@ehuss ehuss added I-lang-nominated Nominated for discussion during a lang team meeting. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 4, 2024
@nnethercote
Copy link
Contributor

The code changes look fine for stabilizing this feature, so r=me in terms of code. But I am uncertain about the stabilization process. Is any additional T-lang approval needed before this merges? Has such approval already been obtained?

@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Dec 4, 2024

@nnethercote this would need a FCP.

@jieyouxu
Copy link
Member

jieyouxu commented Dec 5, 2024

r? lang (for T-lang FCP)

@rustbot rustbot assigned tmandry and unassigned nnethercote Dec 5, 2024
@traviscross
Copy link
Contributor

@rfcbot fcp merge

Thanks @nbdd0121 for putting forward this stabilization. We talked about it in lang triage today. Let's propose this for FCP.

@rfcbot
Copy link

rfcbot commented Dec 11, 2024

Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns.
See this document for info about what commands tagged team members can give me.

Page not found · GitHub · GitHub
Skip to content
404 “This is not the web page you are looking for”
@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Dec 11, 2024
@traviscross
Copy link
Contributor

traviscross commented Dec 12, 2024

@rustbot labels +S-waiting-on-documentation

Note that after the FCP completes, this shouldn't merge until the Reference PR is reviewed and approved.

(Thanks @nbdd0121 for creating this PR.)

cc @ehuss

@rustbot rustbot added the S-waiting-on-documentation Status: Waiting on approved PRs to documentation before merging label Dec 12, 2024
@nikomatsakis
Copy link
Contributor

@rfcbot reviewed

@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label Dec 18, 2024
@tmandry
Copy link
Member

tmandry commented Dec 19, 2024

@rfcbot reviewed

(Already checked my box, but rfcbot doesn't seem to register this.)

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Dec 28, 2024
@rfcbot
Copy link

rfcbot commented Dec 28, 2024

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@rfcbot rfcbot added the to-announce Announce this issue on triage meeting label Dec 28, 2024
@traviscross
Copy link
Contributor

traviscross commented Dec 29, 2024

Note that this is still pending acceptance of the Reference PR, and it should not be merged until the S-waiting-on-documentation label is removed.

@traviscross traviscross removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Jan 8, 2025
@bors
Copy link
Contributor

bors commented Jan 9, 2025

☔ The latest upstream changes (presumably #135286) made this pull request unmergeable. Please resolve the merge conflicts.

@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Feb 13, 2025
@traviscross
Copy link
Contributor

traviscross commented Mar 17, 2025

The documentation is ready and reviewed here, removing the final blocker.

@rustbot labels -S-waiting-on-documentation

r? traviscross

This needs a rebase.

@rustbot author

@rustbot rustbot removed the S-waiting-on-documentation Status: Waiting on approved PRs to documentation before merging label Mar 17, 2025
@rustbot rustbot assigned traviscross and unassigned tmandry Mar 17, 2025
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 17, 2025
@traviscross
Copy link
Contributor

@bors r=traviscross,nnethercote rollup

Thanks to @nbdd0121 for pushing this forward.

@bors
Copy link
Contributor

bors commented Mar 17, 2025

📌 Commit 292c622 has been approved by traviscross,nnethercote

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 17, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 17, 2025
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#133870 (Stabilize `asm_goto` feature gate)
 - rust-lang#137449 (Denote `ControlFlow` as `#[must_use]`)
 - rust-lang#137465 (mir_build: Avoid some useless work when visiting "primary" bindings)
 - rust-lang#138349 (Emit function declarations for functions with `#[linkage="extern_weak"]`)
 - rust-lang#138412 (Install licenses into `share/doc/rust/licenses`)
 - rust-lang#138577 (rustdoc-json: Don't also include `#[deprecated]` in `Item::attrs`)
 - rust-lang#138588 (Avoid double lowering of idents)

Failed merges:

 - rust-lang#138321 ([bootstrap] Distribute split debuginfo if present)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3d3f817 into rust-lang:master Mar 17, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 17, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 17, 2025
Rollup merge of rust-lang#133870 - nbdd0121:asm, r=traviscross,nnethercote

Stabilize `asm_goto` feature gate

Stabilize `asm_goto` feature (tracked by rust-lang#119364). The issue will remain open and be updated to track `asm_goto_with_outputs`.

Reference PR: rust-lang/reference#1693

# Stabilization Report

This feature adds a `label <block>` operand type to `asm!`. `<block>` must be a block expression with type unit or never. The address of the block is substituted and the assembly may jump to the block. When block completes the `asm!` block returns and continues execution.

The block starts a new safety context and unsafe operations within must have additional `unsafe`s; the effect of `unsafe` that surrounds `asm!` block is cancelled. See rust-lang#119364 (comment) and rust-lang#131544.

It's currently forbidden to use `asm_goto` with output operands; that is still unstable under `asm_goto_with_outputs`.

Example:

```rust
unsafe {
    asm!(
        "jmp {}",
        label {
            println!("Jumped from asm!");
        }
    );
}
```

Tests:
- tests/ui/asm/x86_64/goto.rs
- tests/ui/asm/x86_64/goto-block-safe.stderr
- tests/ui/asm/x86_64/bad-options.rs
- tests/codegen/asm/goto.rs
@traviscross traviscross added the relnotes Marks issues that should be documented in the release notes of the next release. label Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. F-asm `#![feature(asm)]` (not `llvm_asm`) finished-final-comment-period The final comment period is finished for this PR / Issue. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet