Skip to content

Commit 9873568

Browse files
authored
Update maintaining-std.md
1 parent 56f7902 commit 9873568

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

src/libs/maintaining-std.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,23 @@ You should just about never need `#[inline(always)]`. It may be beneficial for p
6161

6262
Breaking changes should be avoided when possible. [RFC 1105] lays the foundations for what constitutes a breaking change. Breakage may be deemed acceptable or not based on its actual impact, which can be approximated with a [`crater`] run.
6363

64-
For changes where the value is high and the impact is high too, there are strategies for minimizing the impact:
64+
#### Managing breakage
65+
66+
There are strategies for mitigating breakage depending on the impact.
67+
68+
For changes where the value is high and the impact is high too:
6569

6670
- Using compiler lints to try phase out broken behavior.
6771

68-
The following sections outline some kinds of breakage that may not be obvious just from the change made to the standard library.
72+
If the impact isn't too high:
73+
74+
- Looping in maintainers of broken crates and submitting PRs to fix them.
75+
76+
#### Trait impls break things
77+
78+
The following sections outline some kinds of breakage from new trait impls that may not be obvious just from the change made to the standard library.
6979

70-
#### Inference breaks when a second generic impl is introduced
80+
##### Inference breaks when a second generic impl is introduced
7181

7282
Rust will use the fact that there's only a single impl for a generic trait during inference. This breaks once a second impl makes the type of that generic ambiguous. Say we have:
7383

@@ -98,7 +108,7 @@ will no longer compile, because we've previously been relying on inference to fi
98108

99109
This kind of breakage can be ok, but a [`crater`] run should estimate the scope.
100110

101-
#### Deref coercion breaks when a new impl is introduced
111+
##### Deref coercion breaks when a new impl is introduced
102112

103113
Rust will use deref coercion to find a valid trait impl if the arguments don't type check directly. This only seems to occur if there's a single impl so introducing a new one may break consumers relying on deref coercion. Say we have:
104114

0 commit comments

Comments
 (0)