From eec8663b2455c86ba3655a4c8217b4f924794472 Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Tue, 5 May 2026 18:26:18 +0200 Subject: [PATCH 1/3] rustc_on_unimplemented: introduce format specifiers as printing options for the annotated item. --- src/diagnostics.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/diagnostics.md b/src/diagnostics.md index 554bcfcf8..7e3da67d8 100644 --- a/src/diagnostics.md +++ b/src/diagnostics.md @@ -1018,12 +1018,13 @@ pub trait From: Sized { ### Formatting The string literals are format strings that accept parameters wrapped in braces -but positional and listed parameters and format specifiers are not accepted. +but positional and listed parameters are not accepted. The following parameter names are valid: - `Self` and all generic parameters of the trait. - `This`: the name of the trait the attribute is on, without generics. -- `Trait`: the name of the "sugared" trait. - See `TraitRefPrintSugared`. +- `This:path`: the full path of the trait the attribute is on, with unresolved generics. +- `This:resolved`: the full path of the trait the attribute is on, with resolved generics. +Additionally, this will "sugar" the `Fn(...)` traits. - `ItemContext`: the kind of `hir::Node` we're in, things like `"an async block"`, `"a function"`, `"an async function"`, etc. From 366aeb6fdb171708f7cb0e27659e1ab1751c1f21 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Mon, 25 May 2026 16:57:53 +1000 Subject: [PATCH 2/3] Simplify `//@ needs-asm-mnemonic: ret` to just `//@ needs-asm-ret` The `needs-asm-mnemonic` directive was very general, but in practice was only being used for `ret`. There are very few other mnemonics that it could plausibly be useful for (e.g. `nop`), because any instruction that requires arguments is probably going to be non-portable. This PR replaces `needs-asm-mnemonic` with a simpler `needs-asm-ret` directive that uses the same machinery as other simple needs directives. If we happend to need more mnemonics in the future, we can just add more simple directives as appropriate (e.g. `needs-asm-nop`). --- src/tests/compiletest.md | 11 ----------- src/tests/directives.md | 7 ++++--- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/tests/compiletest.md b/src/tests/compiletest.md index 7ffc9e301..36dc71a3a 100644 --- a/src/tests/compiletest.md +++ b/src/tests/compiletest.md @@ -346,17 +346,6 @@ See also the [codegen tests](#codegen-tests) for a similar set of tests. If you need to work with `#![no_std]` cross-compiling tests, consult the [`minicore` test auxiliary](./minicore.md) chapter. -#### Conditional assembly tests based on instruction support - -Tests that depend on specific assembly instructions being available can use the -`//@ needs-asm-mnemonic: ` directive. -This will skip the test if the target backend does not support the specified instruction mnemonic. - -For example, a test that requires the `RET` instruction: -```rust,ignore -//@ needs-asm-mnemonic: RET -``` - [`tests/assembly-llvm`]: https://github.com/rust-lang/rust/tree/HEAD/tests/assembly-llvm diff --git a/src/tests/directives.md b/src/tests/directives.md index d1b923edd..5dce2ad13 100644 --- a/src/tests/directives.md +++ b/src/tests/directives.md @@ -164,9 +164,10 @@ The following directives will check rustc build settings and target settings: For tests that cross-compile to explicit targets via `--target`, use `needs-llvm-components` instead to ensure the appropriate backend is available. -- `needs-asm-mnemonic: ` — ignores if the target backend does not - support the specified assembly mnemonic (e.g., `RET`, `NOP`). - Only supported with the LLVM backend. +- `needs-asm-ret` - ignores if the target does not have a `ret` instruction + in its assembly syntax. Most target architectures have this instruction, + making it handy for portable inline-assembly tests, but some architectures + (e.g. 32-bit ARM) do not have it. - `needs-profiler-runtime` — ignores the test if the profiler runtime was not enabled for the target (`build.profiler = true` in `bootstrap.toml`) - `needs-sanitizer-support` — ignores if the sanitizer support was not enabled From 3acad387048e698bb512877f86d5fc0e80304264 Mon Sep 17 00:00:00 2001 From: The rustc-josh-sync Cronjob Bot Date: Sat, 30 May 2026 20:14:52 +0000 Subject: [PATCH 3/3] Prepare for merging from rust-lang/rust This updates the rust-version file to c58275e0369d09fc3959b8ba87dcbcbe73797465. --- rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-version b/rust-version index 6884c82e9..0c4fc2d5f 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -a31c27a887b40df16ab9dfb8c9f7924636092509 +c58275e0369d09fc3959b8ba87dcbcbe73797465