rust/src/doc
Matthias Krüger 3d3f817ff9
Rollup merge of #133870 - nbdd0121:asm, r=traviscross,nnethercote
Stabilize `asm_goto` feature gate

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

Reference PR: https://github.com/rust-lang/reference/pull/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 https://github.com/rust-lang/rust/issues/119364#issuecomment-2316037703 and https://github.com/rust-lang/rust/pull/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
2025-03-17 16:34:47 +01:00
..
book@81a976a237 Update books 2025-03-10 18:01:15 +01:00
edition-guide@1e27e5e6d5 Update books 2025-03-10 18:01:15 +01:00
embedded-book@0b8219ac23 Update books 2025-02-10 18:00:41 +01:00
man Update rustc man page to match rustc --help 2022-08-01 22:03:18 +00:00
nomicon@b4448fa406 Update books 2025-03-10 18:01:15 +01:00
reference@dda31c85f2 Update books 2025-03-10 18:01:15 +01:00
rust-by-example@6f69823c28 Update books 2025-03-10 18:01:15 +01:00
rustc Rollup merge of #137621 - Berrysoft:cygwin-std, r=joboet 2025-03-17 05:47:49 -04:00
rustc-dev-guide Merge pull request #2283 from jieyouxu/sync 2025-03-14 16:08:03 +08:00
rustdoc Add missing case explanation for doc inlined re-export of doc hidden item 2025-02-27 11:53:30 +01:00
style-guide Revert "[style 2024] Combine all last arg delimited exprs" 2025-01-30 18:08:45 +00:00
unstable-book Rollup merge of #133870 - nbdd0121:asm, r=traviscross,nnethercote 2025-03-17 16:34:47 +01:00
complement-design-faq.md
complement-lang-faq.md
complement-project-faq.md
favicon.inc doc: no shortcut in rel="icon" 2022-01-28 13:42:48 +01:00
footer.inc avoid reuse tripping over copyright notices 2023-03-09 12:24:43 +01:00
full-toc.inc
grammar.md Remove legacy grammar 2019-09-30 07:46:10 +02:00
guide-crates.md
guide-error-handling.md Convert old doc links to current edition 2019-02-13 14:39:25 +00:00
guide-ffi.md
guide-macros.md
guide-ownership.md Convert old doc links to current edition 2019-02-13 14:39:25 +00:00
guide-plugins.md Remove support for compiler plugins. 2023-11-04 08:50:46 +11:00
guide-pointers.md Convert old doc links to current edition 2019-02-13 14:39:25 +00:00
guide-strings.md
guide-tasks.md
guide-testing.md Convert old doc links to current edition 2019-02-13 14:39:25 +00:00
guide-unsafe.md
guide.md
index.md doc: add release notes to standalone doc bundle 2023-11-13 16:00:31 -07:00
intro.md
not_found.md rustdoc: consistentify #TOC and #ModNav to lowercase 2024-08-20 16:51:40 -07:00
redirect.inc doc: no shortcut in rel="icon" 2022-01-28 13:42:48 +01:00
reference.md Update reference.md 2021-07-10 19:51:36 +02:00
robots.txt Block version-specific docs from search engines 2020-03-14 02:29:35 +00:00
rust.css Fix heading anchors in doc pages. 2024-03-18 09:13:18 -07:00
rust.md
rustdoc.md
tutorial.md
version_info.html.template