rust/library
bors b531630f42 Auto merge of #111071 - nyurik:simpler-issue-94005, r=m-ou-se
Cleaner assert_eq! & assert_ne! panic messages

This PR finishes refactoring of the assert messages per #94005. The panic message format change #112849 used to be part of this PR, but has been factored out and just merged. It might be better to keep both changes in the same release once FCP vote completes.

Modify panic message for `assert_eq!`, `assert_ne!`, the currently unstable `assert_matches!`, as well as the corresponding `debug_assert_*` macros.

```rust
assert_eq!(1 + 1, 3);
assert_eq!(1 + 1, 3, "my custom message value={}!", 42);
```

#### Old messages
```plain
thread 'main' panicked at $DIR/main.rs:6:5:
assertion failed: `(left == right)`
  left: `2`,
 right: `3`
```
```plain
thread 'main' panicked at $DIR/main.rs:6:5:
assertion failed: `(left == right)`
  left: `2`,
 right: `3`: my custom message value=42!
```

#### New messages
```plain
thread 'main' panicked at $DIR/main.rs:6:5:
assertion `left == right` failed
  left: 2
 right: 3
```

```plain
thread 'main' panicked at $DIR/main.rs:6:5:
assertion `left == right` failed: my custom message value=42!
  left: 2
 right: 3
```

History of fixing #94005
* #94016 was a lengthy PR that was abandoned
* #111030 was similar, but it stringified left and right arguments, and thus caused compile time performance issues, thus closed
* #112849 factored out the two-line formatting of all panic messages

Fixes #94005

r? `@m-ou-se`
2023-08-15 22:45:57 +00:00
..
alloc Auto merge of #112387 - clarfonthey:non-panicking-ceil-char-boundary, r=m-ou-se 2023-08-15 13:49:24 +00:00
backtrace@e1c49fbd61 Update std to backtrace 0.3.68 2023-07-02 17:02:45 -07:00
core Auto merge of #111071 - nyurik:simpler-issue-94005, r=m-ou-se 2023-08-15 22:45:57 +00:00
panic_abort Add internal_features lint 2023-08-03 14:50:50 +02:00
panic_unwind stabilize abi_thiscall 2023-08-07 14:11:03 +02:00
portable-simd remove repetitive words 2023-07-31 16:13:02 +08:00
proc_macro Add internal_features lint 2023-08-03 14:50:50 +02:00
profiler_builtins Rollup merge of #114069 - cuviper:profiler-path, r=Mark-Simulacrum 2023-08-13 21:00:45 +02:00
rtstartup Remove custom frame info registration on i686-pc-windows-gnu 2022-08-23 16:12:58 +08:00
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #114619 - g0djan:godjan/fix_#114608, r=m-ou-se 2023-08-15 20:34:23 +02:00
stdarch@d77878b729 Bump stdarch 2023-06-13 21:45:04 -07:00
sysroot Expose compiler-builtins-weak-intrinsics feature for -Zbuild-std 2023-06-23 11:15:34 +01:00
test Rollup merge of #114377 - Enselic:test_get_dbpath_for_term-utf-8, r=thomcc 2023-08-09 22:59:58 +02:00
unwind add a csky-unknown-linux-gnuabiv2 target 2023-08-14 23:02:36 +08:00