rust/src/libcore
Mazdak Farrokhzad 0ed894afae
Rollup merge of #57815 - dotdash:asserts, r=sfackler
Speed up the fast path for assert_eq! and assert_ne!

Currently, the panic!() calls directly borrow the value bindings. This
causes those bindings to always be initialized, i.e. they're initialized
even before the values are even compared. This causes noticeable
overhead in what should be a really cheap operation.

By performing a reborrow of the value in the call to panic!(), we allow
LLVM to optimize that code, so that the extra borrow only happens in the
error case.

We could achieve the same result by dereferencing the values passed to
panic!(), as the format machinery borrows them anyway, but this causes
assertions to fail to compile if one of the values is unsized, i.e. it
would be a breaking change.
2019-02-13 04:36:56 +01:00
..
benches Add fmt benchmarks 2019-01-12 01:54:57 +09:00
char Auto merge of #58051 - SimonSapin:str_escape, r=alexcrichton 2019-02-12 23:30:16 +00:00
fmt libs: doc comments 2019-02-10 23:57:25 +00:00
future libs: doc comments 2019-02-10 23:57:25 +00:00
hash libs: doc comments 2019-02-10 23:57:25 +00:00
iter libs: doc comments 2019-02-10 23:57:25 +00:00
num Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik 2019-02-12 19:09:24 +00:00
ops Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik 2019-02-12 19:09:24 +00:00
prelude Remove licenses 2018-12-25 21:08:33 -07:00
slice libs: doc comments 2019-02-10 23:57:25 +00:00
str Auto merge of #58051 - SimonSapin:str_escape, r=alexcrichton 2019-02-12 23:30:16 +00:00
sync Add suggestions to deprecation lints 2019-01-30 17:49:04 +01:00
task libs: doc comments 2019-02-10 23:57:25 +00:00
tests libs: doc comments 2019-02-10 23:57:25 +00:00
unicode Remove licenses 2018-12-25 21:08:33 -07:00
alloc.rs tests: doc comments 2019-02-10 23:42:32 +00:00
any.rs tests: doc comments 2019-02-10 23:42:32 +00:00
array.rs Remove licenses 2018-12-25 21:08:33 -07:00
ascii.rs Remove licenses 2018-12-25 21:08:33 -07:00
borrow.rs Remove licenses 2018-12-25 21:08:33 -07:00
Cargo.toml std: Depend directly on crates.io crates 2018-12-11 21:08:22 -08:00
cell.rs libs: doc comments 2019-02-10 23:57:25 +00:00
clone.rs Auto merge of #57125 - doitian:inconsistent-clone-doc, r=bluss 2019-01-01 20:50:13 +00:00
cmp.rs tests: doc comments 2019-02-10 23:42:32 +00:00
convert.rs Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik 2019-02-12 19:09:24 +00:00
default.rs libs: doc comments 2019-02-10 23:57:25 +00:00
ffi.rs libs: doc comments 2019-02-10 23:57:25 +00:00
hint.rs libs: doc comments 2019-02-10 23:57:25 +00:00
internal_macros.rs Move str::escape_* to libcore 2019-02-12 09:55:30 +01:00
intrinsics.rs libs: doc comments 2019-02-10 23:57:25 +00:00
iter_private.rs Remove licenses 2018-12-25 21:08:33 -07:00
lib.rs Add internal impl_fn_for_zst macro for "named closure types" 2019-02-12 09:55:20 +01:00
macros.rs Rollup merge of #57815 - dotdash:asserts, r=sfackler 2019-02-13 04:36:56 +01:00
marker.rs Mark static generators as !Unpin 2019-01-27 22:58:59 +01:00
mem.rs libs: doc comments 2019-02-10 23:57:25 +00:00
option.rs libs: doc comments 2019-02-10 23:57:25 +00:00
panic.rs Remove licenses 2018-12-25 21:08:33 -07:00
panicking.rs Remove licenses 2018-12-25 21:08:33 -07:00
pin.rs libs: doc comments 2019-02-10 23:57:25 +00:00
ptr.rs libs: doc comments 2019-02-10 23:57:25 +00:00
raw.rs Remove licenses 2018-12-25 21:08:33 -07:00
result.rs libs: doc comments 2019-02-10 23:57:25 +00:00
time.rs libs: doc comments 2019-02-10 23:57:25 +00:00
tuple.rs Remove licenses 2018-12-25 21:08:33 -07:00
unit.rs Remove licenses 2018-12-25 21:08:33 -07:00