Skip to content

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

@DropDemBits

Description

@DropDemBits

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions