about summary refs log tree commit diff
path: root/tests/ui/macros/assert-desugaring-145770.rs
blob: d56e771ecfb07a1fe0c95f4749866285532bf396 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//! Regression test for #145770.
//!
//! Changing the `assert!` desugaring from an `if !cond {}` to `match` expression is
//! backwards-incompatible, and may need to be done over an edition boundary or limit editions for
//! which the desguaring change impacts.

//@ check-pass

#[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);
}