|
1 |
| -error[E0600]: cannot apply unary operator `!` to type `&'static str` |
2 |
| - --> tests/ui/ensure-nonbool.rs:16:5 |
| 1 | +error[E0277]: the trait bound `&str: __private::not::Bool` is not satisfied |
| 2 | + --> tests/ui/ensure-nonbool.rs:25:13 |
3 | 3 | |
|
4 |
| -16 | ensure!("..."); |
5 |
| - | ^^^^^^^^^^^^^^ cannot apply unary operator `!` |
| 4 | +25 | ensure!("..."); |
| 5 | + | --------^^^^^- |
| 6 | + | | | |
| 7 | + | | the trait `__private::not::Bool` is not implemented for `&str` |
| 8 | + | required by a bound introduced by this call |
6 | 9 | |
|
7 |
| - = note: this error originates in the macro `$crate::__fallback_ensure` which comes from the expansion of the macro `ensure` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 10 | + = help: the following other types implement trait `__private::not::Bool`: |
| 11 | + &bool |
| 12 | + bool |
| 13 | +note: required by a bound in `anyhow::__private::not` |
| 14 | + --> src/lib.rs |
| 15 | + | |
| 16 | + | pub fn not(cond: impl Bool) -> bool { |
| 17 | + | ^^^^ required by this bound in `not` |
8 | 18 |
|
9 |
| -error[E0600]: cannot apply unary operator `!` to type `&mut bool` |
10 |
| - --> tests/ui/ensure-nonbool.rs:20:23 |
| 19 | +error[E0277]: the trait bound `&mut bool: __private::not::Bool` is not satisfied |
| 20 | + --> tests/ui/ensure-nonbool.rs:29:31 |
| 21 | + | |
| 22 | +29 | Bool(cond) => ensure!(cond), |
| 23 | + | --------^^^^- |
| 24 | + | | | |
| 25 | + | | the trait `__private::not::Bool` is not implemented for `&mut bool` |
| 26 | + | required by a bound introduced by this call |
11 | 27 | |
|
12 |
| -20 | Bool(cond) => ensure!(cond), |
13 |
| - | ^^^^^^^^^^^^^ cannot apply unary operator `!` |
| 28 | + = help: the following other types implement trait `__private::not::Bool`: |
| 29 | + &bool |
| 30 | + bool |
| 31 | + = note: `__private::not::Bool` is implemented for `&bool`, but not for `&mut bool` |
| 32 | +note: required by a bound in `anyhow::__private::not` |
| 33 | + --> src/lib.rs |
14 | 34 | |
|
15 |
| - = note: this error originates in the macro `$crate::__fallback_ensure` which comes from the expansion of the macro `ensure` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 35 | + | pub fn not(cond: impl Bool) -> bool { |
| 36 | + | ^^^^ required by this bound in `not` |
16 | 37 |
|
17 |
| -error[E0600]: cannot apply unary operator `!` to type `DerefBool` |
18 |
| - --> tests/ui/ensure-nonbool.rs:24:5 |
| 38 | +error[E0277]: the trait bound `DerefBool: __private::not::Bool` is not satisfied |
| 39 | + --> tests/ui/ensure-nonbool.rs:33:13 |
19 | 40 | |
|
20 |
| -24 | ensure!(db); |
21 |
| - | ^^^^^^^^^^^ cannot apply unary operator `!` |
| 41 | +33 | ensure!(db); |
| 42 | + | --------^^- |
| 43 | + | | | |
| 44 | + | | the trait `__private::not::Bool` is not implemented for `DerefBool` |
| 45 | + | required by a bound introduced by this call |
22 | 46 | |
|
23 |
| -note: an implementation of `Not` might be missing for `DerefBool` |
24 |
| - --> tests/ui/ensure-nonbool.rs:6:1 |
| 47 | + = help: the following other types implement trait `__private::not::Bool`: |
| 48 | + &bool |
| 49 | + bool |
| 50 | +note: required by a bound in `anyhow::__private::not` |
| 51 | + --> src/lib.rs |
| 52 | + | |
| 53 | + | pub fn not(cond: impl Bool) -> bool { |
| 54 | + | ^^^^ required by this bound in `not` |
| 55 | + |
| 56 | +error[E0277]: the trait bound `&DerefBool: __private::not::Bool` is not satisfied |
| 57 | + --> tests/ui/ensure-nonbool.rs:34:13 |
25 | 58 | |
|
26 |
| -6 | struct DerefBool(bool); |
27 |
| - | ^^^^^^^^^^^^^^^^ must implement `Not` |
28 |
| -note: the trait `Not` must be implemented |
29 |
| - --> $RUST/core/src/ops/bit.rs |
| 59 | +34 | ensure!(&db); |
| 60 | + | --------^^^- |
| 61 | + | | | |
| 62 | + | | the trait `__private::not::Bool` is not implemented for `&DerefBool` |
| 63 | + | required by a bound introduced by this call |
30 | 64 | |
|
31 |
| - | pub trait Not { |
32 |
| - | ^^^^^^^^^^^^^ |
33 |
| - = note: this error originates in the macro `$crate::__fallback_ensure` which comes from the expansion of the macro `ensure` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 65 | +note: required by a bound in `anyhow::__private::not` |
| 66 | + --> src/lib.rs |
| 67 | + | |
| 68 | + | pub fn not(cond: impl Bool) -> bool { |
| 69 | + | ^^^^ required by this bound in `not` |
| 70 | +help: consider dereferencing here |
| 71 | + | |
| 72 | +34 | ensure!(&*db); |
| 73 | + | + |
34 | 74 |
|
35 |
| -error[E0600]: cannot apply unary operator `!` to type `&DerefBool` |
36 |
| - --> tests/ui/ensure-nonbool.rs:25:5 |
| 75 | +error[E0277]: the trait bound `NotBool: __private::not::Bool` is not satisfied |
| 76 | + --> tests/ui/ensure-nonbool.rs:37:13 |
| 77 | + | |
| 78 | +37 | ensure!(nb); |
| 79 | + | --------^^- |
| 80 | + | | | |
| 81 | + | | the trait `__private::not::Bool` is not implemented for `NotBool` |
| 82 | + | required by a bound introduced by this call |
37 | 83 | |
|
38 |
| -25 | ensure!(&db); |
39 |
| - | ^^^^^^^^^^^^ cannot apply unary operator `!` |
| 84 | + = help: the following other types implement trait `__private::not::Bool`: |
| 85 | + &bool |
| 86 | + bool |
| 87 | +note: required by a bound in `anyhow::__private::not` |
| 88 | + --> src/lib.rs |
40 | 89 | |
|
41 |
| - = note: this error originates in the macro `$crate::__fallback_ensure` which comes from the expansion of the macro `ensure` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 90 | + | pub fn not(cond: impl Bool) -> bool { |
| 91 | + | ^^^^ required by this bound in `not` |
0 commit comments