From f115038cf4344d3b4197770351cd49156bc7c142 Mon Sep 17 00:00:00 2001 From: DianQK Date: Sun, 3 Nov 2024 10:59:00 +0800 Subject: [PATCH 1/2] Describe how to revert a PR --- src/contributing.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/contributing.md b/src/contributing.md index 70401e18c..7ec15dbb6 100644 --- a/src/contributing.md +++ b/src/contributing.md @@ -313,6 +313,22 @@ 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 mis-compile, significant performance regressions, or other critical issues, +we may want to revert that PR with a test case. + +If the PR contains huge changes, it can be challenging to revert, +making it harder to review incremental fixes in subsequent updates. +Or if a 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, as shown in [#132356][#132356]. + +[#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). From c015dd9f32018c3ec053afdb5b62451b53a69343 Mon Sep 17 00:00:00 2001 From: Jieyou Xu Date: Sun, 3 Nov 2024 14:30:39 +0800 Subject: [PATCH 2/2] Slightly adjust wording and link to forge docs for revert policy --- src/contributing.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/contributing.md b/src/contributing.md index 7ec15dbb6..ad1d33265 100644 --- a/src/contributing.md +++ b/src/contributing.md @@ -315,17 +315,20 @@ leave a comment on the original PR asking the reviewer to close it for you. ### Reverting a PR -When a PR leads to mis-compile, significant performance regressions, or other critical issues, -we may want to revert that PR with a test case. +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 a certain code in that PR is heavily depended upon by subsequent PRs, -reverting it can become difficult. +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, as shown in [#132356][#132356]. +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