Skip to content

Commit 7388b6d

Browse files
Document a trivial fix example for breaking changes
1 parent f8eb710 commit 7388b6d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/breaking-changes/summary.md

+16
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,19 @@ a different, older version.
1515
## Breaking and the trains
1616
If a PR is merged and it turns out to have caused code to not compile during the nightly or beta release cycle,
1717
unless there is a trivial fix, the PR should be reverted and a crater run should assess the impact.
18+
19+
### Model: A Trivial Fix
20+
21+
On 2024, March 9th, [`Context::ext`] was added in [#123203]. It adds a `&mut dyn Any` field to Context.
22+
On 2024, May 16th regression [#125193] appeared in beta crater: `Context` was no longer `UnwindSafe`.
23+
Some code depended on it being so, but `&mut T` is `!UnwindSafe`, so Context also became `!UnwindSafe`.
24+
25+
The PR to add `Context::ext` could have been reverted, but as the function is a nightly feature,
26+
its implications for unwind safety are limited to those actually using that nightly feature.
27+
Since nightly features are, by definition, permitted to have effects we may not want to stabilize,
28+
the question of whether the unwind safety regression should be accepted was deferred by [#125392]
29+
wrapping the field in `AssertUnwindSafe`. This allowed continued experimentation with the API.
30+
31+
[#123203]: https://github.com/rust-lang/rust/pull/123203
32+
[#125193]: https://github.com/rust-lang/rust/pull/125193
33+
[#125392]: https://github.com/rust-lang/rust/pull/125392

0 commit comments

Comments
 (0)