Skip to content

Commit

Permalink
Describe how to revert a PR (#2118)
Browse files Browse the repository at this point in the history
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
  • Loading branch information
DianQK and jieyouxu authored Nov 3, 2024
1 parent 01d0c4e commit a7a5729
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,25 @@ leave a comment on the original PR asking the reviewer to close it for you.
[labeling]: ./rustbot.md#issue-relabeling
[closing-keywords]: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue

### Reverting a PR

When a PR leads to miscompile, significant performance regressions, or other critical issues, we may
want to revert that PR with a regression test case. You can also check out the [revert policy] on
Forge docs (which is mainly targeted for reviewers, but contains useful info for PR authors too).

If the PR contains huge changes, it can be challenging to revert, making it harder to review
incremental fixes in subsequent updates. Or if certain code in that PR is heavily depended upon by
subsequent PRs, reverting it can become difficult.

In such cases, we can identify the problematic code and disable it for some input, as shown in [#128271][#128271].

For MIR optimizations, we can also use the `-Zunsound-mir-opt` option to gate the mir-opt, as shown
in [#132356][#132356].

[revert policy]: https://forge.rust-lang.org/compiler/reviews.html?highlight=revert#reverts
[#128271]: https://github.com/rust-lang/rust/pull/128271
[#132356]: https://github.com/rust-lang/rust/pull/132356

## External dependencies

This section has moved to ["Using External Repositories"](./external-repos.md).
Expand Down

0 comments on commit a7a5729

Please sign in to comment.