Skip to content

Commit

Permalink
Update the library stabilization guide to refer to the new placeholde…
Browse files Browse the repository at this point in the history
…r system
  • Loading branch information
est31 committed Aug 23, 2022
1 parent a744e15 commit fc54bfa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/feature-lifecycle/stabilization.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ Library items are marked unstable via the `#[unstable]` attribute, like this:
pub fn total_cmp(&self, other: &Self) -> crate::cmp::Ordering { ... }
```

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

```rust,ignore
#[stable(feature = "total_cmp", since = "1.61.0")]
#[stable(feature = "total_cmp", since = "CURRENT_RUSTC_VERSION")]
```

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`.
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.

### Remove feature gates from doctests

Expand Down

0 comments on commit fc54bfa

Please sign in to comment.