You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/libs/maintaining-std.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -61,13 +61,23 @@ You should just about never need `#[inline(always)]`. It may be beneficial for p
61
61
62
62
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.
63
63
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:
65
69
66
70
- Using compiler lints to try phase out broken behavior.
67
71
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.
69
79
70
-
#### Inference breaks when a second generic impl is introduced
80
+
#####Inference breaks when a second generic impl is introduced
71
81
72
82
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:
73
83
@@ -98,7 +108,7 @@ will no longer compile, because we've previously been relying on inference to fi
98
108
99
109
This kind of breakage can be ok, but a [`crater`] run should estimate the scope.
100
110
101
-
#### Deref coercion breaks when a new impl is introduced
111
+
#####Deref coercion breaks when a new impl is introduced
102
112
103
113
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:
0 commit comments