From d4afa3fd4436c58b6309899c88d2ed3cd9a01aac Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 2 Nov 2024 08:00:00 +0100 Subject: [PATCH] update const stability docs --- src/stability.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/stability.md b/src/stability.md index 9549b0578..c04869387 100644 --- a/src/stability.md +++ b/src/stability.md @@ -58,9 +58,6 @@ ipsum")]` has the same interface as the `unstable` attribute. It is used to mark (The compiler will tell you to add the attribute if you run into this.) - If a `const fn` is `#[stable]` but not yet intended to be const-stable. -Furthermore, this attribute is needed to mark an intrinsic as an *unstable* `const fn`, because -there's no way to add `const` to functions in `extern` blocks for now. - Const-stability differs from regular stability in that it is *recursive*: a `#[rustc_const_unstable(...)]` function cannot even be indirectly called from stable code. This is to avoid accidentally leaking unstable compiler implementation artifacts to stable code or locking @@ -82,6 +79,8 @@ compiler features); the only reason it is not const-stable yet are API concerns. This should also be added to lang items for which const-calls are synthesized in the compiler, to ensure those calls do not bypass recursive const stability rules. +## rustc_const_stable_intrinsic + On an intrinsic, this attribute marks the intrinsic as "ready to be used by public stable functions". The `rustc_const_unstable` can be removed when this attribute is added. **Adding this attribute to an intrinsic requires t-lang and wg-const-eval approval!**