Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Apply De Morgan's Law" does not round-trip properly #15239

Closed
DropDemBits opened this issue Jul 9, 2023 · 1 comment · Fixed by #15410
Closed

"Apply De Morgan's Law" does not round-trip properly #15239

DropDemBits opened this issue Jul 9, 2023 · 1 comment · Fixed by #15410
Assignees
Labels
A-assists C-bug Category: bug

Comments

@DropDemBits
Copy link
Contributor

DropDemBits commented Jul 9, 2023

Starting from

fn main() {
    let _ = a &&$0 (b || c);
}

The expression gets transformed into !(!a || !(b || c)), which is correct.
However, applying it again on the first logical-or transforms the expression into (a && b || c) instead of the original expression.

A similar issue occurs when you start with a || (b && c) instead.


rust-analyzer version: rust-analyzer version: 0.3.1575-standalone (ff485b6 2023-07-02)

rustc version: rustc 1.70.0 (90c541806 2023-05-31)

relevant settings: Not Applicable

@DropDemBits DropDemBits added the C-bug Category: bug label Jul 9, 2023
@DropDemBits DropDemBits changed the title "Apply DeMorgan's Law" does not round-trip properly "Apply De Morgan's Law" does not round-trip properly Jul 9, 2023
@alibektas
Copy link
Member

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assists C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants