Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: document how to remove/deprecate an interface #2209

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,20 @@ type or mutability that way.
[`cast()`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast
[`cast_mut()`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast_mut
[`cast_const()`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast_const

## Remove/deprecate an interface

In Nix, if we want to remove something, we don't do it immediately, instead, we
deprecate it for at least one release before removing it.

To deprecate an interface, put the following attribute on the top of it:

```
#[deprecated(since = "<Version>", note = "<Note to our user>")]
```

`<Version>` is the version where this interface will be deprecated, in most
cases, it will be the version of the next release. And a user-friendly note
should be added. Normally, there should be a new interface that will replace
the old one, so a note should be something like: "<New Interface> should be
used instead".