rust/library/core
Matthias Krüger 55a1f8b955
Rollup merge of #91122 - dtolnay:not, r=m-ou-se
impl Not for !

The lack of this impl caused trouble for me in some degenerate cases of macro-generated code of the form `if !$cond {...}`, even without `feature(never_type)` on a stable compiler. Namely if `$cond` contains a `return` or `break` or similar diverging expression, which would otherwise be perfectly legal in boolean position, the code previously failed to compile with:

```console
error[E0600]: cannot apply unary operator `!` to type `!`
   --> library/core/tests/ops.rs:239:8
    |
239 |     if !return () {}
    |        ^^^^^^^^^^ cannot apply unary operator `!`
```
2022-01-23 01:09:41 +01:00
..
benches
primitive_docs
src Rollup merge of #91122 - dtolnay:not, r=m-ou-se 2022-01-23 01:09:41 +01:00
tests Rollup merge of #91122 - dtolnay:not, r=m-ou-se 2022-01-23 01:09:41 +01:00
Cargo.toml Switch all libraries to the 2021 edition 2021-12-23 19:03:47 +08:00