Skip to content

Commit d4a35b2

Browse files
authored
docs: document how to remove/deprecate an interface (#2209)
1 parent 57f90c7 commit d4a35b2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

CONVENTIONS.md

+17
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,20 @@ type or mutability that way.
100100
[`cast()`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast
101101
[`cast_mut()`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast_mut
102102
[`cast_const()`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.cast_const
103+
104+
## Remove/deprecate an interface
105+
106+
In Nix, if we want to remove something, we don't do it immediately, instead, we
107+
deprecate it for at least one release before removing it.
108+
109+
To deprecate an interface, put the following attribute on the top of it:
110+
111+
```
112+
#[deprecated(since = "<Version>", note = "<Note to our user>")]
113+
```
114+
115+
`<Version>` is the version where this interface will be deprecated, in most
116+
cases, it will be the version of the next release. And a user-friendly note
117+
should be added. Normally, there should be a new interface that will replace
118+
the old one, so a note should be something like: "<New Interface> should be
119+
used instead".

0 commit comments

Comments
 (0)