Skip to content

Conversation

@github-actions
Copy link

This is an automated PR to update the subtree/library branch to the changes from 2025-10-09 (rust-lang/rust@b6f0945) to 2025-11-27 (rust-lang/rust@1be6b13), inclusive.
Review this PR as usual, but do not merge this PR using the GitHub web interface. Instead, once it is approved, use git push to literally push the changes to subtree/library without any rebase or merge.

folkertdev and others added 16 commits October 15, 2025 20:43
ARM has withdrawn FEAT_TME

https://developer.arm.com/documentation/102105/lb-05/

LLVM has dropped support for it recently as a result.
Signed-off-by: tison <wander4096@gmail.com>
…onszelmann

Stabilize `asm_cfg`

tracking issue: rust-lang#140364
closes rust-lang#140364

Reference PR:

- rust-lang/reference#2063

# Request for Stabilization

## Summary

The `cfg_asm` feature allows `#[cfg(...)]` and `#[cfg_attr(...)]` on  the arguments of the assembly macros, for instance:

```rust
asm!( // or global_asm! or naked_asm!
    "nop",
    #[cfg(target_feature = "sse2")]
    "nop",
    // ...
    #[cfg(target_feature = "sse2")]
    a = const 123, // only used on sse2
);
```

## Semantics

Templates, operands, `options` and `clobber_abi` in the assembly macros (`asm!`, `naked_asm!` and `global_asm!`) can be annotated with `#[cfg(...)]` and `#[cfg_attr(...)]`. When the condition evaluates to true, the annotated argument has no effect, and is completely ignored when expanding the assembly macro.
## Documentation

reference PR: rust-lang/reference#2063

## Tests

- [tests/ui/asm/cfg.rs](https://github.com/rust-lang/rust/blob/master/tests/ui/asm/cfg.rs) checks that `cfg`'d arguments where the condition evaluates to false have no effect
- [tests/ui/asm/cfg-parse-error.rs](https://github.com/rust-lang/rust/blob/master/tests/ui/asm/cfg.rs) checks the parsing rules (parsing effectively assumes that the cfg conditions are all true)

## History

- rust-lang#140279
- rust-lang#140367

# Resolved questions

**how are other attributes handled**

Other attributes are parsed,  but explicitly rejected.

# unresolved questions

**operand before template**

The current implementation expects at least one template string before any operands. In the example below, if the `cfg` condition evaluates to true, the assembly block is ill-formed. But even when it evaluates to `false` this block is rejected, because the parser still expects just a template (a template is parsed as an expression and then validated to ensure that it is or expands to a string literal).

Changing how this works is difficult.
```rust
// This is rejected because `a = out(reg) x` does not parse as an expresion.
asm!(
	#[cfg(false)]
	a = out(reg) x, //~ ERROR expected token: `,`
	"",
);
```

**lint on positional arguments?**

Adding a lint to warn on the definition or use of positional arguments being `cfg`'d out was discussed in rust-lang#140279 (comment) and subsequent comments. Such a lint is not currently implemented, but that may not be a blocker based on the comments there.

r? `@traviscross` (I'm assuming you'll reassign as needed)
…yukang

Simplify OnceCell Clone impl

Noticed when developing fast/mea#79.

This may also apply to `OnceLock`. But unfortunately, we can't construct a completed `Once` beforehand.

Note that `OnceCell::from` is marked as [`rustc_const_unstable`](rust-lang#143773) so we don't need an extra `const fn from_value` to leverage possible const convert benefit.
Offload intrinsic

This PR implements the minimal mechanisms required to run a small subset of arbitrary offload kernels without relying on hardcoded names or metadata.

- `offload(kernel, (..args))`: an intrinsic that generates the necessary host-side LLVM-IR code.
- `rustc_offload_kernel`: a builtin attribute that marks device kernels to be handled appropriately.

Example usage (pseudocode):
```rust
fn kernel(x: *mut [f64; 128]) {
    core::intrinsics::offload(kernel_1, (x,))
}

#[cfg(target_os = "linux")]
extern "C" {
    pub fn kernel_1(array_b: *mut [f64; 128]);
}

#[cfg(not(target_os = "linux"))]
#[rustc_offload_kernel]
extern "gpu-kernel" fn kernel_1(x: *mut [f64; 128]) {
    unsafe { (*x)[0] = 21.0 };
}
```
rustc_target: aarch64: Remove deprecated FEAT_TME

fixes rust-lang#149308

ARM has withdrawn FEAT_TME

https://developer.arm.com/documentation/102105/lb-05/

LLVM has dropped support for generating it
llvm/llvm-project#167687

```@rustbot``` label llvm-main

r? ```@durin42```
…acrum

Add `Box::clone_from_ref` and similar under `feature(clone_from_ref)`

Tracking issue: rust-lang#149075

Accepted ACP: rust-lang/libs-team#483

This PR implements `clone_from_ref` (and `try_*` and `_*in` variants), to get a `Box<T>`, `Arc<T>`, or `Rc<T>` by cloning from a `&T` where `T: CloneToUninit`.

The "Implement..." commits replace some ad-hoc conversions with `clone_from_ref` variants, which can be split out to a separate PR if desired.

This PR will conflict with rust-lang#148769 due to usage of `Layout::dangling` (which that PR is renaming to `dangling_ptr`), so they should not be rolled up together, and the one which merges later will need to be amended.
@tautschnig tautschnig merged commit 34b229d into subtree/library Jan 19, 2026
4 of 5 checks passed
@tautschnig tautschnig deleted the update-subtree/library branch January 19, 2026 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants