Unstable features (including language, library, tools...) we currently use.
S…ee as well:
- https://github.com/Rust-for-Linux/linux/issues/354
- https://github.com/Rust-for-Linux/linux/issues/514
- https://github.com/Rust-for-Linux/linux/issues/408
- https://github.com/Rust-for-Linux/linux/issues/572
- https://github.com/Rust-for-Linux/linux/issues/355
- https://github.com/Rust-for-Linux/linux/issues/350
- https://github.com/Rust-for-Linux/linux/issues/398
- https://github.com/Rust-for-Linux/linux/issues/353
- https://github.com/Rust-for-Linux/linux/issues/349
- https://github.com/Rust-for-Linux/linux/issues/397
- https://github.com/Rust-for-Linux/linux/issues/396
- https://github.com/Rust-for-Linux/linux/issues/1051
- https://github.com/Rust-for-Linux/linux/issues/1080
- https://github.com/Rust-for-Linux/linux/issues/1011
- https://github.com/Rust-for-Linux/linux/issues/927
- https://github.com/Rust-for-Linux/linux/issues/949
- https://github.com/Rust-for-Linux/linux/issues/1029
### Required (we almost certainly want them)
- [ ] `cfg(no_fp_fmt_parse)`.
+ Tracking Issue: -.
+ Used by: Kbuild (`core`).
+ Status: added as unstable in 1.55 (https://github.com/rust-lang/rust/pull/86048).
- [ ] `cfg(no_global_oom_handling)`.
+ Tracking Issue: -.
+ Used by: Kbuild (`alloc`).
+ Status: added as unstable in 1.54 (https://github.com/rust-lang/rust/pull/84266).
- [ ] `cfg(no_rc)`.
+ Tracking Issue: -.
+ Used by: Kbuild (`alloc`).
+ Status: added as unstable in 1.66 (https://github.com/rust-lang/rust/pull/89891).
- [ ] `cfg(no_sync)`.
+ Tracking Issue: -.
+ Used by: Kbuild (`alloc`).
+ Status: added as unstable in 1.66 (https://github.com/rust-lang/rust/pull/89891).
- [ ] `feature(asm_goto)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/119364.
+ Used by: nothing yet in-tree, but it is needed for e.g. reimplementing jump label support (https://docs.kernel.org/staging/static-keys.html).
+ Status: added as unstable in 1.78 (https://github.com/rust-lang/rust/pull/119365).
+ LKML: https://lore.kernel.org/rust-for-linux/ZWipTZysC2YL7qsq@Boquns-Mac-mini.home/
+ RFC: https://github.com/rust-lang/rfcs/blob/master/text/2873-inline-asm.md#asm-goto.
- [ ] `feature(const_mut_refs)` & `feature(const_refs_to_static)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/57349 and https://github.com/rust-lang/rust/issues/119618.
+ Used by: VFS, block layer... in order to fill `const TABLE`s (setting `owner` field to `THIS_MODULE`), as well as `rust/kernel/module_param.rs` (in the `rust` branch).
+ Status: seems like it may land relatively soon. It is one of the subfeatures of `const_fn`.
+ Reduced example: https://godbolt.org/z/r58jP6YM4.
+ PR: https://github.com/rust-lang/rust/pull/119614 (1.78).
+ PR including our `VTABLE` test case (`tests/ui/consts/const-ref-to-static-linux-vtable.rs`): https://github.com/rust-lang/rust/pull/120932 (1.78).
+ Earlier (using static) Issue: https://github.com/rust-lang/rust/issues/118447.
+ Earlier (using static) Related PR: https://github.com/rust-lang/rust/pull/118324 (1.76) (if merged, and then other follow-up work Ralf has planned also lands, then the restriction could be relaxed).
+ Rust Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Consts.20pointing.20to.20mutable.20statics/near/404605842
- [ ] `feature(derive_smart_pointer)` (i.e. `derive(SmartPointer)`).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/123430.
+ Used by: `Arc`.
+ Status: implementation from @wedsonaf at https://github.com/rust-lang/rust/pull/123472.
+ It is an alternative ("hooks/customization points") to having to stabilize other unstable features that would be otherwise needed to implement our custom `Arc`.
+ RFC: https://github.com/rust-lang/rfcs/pull/3621.
+ RFC (one of the solutions for the unsoundness issue in the main RFC): https://github.com/rust-lang/rust/pull/125048.
+ Cc: @wedsonaf (PoC), @Darksonn (RFC), @Veykril (RFC).
+ Meeting/discussion document: https://hackmd.io/OCz8EfzrRXeogXEDcOrL2w.
+ Rust Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/410673-t-lang.2Fmeetings/topic/RfL.20meeting.202024-03-06/near/431156003.
+ Rust Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/425075-rust-for-linux/topic/meeting.202024-04-03/near/431148847.
+ Related: https://github.com/rust-lang/rust/pull/125072 (1.80).
- [ ] `feature(doc_cfg)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/43781.
+ Used by: `rust/kernel/lib.rs`.
+ Status: it looks like the feature will get stabilized, although there is still discussions around several bits, e.g. about automatically inferring `doc(cfg(...))` from the `cfg(...)` (to avoid duplication) etc. See also https://github.com/Rust-for-Linux/linux/issues/447.
- [ ] `feature(impl_trait_in_assoc_type)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/63063 (the tracking issue is the original one before it got split from that one in https://github.com/rust-lang/rust/pull/110237).
+ Used by: `rnull` (https://lore.kernel.org/rust-for-linux/20240313110515.70088-5-nmi@metaspace.dk/).
+ Status: ?.
- [ ] `feature(offset_of_nested)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/120140.
+ Used by: Binder (in one place: https://lore.kernel.org/rust-for-linux/CAH5fLgjP98pS1wsP=YXP5Yr79Y62VF7XPKjbj+G75B3SOFt80g@mail.gmail.com/) and possibly elsewhere in the future.
+ Status: added as unstable in 1.77 when the single-field one (`offset_of`) got stabilized (https://github.com/rust-lang/rust/pull/118799).
- [ ] `feature(register_tool)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/66079.
+ Used by: `klint` https://github.com/Rust-for-Linux/linux/pull/958.
+ Status: waiting for RFC to clarify use cases.
- [ ] `__rust_no_alloc_shim_is_unstable`.
+ Tracking Issue: ?.
+ Used by: `rust/kernel/allocator.rs`.
+ Status: added as unstable in 1.71 (https://github.com/rust-lang/rust/pull/86844); see https://github.com/rust-lang/rust/issues/73632 as well.
- [ ] `-Zbinary_dep_depinfo=y`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/63012.
+ Used by: Kbuild.
+ Status: we could get around it by making the build system more complicated (particularly if the kernel does not upgrade the minimum Make version), but it would be best to avoid that.
- [ ] `-Zbranch-protection`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/113369.
+ Used by: arm64's `CONFIG_ARM64_BTI_KERNEL` etc.
+ Status: Unknown, potentially to be merged with `-Zcf-protection` -- see https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/.60-Zbranch-protection.60.20stability/near/391152508.
- [ ] `-Zcf-protection=branch` (CET).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/93754.
+ Used by: x86_64's `CONFIG_X86_KERNEL_IBT` (https://lore.kernel.org/rust-for-linux/20231009224347.2076221-1-mmaurer@google.com/).
+ Status: implemented in 1.60 (https://github.com/rust-lang/rust/pull/93439).
- [ ] `-Zdebuginfo-compression`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/120953.
+ Used by: Kbuild.
+ Status: added as unstable in 1.74 (https://github.com/rust-lang/rust/pull/115358).
- [ ] `-Zdwarf-version`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/103057.
+ Used by: Kbuild.
+ Status: added as unstable in 1.64 (https://github.com/rust-lang/rust/pull/98350).
- [ ] `-Zfunction-return=thunk-extern`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/116853.
+ Used by: x86_64's `CONFIG_RETHUNK`.
+ Status: Implementation PR at https://github.com/rust-lang/rust/pull/116892.
- [ ] `-Zinstrument-mcount`.
+ Tracking Issue: ? https://github.com/rust-lang/rust/issues/84605 (`#[no_coverage]`).
+ Used by: ftrace, eventually.
+ Status: Broken? (https://github.com/rust-lang/rust/issues/92109). Perhaps related to the new pass manager? Closed PR: https://github.com/rust-lang/rust/pull/96238.
- [ ] `-Zno-jump-tables`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/116592.
+ Used by: x86_64's `CONFIG_X86_KERNEL_IBT` (https://lore.kernel.org/rust-for-linux/20231009224347.2076221-1-mmaurer@google.com/).
+ Status: Unknown, but in principle it should be possible to stabilize.
+ PR: https://github.com/rust-lang/rust/pull/105812 (1.68).
+ PR: https://github.com/rust-lang/rust/pull/116593 (1.75).
- [ ] `-Zrandomize-layout` (and `-Zlayout-seed=<seed>`).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/106764.
+ Used by: security (upcoming).
+ Status: unknown. The use case of the MCP was debugging (e.g. detecting invalid layout assumptions), rather than security (which the kernel uses under some configurations -- see `CONFIG_RANDSTRUCT*`).
- [ ] `-Zsanitizer=kcfi` & `-Zsanitizer-cfi-normalize-integers` (KCFI).
+ Tracking Issue (KCFI): https://github.com/rust-lang/rust/issues/123479.
+ Tracking Issue (CFI): https://github.com/rust-lang/rust/issues/89653.
+ Tracking Issue (sanitizers in general): https://github.com/rust-lang/rust/issues/39699.
+ Used by: arm32/arm64/RISC-V/x86_64's KCFI (`CONFIG_CFI_CLANG`).
+ Status: ready for use in 1.79 (https://lore.kernel.org/rust-for-linux/CAGSQo024u1gHJgzsO38Xg3c4or+JupoPABQx_+0BLEpPg0cOEA@mail.gmail.com/), implemented with some key differences vs. CFI -- benchmarks needed / report regressions (https://lore.kernel.org/rust-for-linux/CAOcBZOS2kPyH0Dm7Fuh4GC3=v7nZhyzBj_-dKu3PfAnrHZvaxg@mail.gmail.com/).
+ KCFI PRs: https://github.com/rust-lang/rust/pulls?q=is%3Apr+cfi+label%3APG-exploit-mitigations+-label%3Arollup (1.58..1.79).
+ KCFI will require `-Cpanic=abort` until LLVM's `invoke` supports KCFI bundles: https://github.com/rust-lang/rust/pull/123106#issuecomment-2027436640.
+ KCFI Rust docs: https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/sanitizer.html#kernelcontrolflowintegrity.
+ KCFI RFC: https://github.com/rust-lang/rfcs/pull/3296.
+ KCFI PR on the kernel side: https://github.com/Rust-for-Linux/linux/pull/1034 (https://github.com/maurer/linux/commits/kcfi/).
+ @maurer's design doc: [Fixing CFI VTables](https://hackmd.io/6U7gB9SkQBWV9l4iIsp3Jg).
+ Cc: @rcvalle @maurer.
- [ ] `-Ztune-cpu=generic`.
+ Tracking Issue: ?.
+ Used by: x86's `Makefile`.
+ Status: unknown (no tracking issue?).
- [ ] `-Zub-checks` (`cfg(ub_checks)`).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/123499.
+ Used by: Kbuild.
+ Status: added as unstable in 1.79 (https://github.com/rust-lang/rust/pull/123411).
- [ ] `rustdoc`'s `--no-run` (`-Zunstable-options`).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/87022.
+ Used by: KUnit test generation.
+ Status: no recent update.
- [ ] `rustdoc`'s `--test-builder` (`-Zunstable-options`).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/102981.
+ Used by: KUnit test generation.
+ Status: it appears it is not intended to be stabilized.
- [ ] Remaining target features unknown to `rustc`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/44839.
+ Used by: Kbuild.
+ Status: unclear. Alternatively, we could use a way to suppress the warning for unknown features + get a promise that all features are disabled by default (so that we can enable the ones we need only). See https://github.com/Rust-for-Linux/linux/commit/c5eae3a6e69c63dc8d69f51f74f74b853831ec71, https://github.com/Rust-for-Linux/linux/commit/9a9d6eea257edf99f32161775de82b171181cf59, https://github.com/rust-lang/rust/issues/96472 and https://github.com/rust-lang/rust/pull/87402 for context.
- [ ] Target specification file or enough command-line flags to replace it.
+ Tracking Issue: ?.
+ Used by: Kbuild.
+ Status: the target specification file is fairly tied to LLVM, thus it is unclear if something like it can be ever stabilized. Stabilizing command-line flags appears to be the likely path forward. In cases where the flag would change the ABI, a ["global target feature"](https://github.com/rust-lang/rust/issues/121970#issuecomment-1978605782) concept (e.g. `-Cglobal-target-feature=`) could be useful, i.e. a target feature that is required to be set the same way for all compilation units (without requiring a new target). In other words, using flags to create combinations of targets instead of requiring a different for each combination.
### Good to have (we could workaround if needed)
- [ ] `--extern force:`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/111302.
+ Used by: possibly Kbuild (as a workaround for empty Rust files).
+ Status: it can be dropped when `new_uninit` is dropped (and there could be other workarounds); added as unstable in 1.71 (https://github.com/rust-lang/rust/pull/109421).
- [ ] `feature(associated_type_defaults)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/29661.
+ Used by: `file_operations.rs` to simplify boilerplate needed by drivers.
+ Status: there is no recent activity in the tracking issue, but we could add back the boilerplate.
- [ ] `feature(const_refs_to_cell)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/80384.
+ Used by: `rust/kernel/driver.rs`, `offset_of!` (if `feature(offset_of)` does not pan out).
+ Status: stabilization has unsolved issues with its interaction with `const_heap`.
- [ ] `feature(const_trait_impl)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/67792.
+ Used by: `rust/kernel/driver.rs`.
+ Status: "This RFC has not yet been accepted. It is being implemented on a provisional basis to evaluate the potential fallout.". Moreover, the syntax is undecided/temporary.
- [ ] `feature(c_size_t)`
+ Tracking Issue: https://github.com/rust-lang/rust/issues/88345.
+ Used by: `rust/kernel/file.rs` (so far, but could be anywhere in the abstractions).
+ Status: unknown, but `core_ffi_c` had its FCP complete and `c_{s,}size_t` are now in `core::ffi`. We can always go back to `c_types.rs`.
- [ ] `feature(duration_constants)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/57391.
+ Used by: `rust/kernel/delay.rs`.
+ Status: the FCP stalled, and there was discussion around other alternatives (e.g. a `TimeUnits` to do things like `2.seconds()`). We can always use our own constants.
- [ ] `feature(new_uninit)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/63291.
+ Used by: the `pin-init` API.
+ Status: the `Box` APIs (which are the ones we need) do not seem to have concerns for stabilization. However, @tgross35 says:
> Last I heard the libs team was looking for a way to have something like a builder pattern rather than all the permutations of new, new_uninit, new_uninit_zeroed, try_new, etc. I proposed an incomplete API somewhere (libs team repo?) but it didn’t go anywhere
+ Alternative (proposed by Benno): https://rust-for-linux.zulipchat.com/#narrow/stream/288089-General/topic/dropping.20the.20.60new_uninit.60.20feature/near/435522549.
- [ ] `feature(ptr_metadata)` ([`core::ptr::metadata`](https://doc.rust-lang.org/core/ptr/fn.metadata.html) and [`core::ptr::from_raw_parts_mut`](https://doc.rust-lang.org/core/ptr/fn.from_raw_parts_mut.html) functions).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/81513.
+ Used by: `Arc`, and potentially by `impl_zeroable!` to include pointers to DSTs when their metadata is `Zeroable` via the [`Pointee`](https://doc.rust-lang.org/core/ptr/trait.Pointee.html) trait.
+ Status: in discussion, design concerns.
+ Alternatives: https://github.com/rust-lang/rust/issues/96283 (1.75, which we will use soon -- patch at https://lore.kernel.org/rust-for-linux/20240215104601.1267763-1-aliceryhl@google.com/) and https://github.com/rust-lang/libs-team/issues/111.
- [ ] `-Zbuild-std`.
+ Cargo reference: https://doc.rust-lang.org/cargo/reference/unstable.html#build-std.
+ WG: https://github.com/rust-lang/wg-cargo-std-aware.
+ Used by: Kbuild (only for the `rusttest` target).
+ Status: progress is not clear. See https://github.com/Rust-for-Linux/linux/issues/572.
- [ ] `-Zcrate-attr`.
+ Tracking Issue: ? (there is a https://github.com/rust-lang/rust/pull/52355).
+ Used by: all kernel modules. It could also be used to solve https://github.com/rust-lang/rfcs/pull/3226 as long as the attributes handle the local file case.
+ Status: unlikely to get stabilized (although in the custom logo RFC it was discussed), but we only use it for convenience.
- [ ] `-Zfunction-sections` (in `rustc`, it applies to data too).
+ Tracking Issue: None (it comes from 2014, pre-1.0 `rustc`: https://github.com/rust-lang/rust/commit/6b130e3dd9547e233dca2cfd72a5968891672d9c).
+ Used by: `Makefile` (under `CONFIG_LD_DEAD_CODE_DATA_ELIMINATION`, which is experimental so far).
+ Status: unknown. It would be good to have, especially if the C side starts using it routinely.
- [ ] `-Zunpretty=expanded`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/43364.
+ Used by: developers through Kbuild.
+ Status: no recent progress. It is a feature that should be in stable compilers, but it is not critical for building the kernel (we could use `RUSTC_BOOTSTRAP=1` only for the target that uses it, if needed).
- [ ] `-Zuse-sync-unwind=n`.
+ Tracking Issue: ?.
+ Used by: arm64.
+ Status: added as unstable in 1.77 (https://github.com/rust-lang/rust/pull/117744). We do not need it as long as `n` remains the default.
+ From: https://lore.kernel.org/rust-for-linux/CAH5fLgg0yGbuHnMbMB103Zssg4KSfXUR3kvhr0kuqTSah=6kWg@mail.gmail.com/
### Low priority (we will likely not use them in the end)
- [ ] `feature(allocator_api)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/32838.
+ Used by: almost all modules.
+ Status: we have an in-tree `alloc` fork, but we are likely dropping it (https://lore.kernel.org/rust-for-linux/20240328013603.206764-1-wedsonaf@gmail.com/); otherwise: still quite open.
- [ ] `feature(coerce_unsized)` & `feature(unsize)` ([`core::ops::CoerceUnsized`](https://doc.rust-lang.org/core/ops/trait.CoerceUnsized.html) and [`core::marker::Unsize`](https://doc.rust-lang.org/core/marker/trait.Unsize.html) traits).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/18598.
+ Used by: `Arc`.
+ Status: we may use `feature(derive_smart_pointer)` instead to avoid depending on `Arc`'s needed features; otherwise: "the `CoerceUnsized` trait is unstable and we wish to revisit its design before stabilizing, so for now only stdlib types can be unsized" + there are unsoundness issues, see https://github.com/rust-lang/rust/issues/68015 and https://github.com/rust-lang/rust/issues/85099. See https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/rust-for-linux.20custom.20arc.20unstable.20feature.20requirements.
- [ ] `feature(dispatch_from_dyn)` ([`core::ops::DispatchFromDyn`](https://doc.rust-lang.org/core/ops/trait.DispatchFromDyn.html) trait).
+ Tracking Issue: None (internal to the compiler).
+ Used by: `Arc`.
+ Status: we may use `feature(derive_smart_pointer)` instead to avoid depending on `Arc`'s needed features; otherwise: see https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/rust-for-linux.20custom.20arc.20unstable.20feature.20requirements.
- [ ] `feature(pointer_is_aligned)` ([`is_aligned_to`](https://doc.rust-lang.org/nightly/std/primitive.pointer.html#method.is_aligned_to)).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/96284.
+ Used by: eventually by `FromBytes` (VFS abstractions, https://github.com/Rust-for-Linux/linux/issues/1038).
+ Status: the first half (`is_aligned()`) got stabilized in 1.79 (https://github.com/rust-lang/rust/pull/121948). `is_aligned_to()` may be stabilized, but it needs to be justified.
- [ ] `feature(more_fallible_allocation_methods)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/86942.
+ Used by: `alloc`.
+ Status: we have an in-tree `alloc` fork, but we are likely dropping it (https://lore.kernel.org/rust-for-linux/20240328013603.206764-1-wedsonaf@gmail.com/); otherwise: unknown.
- [ ] `feature(receiver_trait)` ([`core::ops::Receiver`](https://github.com/rust-lang/rust/blob/c62665e09c11eb1c9d8ea02df5b723364a0b8ba4/library/core/src/ops/deref.rs#L187-L201) trait).
+ Tracking Issue: None (internal to the compiler).
+ Used by: `Arc`.
+ Status: we may use `feature(derive_smart_pointer)` instead to avoid depending on `Arc`'s needed features; otherwise: see https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/rust-for-linux.20custom.20arc.20unstable.20feature.20requirements. Another potential solution might be `feature(arbitrary_self_types)` (https://github.com/rust-lang/rust/issues/44874), though it has different tradeoffs.
+ RFC: https://github.com/rust-lang/rfcs/pull/3519 (with feedback at https://github.com/rust-lang/rfcs/pull/3519#discussion_r1492385549 and https://hackmd.io/z4n40072Tqy8MhQPZn0N-g).
### Done (i.e. stabilized, or not needed anymore, etc.)
- [x] `--check-cfg`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/82450.
+ Used by: Kbuild.
+ Status: stabilized in 1.79 (https://github.com/rust-lang/rust/pull/123501).
+ Tested for the kernel in 1.77, feedback at: https://github.com/rust-lang/rust/issues/82450#issuecomment-1947462977.
+ PR from feedback (avoid printing all the possible `cfg`s): https://github.com/rust-lang/rust/pull/121202 (1.78).
+ PR from feedback (use `CARGO_CRATE_NAME` instead of `CARGO` as a better heuristic for Cargo diagnostics): https://github.com/rust-lang/rust/pull/121237 (1.78).
- [x] `feature(alloc_error_handler)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/51540.
+ Used by: -.
+ Status: marked as done since we use `no_global_oom_handling`.
- [x] `feature(bench_black_box)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/64102.
+ Used by: `samples/rust/rust_stack_probing.rs`.
+ Status: stabilized in 1.66 (https://github.com/rust-lang/rust/pull/102232).
- [x] `feature(concat_idents)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/29599.
+ Used by: `drivers/android/defs.rs` in the past, nothing now.
+ Status: no plan to stabilize, using the `paste` crate is an alternative (or, in general, generating code). We ended up using a proc macro on our side #826.
- [x] `feature(const_fn_transmute)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/53605.
+ Used by: `rust/kernel/str.rs`.
+ Status: stabilized in 1.56 (https://github.com/rust-lang/rust/pull/85769). It is one of the subfeatures of `const_fn`.
- [x] `feature(const_fn_trait_bound)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/57563.
+ Used by: `rust/kernel/file_operations.rs` and `rust/kernel/module_param.rs`.
+ Status: stabilized in 1.61 (https://github.com/rust-lang/rust/pull/93827). No tracking issue of its own. It is one of the subfeatures of `const_fn`.
- [x] `feature(const_maybe_uninit_zeroed)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/91850.
+ Used by: PHY (https://lore.kernel.org/rust-for-linux/20231017113014.3492773-2-fujita.tomonori@gmail.com/).
+ Status: stabilized in 1.75 (https://github.com/rust-lang/rust/pull/116218).
- [x] `feature(const_panic)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/51999.
+ Used by: `rust/kernel/print.rs`.
+ Status: stabilized in 1.57 (https://github.com/rust-lang/rust/pull/89508). It is one of the subfeatures of `const_fn`.
- [x] `feature(const_ptr_offset_from)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/92980.
+ Used by: `rust/kernel/driver.rs`.
+ Status: stabilized in 1.65 (https://github.com/rust-lang/rust/pull/96240).
- [x] `feature(const_raw_ptr_deref)`
+ Tracking issue: https://github.com/rust-lang/rust/issues/51911.
+ Used by: `rust/kernel/str.rs`.
+ Status: replaced on our side with `const_fn_transmute` since that was getting stabilized sooner.
- [x] `feature(const_unreachable_unchecked)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/53188.
+ Used by: `rust/kernel/str.rs`.
+ Status: stabilized in 1.57 (https://github.com/rust-lang/rust/pull/89509). It is one of the subfeatures of `const_fn`.
- [x] `feature(core_ffi_c)`
+ Tracking Issue: https://github.com/rust-lang/rust/issues/94501.
+ Used by: bindings, `module!`, etc.
+ Status: stabilized in 1.64 (https://github.com/rust-lang/rust/pull/98315).
- [x] `feature(core_panic)`.
+ Tracking Issue: None (internal to the compiler).
+ Used by: `rust/build_assert.rs`.
+ Status: not used anymore; replaced with `panic!("{}", msg)` (2021 edition, allowed in const context since https://github.com/rust-lang/rust/pull/88954).
- [x] `feature(explicit_generic_args_with_impl_trait)`
+ Tracking Issue: https://github.com/rust-lang/rust/issues/83701.
+ Used by: `pinned-init`.
+ Status: stabilized in 1.63 (https://github.com/rust-lang/rust/pull/96868).
- [x] `feature(generic_associated_types)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/44265.
+ Used by: `rust/kernel/types.rs` (`PointerWrapper`), `rust/kernel/file_operations.rs` (`IoctlHandler`).
+ Status: stabilized in 1.65 (https://github.com/rust-lang/rust/pull/96709).
- [x] `feature(global_asm)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/35119.
+ Used by: all modules, due to code generated by the `rust/module.rs` proc macro.
+ Status: stabilized in 1.59 (https://github.com/rust-lang/rust/pull/91728) -- we may want to avoid doing things this way anyway. See #77.
- [x] `feature(let_else)`.
+ The kernel's coding style avoids nesting/identation where possible, i.e. keeping the success path as the main path. `let_else` helps naturally with that (when applicable).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/87335.
+ Used by: `rust/macros/paste.rs` and potentially everywhere.
+ Status: stabilized in 1.65 (https://github.com/rust-lang/rust/pull/93628).
- [x] `feature(maybe_uninit_extra)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/63567.
+ Used by: `rust/kernel/miscdev.rs`.
+ Status: stabilized in 1.60 (https://github.com/rust-lang/rust/pull/92768) (non-const only, which is the only part we need).
- [x] `feature(offset_of)` (single-field, i.e. no `enum`, no nested).
+ Tracking Issue: https://github.com/rust-lang/rust/issues/106655.
+ Used by: `rust/kernel/workqueue.rs` and `kernel/kasync/executor/workqueue.rs` (https://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git/commit/?h=for-6.7-rust-bindings&id=7324b88975c525a013ae0db747df97924ce80675).
+ Status: stabilized in 1.77 (https://github.com/rust-lang/rust/pull/118799).
- [x] `feature(pin_macro)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/93178.
+ Used by: `stack_pin_init!` and `stack_try_pin_init!`.
+ Status: stabilized in 1.68 (https://github.com/rust-lang/rust/pull/103800).
- [x] `feature(try_reserve)`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/48043.
+ Used by: `rust/kernel/lib.rs`.
+ Status: stabilized in 1.57 (https://github.com/rust-lang/rust/pull/87993).
- [x] `-Zallow-features`.
+ Cargo reference: https://doc.rust-lang.org/cargo/reference/unstable.html#allow-features.
+ Used by: Kbuild.
+ Status: although it will never get stabilized, we will not need it as soon as all other features we need get stabilized, thus we mark it as done.
- [x] `-Zsplit-dwarf-kind=split`.
+ Tracking Issue: ?.
+ Used by: potentially Kbuild, but only if `split` stops being the default.
+ Status: added as unstable in 1.59 (https://github.com/rust-lang/rust/pull/89819). As long as `split` is the default, we will not need it.
- [x] `-Zsymbol-mangling-version=v0`.
+ Tracking Issue: https://github.com/rust-lang/rust/issues/60705.
+ Used by: `rust/exports.c`.
+ Status: stabilized in 1.59 (https://github.com/rust-lang/rust/pull/90128). It will also be the new default, so this is a no-brainer (https://github.com/rust-lang/rust/pull/89917).