Revert assert! desugaring changes (#122661) by jieyouxu · Pull Request #146428 · rust-lang/rust (original) (raw)

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation7 Commits2 Checks10 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@jieyouxu

@jieyouxu

Using the MCVE reported in RUST-145770.

@jieyouxu

…, r=petrochenkov"

This reverts commit 1eeb8e8, reversing changes made to 324bf2b.

Unfortunately the assert desugaring change is not backwards compatible, see RUST-145770.

Code such as

#[derive(Debug)]
struct F {
    data: bool
}

impl std::ops::Not for F {
  type Output = bool;
  fn not(self) -> Self::Output { !self.data }
}

fn main() {
  let f = F { data: true };

  assert!(f);
}

would be broken by the assert desugaring change. We may need to land the change over an edition boundary, or limit the editions that the desugaring change impacts.

@rustbot

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rustbot rustbot added the T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

label

Sep 11, 2025

@rustbot

r? @jackh726

rustbot has assigned @jackh726.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot

This comment was marked as off-topic.

@estebank

@jackh726

@bors r=estebank,jackh726 p=1

@bors

📌 Commit b38a86f has been approved by estebank,jackh726

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Sep 11, 2025

bors added a commit that referenced this pull request

Sep 11, 2025

@bors

Rollup of 11 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit that referenced this pull request

Sep 11, 2025

@bors

Rollup of 11 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit that referenced this pull request

Sep 11, 2025

@rust-timer

Rollup merge of #146428 - jieyouxu:revert-assert-desugaring, r=estebank,jackh726

Revert assert! desugaring changes (#122661)

Reverts #122661 to prevent #145770 slipping into beta.

cc @estebank (FYI)

Review remarks

@bors

@jieyouxu jieyouxu deleted the revert-assert-desugaring branch

September 11, 2025 13:34

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-clippy

Relevant to the Clippy team.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.