rust/library/core/src
bors 8cb207ae69 Auto merge of #86386 - inquisitivecrystal:better-errors-for-display-traits-v3, r=estebank
Better errors for Debug and Display traits

Currently, if someone tries to pass value that does not implement `Debug` or `Display` to a formatting macro, they get a very verbose and confusing error message. This PR changes the error messages for missing `Debug` and `Display` impls to be less overwhelming in this case, as suggested by #85844. I was a little less aggressive in changing the error message than that issue proposed. Still, this implementation would be enough to reduce the number of messages to be much more manageable.

After this PR, information on the cause of an error involving a `Debug` or `Display` implementation would suppressed if the requirement originated within a standard library macro. My reasoning was that errors originating from within a macro are confusing when they mention details that the programmer can't see, and this is particularly problematic for `Debug` and `Display`, which are most often used via macros. It is possible that either a broader or a narrower criterion would be better. I'm quite open to any feedback.

Fixes #85844.
2021-06-23 03:16:04 +00:00
..
alloc Fix const stability since versions. 2021-03-15 14:39:18 +00:00
array Add doc(hidden) to all __iterator_get_unchecked 2021-06-16 22:08:44 -07:00
char Auto merge of #85630 - gilescope:to_digit_speedup3, r=nagisa 2021-06-10 23:14:11 +00:00
convert Get rid of "[+] show undocumented items" toggle on numeric From impls 2021-04-22 11:51:05 -07:00
fmt Change Debug unimplemented message per request 2021-06-22 00:38:31 -07:00
future remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
hash Auto merge of #83390 - clarfonthey:hasher_docs, r=Amanieu 2021-04-26 08:21:55 +00:00
iter Add comments around code where ordering is important due for panic-safety 2021-06-22 19:06:55 +02:00
macros fix matches! and assert_matches! on edition 2021 2021-05-25 16:44:20 +02:00
mem Rollup merge of #86220 - est31:maybe-uninit-extra, r=RalfJung 2021-06-15 17:40:10 +09:00
num Auto merge of #84910 - eopb:stabilize_int_error_matching, r=yaahc 2021-06-22 09:30:15 +00:00
ops Rollup merge of #85608 - scottmcm:stabilize-control-flow-enum-basics, r=m-ou-se 2021-06-15 17:40:08 +09:00
prelude Stabilize {std, core}::prelude::rust_*. 2021-06-14 14:44:50 +00:00
ptr Typo correction: s/is/its 2021-06-16 19:20:15 +03:00
slice Auto merge of #86383 - shamatar:slice_len_lowering, r=bjorn3 2021-06-21 22:24:13 +00:00
str Add doc(hidden) to all __iterator_get_unchecked 2021-06-16 22:08:44 -07:00
stream Remove Stream::next 2021-01-23 16:54:56 +01:00
sync Stabilize atomic_fetch_update methods on AtomicBool and AtomicPtr. 2021-04-11 11:45:46 +02:00
task #[cfg(bootstrap)] out the v1 try_trait stuff 2021-05-19 13:32:15 -07:00
unicode Add a check for ASCII characters in to_upper and to_lower 2021-02-26 11:39:36 -06:00
any.rs Change the Debug impl of Any and UnsafeCell to use finish_non_exhaustive 2021-04-21 14:51:04 +02:00
ascii.rs Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
bool.rs Stabilise then 2020-11-22 13:45:14 +00:00
borrow.rs Fix borrow and deref 2021-03-03 11:23:29 +01:00
cell.rs Rollup merge of #86453 - akiselev:patch-1, r=dtolnay 2021-06-19 10:14:15 +09:00
clone.rs Updates Clone docs for Copy comparison. 2021-06-10 11:28:26 -04:00
cmp.rs Rollup merge of #85637 - RalfJung:partial-ord, r=m-ou-se 2021-06-21 09:42:13 +09:00
default.rs Add diagnostic item to Default trait 2021-03-04 10:14:48 -08:00
ffi.rs Replace all fmt.pad with debug_struct 2021-04-21 14:38:24 +02:00
hint.rs Auto merge of #84725 - sebpop:arm64-isb, r=joshtriplett 2021-05-02 04:54:31 +00:00
internal_macros.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
intrinsics.rs Revert PRs 81238 and 82967 (which made copy and copy_nonoverlapping intrinsics). 2021-06-04 16:44:28 -04:00
lazy.rs Capitalize safety comments 2020-09-08 22:26:44 -04:00
lib.rs stabilize int_error_matching 2021-06-14 09:58:32 +01:00
marker.rs Add additional migrations to handle auto-traits and clone traits 2021-05-06 14:17:59 -04:00
option.rs fix typo in option doc 2021-06-10 22:30:00 -05:00
panic.rs Implement new panic!() behaviour for Rust 2021. 2021-01-25 13:48:11 +01:00
panicking.rs Fix panic message of assert_failed_inner 2021-03-13 18:50:43 +08:00
pin.rs Fix overlength lines in core::pin. 2021-01-05 20:14:02 +01:00
primitive.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
raw.rs Deprecate the core::raw / std::raw module 2021-04-15 02:32:33 +02:00
result.rs #[cfg(bootstrap)] out the v1 try_trait stuff 2021-05-19 13:32:15 -07:00
time.rs Rollup merge of #82179 - mbartlett21:patch-5, r=joshtriplett 2021-06-15 17:40:03 +09:00
tuple.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
unit.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00