Skip to content

Commit 31568a9

Browse files
committed
Update the library stabilization guide to refer to the new placeholder system
1 parent a744e15 commit 31568a9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/feature-lifecycle/stabilization.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ Library items are marked unstable via the `#[unstable]` attribute, like this:
6464
pub fn total_cmp(&self, other: &Self) -> crate::cmp::Ordering { ... }
6565
```
6666

67-
You'll need to change that to a `#[stable]` attribute with a version:
67+
You'll need to change that to a `#[stable]` attribute with the version set to the placeholder `CURRENT_RUSTC_VERSION`:
6868

6969
```rust,ignore
70-
#[stable(feature = "total_cmp", since = "1.61.0")]
70+
#[stable(feature = "total_cmp", since = "CURRENT_RUSTC_VERSION")]
7171
```
7272

73-
Note that, the version number is updated to be the version number of the stable release where this feature will appear. This can be found by consulting [`src/version`](https://github.com/rust-lang/rust/blob/master/src/version) on the current master branch of `rust-lang/rust`.
73+
Note that other `#[stable]` attributes will contain spelled out version numbers, but you should not spell out any version number as it might get outdated by the time your pull request merges.
7474

7575
### Remove feature gates from doctests
7676

@@ -107,9 +107,9 @@ To stabilize a feature, follow these steps:
107107
0. Create a stabiliation report in the tracking issue for the feature being stabilized.
108108
0. (Optional) For partial stabilizations, create a new partial stabilization PR for the subset of the issue being stabilized.
109109
0. Ask a **@rust-lang/libs-api** member to start an FCP on the tracking issue and wait for the FCP to complete (with `disposition-merge`).
110-
0. Change `#[unstable(...)]` to `#[stable(since = "version")]`. `version` should be the *current nightly*, i.e. stable+2. You can see which version is the current nightly in [`src/version`](https://github.com/rust-lang/rust/blob/master/src/version) on the master branch of `rust-lang/rust`.
110+
0. Change `#[unstable(...)]` to `#[stable(since = "CURRENT_RUSTC_VERSION")]`. `CURRENT_RUSTC_VERSION` here is meant in a literal sense and not to be replaced with the spelled out version number.
111111
0. Remove `#![feature(...)]` from any test or doc-test for this API. If the feature is used in the compiler or tools, remove it from there as well.
112-
0. If applicable, change `#[rustc_const_unstable(...)]` to `#[rustc_const_stable(since = "version")]`.
112+
0. If applicable, change `#[rustc_const_unstable(...)]` to `#[rustc_const_stable(since = "CURRENT_RUSTC_VERSION")]`.
113113
0. Open a PR against `rust-lang/rust`.
114114
- Add the appropriate labels: `@rustbot modify labels: +T-libs-api`.
115115
- Link to the tracking issue by adding "Closes #XXXXX".

0 commit comments

Comments
 (0)