Skip to content

Commit 43210f5

Browse files
committed
update const docs
1 parent 8a7c773 commit 43210f5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libs/maintaining-std.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,6 @@ Changes to hot code might impact performance in consumers, for better or for wor
197197

198198
PRs shouldn’t have merge commits in them. If they become out of date with `master` then they need to be rebased.
199199

200-
### Are functions const-stabilized or constified?
201-
202-
Please CC `@rust-lang/wg-const-eval`.
203-
204200
## Merging PRs
205201

206202
PRs to [`rust-lang/rust`] aren’t merged manually using GitHub’s UI or by pushing remote branches. Everything goes through [`bors`].
@@ -229,7 +225,11 @@ You can find the right version to use in the `#[stable]` attribute by checking t
229225

230226
### When a `const` function is being stabilized
231227

232-
Const functions can be stabilized in a PR that replaces `#[rustc_const_unstable]` attributes with `#[rustc_const_stable]` ones. The [Constant Evaluation WG] should be pinged for input on whether or not the `const`-ness is something we want to commit to. This is particularly important when the function internally depends on other unstable `const` functions through `#[allow_internal_unstable]` attributes.
228+
Const functions can be stabilized in a PR that replaces `#[rustc_const_unstable]` attributes with `#[rustc_const_stable]` ones. The [Constant Evaluation WG] should be pinged for input on whether or not the `const`-ness is something we want to commit to. If it is an intrinsic being exposed that is const-stabilized then `@rust-lang/lang` should also be included in the FCP.
229+
230+
Check whether the function internally depends on other unstable `const` functions through `#[allow_internal_unstable]` attributes and consider how the function could be implemented if its internally unstable calls were removed. See the _Stability attributes_ page for more details on `#[allow_internal_unstable]`.
231+
232+
Where `unsafe` and `const` is involved, e.g., for operations which are "unconst", that the const safety argument for the usage also be documented. That is, a `const fn` has additional determinism (e.g. run-time/compile-time results must correspond and the function's output only depends on its inputs...) restrictions that must be preserved, and those should be argued when `unsafe` is used.
233233

234234
[API Guidelines]: https://rust-lang.github.io/api-guidelines
235235
[Unsafe Code Guidelines WG]: https://github.com/rust-lang/unsafe-code-guidelines

0 commit comments

Comments
 (0)