Skip to content

Commit 751139a

Browse files
committed
improve stability.md
1 parent f9a3889 commit 751139a

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

src/stability.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ This section is about the stability attributes and schemes that allow stable
44
APIs to use unstable APIs internally in the rustc standard library.
55

66
**NOTE**: this section is for *library* features, not *language* features.
7-
For instructions on
8-
stabilizing a language feature see [Stabilizing Features](./stabilization-guide.md).
7+
For instructions on stabilizing a language feature,
8+
see [Stabilizing Features](./stabilization-guide.md).
99

1010
## unstable
1111

@@ -18,31 +18,30 @@ This restriction only applies across
1818
crate boundaries, unstable items may be used within the crate that defines them.
1919

2020
The `issue` field specifies the associated GitHub [issue number].
21-
This field is
22-
required and all unstable features should have an associated tracking issue.
23-
In rare cases where there is no sensible value `issue = "none"` is used.
21+
This field is required,
22+
and all unstable features should have an associated tracking issue.
23+
In rare cases where there is no sensible value, `issue = "none"` is used.
2424

2525
The `unstable` attribute infects all sub-items, where the attribute doesn't
2626
have to be reapplied.
27-
So if you apply this to a module, all items in the module will be unstable.
27+
So, if you apply this to a module, all items in the module will be unstable.
2828

29-
If you rename a feature, you can add `old_name = "old_name"` to produce a
29+
If you rename a feature, you can add `old_name = "old_name"` to produce a
3030
useful error message.
3131

3232
You can make specific sub-items stable by using the `#[stable]` attribute on
3333
them.
3434
The stability scheme works similarly to how `pub` works.
35-
You can have
36-
public functions of nonpublic modules and you can have stable functions in
37-
unstable modules or vice versa.
35+
You can have public functions of non-public modules,
36+
and you can have stable functions in unstable modules or vice versa.
3837

3938
Previously, due to a [rustc bug], stable items inside unstable modules were
4039
available to stable code in that location.
4140
As of <!-- date-check --> September 2024, items with [accidentally stabilized
4241
paths] are marked with the `#[rustc_allowed_through_unstable_modules]` attribute
4342
to prevent code dependent on those paths from breaking.
44-
Do *not* add this attribute
45-
to any more items unless that is needed to avoid breaking changes.
43+
Do *not* add this attribute to any more items,
44+
unless that is needed to avoid breaking changes.
4645

4746
The `unstable` attribute may also have the `soft` value, which makes it a
4847
future-incompatible deny-by-default lint instead of a hard error.
@@ -161,7 +160,7 @@ You also need to take care to uphold the `const fn` invariant that calling it at
161160
compile-time needs to behave the same (see also [this blog post][blog]).
162161
This means that you
163162
may not create a `const fn` that e.g. transmutes a memory address to an integer,
164-
because the addresses of things are nondeterministic and often unknown at
163+
because the addresses of things are non-deterministic and often unknown at
165164
compile-time.
166165

167166
**Always ping @rust-lang/wg-const-eval if you are adding more

0 commit comments

Comments
 (0)