You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use if <cond> {} else { <then> } instead of if !<cond> { <then> }
This approach works on *every* edition and emits the desired output consistently:
```
error[E0308]: mismatched types
--> $DIR/issue-28308.rs:6:13
|
LL | assert!("foo");
| ^^^^^ expected `bool`, found `&str`
```
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/post_monomorphization_error_backtrace.rs:6:23
5
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/post_monomorphization_error_backtrace.rs:6:23
6
6
|
7
7
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
8
8
@@ -19,10 +19,10 @@ LL | assert_zst::<U>()
19
19
| ^^^^^^^^^^^^^^^^^
20
20
21
21
error[E0080]: evaluation of `assert_zst::F::<i32>::V` failed
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/post_monomorphization_error_backtrace.rs:6:23
25
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/post_monomorphization_error_backtrace.rs:6:23
26
26
|
27
27
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/const-expr-generic-err.rs:4:13
5
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/const-expr-generic-err.rs:4:13
6
6
|
7
7
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
0 commit comments