about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2019-07-25Auto merge of #60340 - mgeier:cap-vs-capacity, r=alexcrichtonbors-2/+2
Rename .cap() methods to .capacity() As mentioned in #60316, there are a few `.cap()` methods, which seem out-of-place because such methods are called `.capacity()` in the rest of the code. This PR renames them to `.capacity()` but leaves `RawVec::cap()` in there for backwards compatibility. I didn't try to mark the old version as "deprecated", because I guess this would cause too much noise.
2019-07-25Add note suggesting to borrow a String argument to findEsteban Küber-0/+4
2019-07-25Remove `cfg(bootstrap)` code for array implementationsLukas Kalbertodt-434/+241
In PR #62435 ("Use const generics for array impls [part 1]") the old macro-based implementations were not removed but still used with `cfg(bootstrap)` since the bootstrap compiler had some problems with const generics at the time. This does not seem to be the case anymore, so there is no reason to keep the old code.
2019-07-25Fix inconsistent highlight blocks.Tomasz Różański-7/+7
2019-07-25Auto merge of #62944 - RalfJung:miri, r=oli-obkbors-2/+0
bump Miri Fixes https://github.com/rust-lang/rust/issues/62919. r? @oli-obk
2019-07-24Stabilize the type_name intrinsic in core::anySteven Fackler-0/+26
Closes rust-lang/rfcs#1428
2019-07-25Rollup merge of #62814 - androm3da:hexagon_19jul_2019, r=alexcrichtonMazdak Farrokhzad-0/+1
add support for hexagon-unknown-linux-musl
2019-07-24re-enable debug checks in MiriRalf Jung-2/+0
2019-07-24Rollup merge of #62926 - Smibu:fix-typo, r=jonas-schievinkMazdak Farrokhzad-1/+1
Fix typo in mem::uninitialized doc
2019-07-24Rollup merge of #62716 - RalfJung:unsafe-cell, r=CentrilMazdak Farrokhzad-2/+3
state also in the intro that UnsafeCell has no effect on &mut Just to be extra sure.
2019-07-24Rollup merge of #62641 - cuviper:unicode-12.1, r=matkladMazdak Farrokhzad-739/+770
Regenerate character tables for Unicode 12.1
2019-07-24syntax_ext: Turn `#[global_allocator]` into a regular attribute macroVadim Petrochenkov-0/+7
2019-07-24Fix typo in mem::uninitialized docMika Lehtinen-1/+1
2019-07-23Auto merge of #62902 - Mark-Simulacrum:rollup-mxfk0mm, r=Mark-Simulacrumbors-7/+21
Rollup of 14 pull requests Successful merges: - #60951 (more specific errors in src/librustc/mir/interpret/error.rs) - #62523 (Delay bug to resolve HRTB ICE) - #62656 (explain how to search in slice without owned data) - #62791 (Handle more cases of typos misinterpreted as type ascription) - #62804 (rustc_typeck: improve diagnostics for _ const/static declarations) - #62808 (Revert "Disable stack probing for gnux32.") - #62817 (Tweak span for variant not found error) - #62842 (Add tests for issue-58887) - #62851 (move unescape module to rustc_lexer) - #62859 (Place::as_place_ref is now Place::as_ref) - #62869 (add rustc_private as a proper language feature gate) - #62880 (normalize use of backticks in compiler messages for librustc_allocator) - #62885 (Change "OSX" to "macOS") - #62889 (Update stage0.txt) Failed merges: r? @ghost
2019-07-23Rollup merge of #62869 - matklad:feature-gate, r=Mark-SimulacrumMark Rousskov-7/+12
add rustc_private as a proper language feature gate At the moment, `rustc_private` as a (library) feature exists by accident: `char::is_xid_start`, `char::is_xid_continue` methods in libcore define it. cc https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F I don't know if this is at all reasonable, but at least tests seem to pass locally. That probably means that we can remove/rename to something more resonable the feature in libcore in the next release?
2019-07-23Rollup merge of #62656 - RalfJung:contains-no-own, r=Dylan-DPCMark Rousskov-0/+9
explain how to search in slice without owned data Cc https://github.com/rust-lang/rust/issues/62367
2019-07-23Auto merge of #62823 - RalfJung:miri, r=oli-obkbors-0/+2
update Miri Fixes https://github.com/rust-lang/rust/issues/62802 r? @oli-obk @eddyb
2019-07-22add support for hexagon-unknown-linux-muslBrian Cain-0/+1
2019-07-22Rollup merge of #62799 - RalfJung:uninit-array, r=CentrilMazdak Farrokhzad-7/+29
use const array repeat expressions for uninit_array With a first implementation of https://github.com/rust-lang/rust/issues/49147 having landed, we can make this macro nicer and phase it out with the next bootstrap bump. However, to make this work, we have to mark `MaybeUninit::uninit()` as promotable. I do feel uneasy about promoting stuff involving uninitialized memory, but OTOH no *operation* on `MaybeUninit` is promotable, so maybe this is okay? r? @oli-obk @eddyb
2019-07-22Rollup merge of #62788 - ↵Mazdak Farrokhzad-2/+2
fakenine:normalize_use_of_backticks_compiler_messages_p9, r=Centril normalize use of backticks in compiler messages for libcore/ptr https://github.com/rust-lang/rust/issues/60532
2019-07-22add rustc_private as a proper language feature gateAleksey Kladov-7/+12
At the moment, `rustc_private` as a (library) feature exists by accident: `char::is_xid_start`, `char::is_xid_continue` methods in libcore define it.
2019-07-22Rollup merge of #62746 - RalfJung:deprecated, r=KodrAusMazdak Farrokhzad-3/+4
do not use assume_init in std::io Cc https://github.com/rust-lang/rust/issues/62397
2019-07-22Rollup merge of #62713 - SimonSapin:cast, r=CentrilMazdak Farrokhzad-2/+2
Stabilize <*mut _>::cast and <*const _>::cast Fixes #60602. FCP: https://github.com/rust-lang/rust/issues/60602#issuecomment-511146402
2019-07-21tidy is being sillyRalf Jung-5/+2
2019-07-21fix commentLuca Barbieri-1/+1
2019-07-21use a const to hack around promotion limitationsRalf Jung-2/+9
2019-07-21disable overlapping check with Miri (does not work without intptrcast)Ralf Jung-0/+2
2019-07-21Expand comment on BorrowRef::newLuca Barbieri-2/+12
2019-07-19avoid uninit_array! macro where it is not neededRalf Jung-5/+4
2019-07-19use const array repeat expressions for uninit_arrayRalf Jung-7/+26
2019-07-19do not use mem::uninitialized in std::ioRalf Jung-3/+4
2019-07-18normalize use of backticks in compiler messages for libcore/ptrSamy Kacimi-2/+2
https://github.com/rust-lang/rust/issues/60532
2019-07-18Rollup merge of #62740 - lzutao:patch-2, r=alexcrichtonMark Rousskov-0/+1
Add missing link to Infallible in TryFrom doc
2019-07-18Rollup merge of #62728 - DutchGhost:fix-double-wording, r=jonas-schievinkMark Rousskov-3/+3
Fix repeated wording in slice documentation Changes `of the slice of the slice` to `of the slice` in the chunk- and friends documentation of slices
2019-07-18Fix clippy::len_zero warningsMateusz Mikuła-2/+2
2019-07-18Fix clippy::clone_on_copy warningsMateusz Mikuła-2/+2
2019-07-18Use DerefMutYuki Okushi-2/+2
2019-07-18renamed `inner_deref` feature's `deref*()` methods `as_deref*()` as per ↵Brad Gibson-54/+239
discussion https://github.com/rust-lang/rust/issues/50264
2019-07-17unconstify methodsnewpavlov-2/+2
2019-07-17stabilize duration_floatnewpavlov-20/+10
2019-07-17Refer to `add` method instead of `offset`Philipp Oppermann-2/+2
The `align_offset` method returns an `usize`, so using `add` makes more sense than using `offset`, which takes an `isize`.
2019-07-17Auto merge of #61339 - jridgewell:pointer-alignment, r=BurntSushibors-6/+3
Optimize pointer alignment in utf8 validation This uses (and reuses) the u8 arrays's inherent block alignment when checking whether the current index is block aligned. I initially thought that this would just move the expensive `align_offset` call out of the while loop and replace it with a subtraction and bitwise AND. But it appears this optimizes much better, too... before: https://rust.godbolt.org/z/WIPvWl after: https://rust.godbolt.org/z/-jBPoW ## Benchmarks https://github.com/jridgewell/faster-from_utf8/tree/pointer-alignment ``` test from_utf8_2_bytes_fast ... bench: 310 ns/iter (+/- 42) = 1290 MB/s test from_utf8_2_bytes_regular ... bench: 309 ns/iter (+/- 24) = 1294 MB/s test from_utf8_3_bytes_fast ... bench: 1,027 ns/iter (+/- 62) = 1168 MB/s test from_utf8_3_bytes_regular ... bench: 1,513 ns/iter (+/- 611) = 793 MB/s test from_utf8_4_bytes_fast ... bench: 1,788 ns/iter (+/- 26) = 1342 MB/s test from_utf8_4_bytes_regular ... bench: 1,907 ns/iter (+/- 181) = 1258 MB/s test from_utf8_all_bytes_fast ... bench: 3,463 ns/iter (+/- 97) = 1155 MB/s test from_utf8_all_bytes_regular ... bench: 4,083 ns/iter (+/- 89) = 979 MB/s test from_utf8_ascii_fast ... bench: 88 ns/iter (+/- 4) = 28988 MB/s test from_utf8_ascii_regular ... bench: 88 ns/iter (+/- 8) = 28988 MB/s test from_utf8_cyr_fast ... bench: 7,707 ns/iter (+/- 531) = 665 MB/s test from_utf8_cyr_regular ... bench: 8,202 ns/iter (+/- 135) = 625 MB/s test from_utf8_enwik8_fast ... bench: 1,135,756 ns/iter (+/- 84,450) = 8804 MB/s test from_utf8_enwik8_regular ... bench: 1,145,468 ns/iter (+/- 79,601) = 8730 MB/s test from_utf8_jawik10_fast ... bench: 12,723,844 ns/iter (+/- 473,247) = 785 MB/s test from_utf8_jawik10_regular ... bench: 13,384,596 ns/iter (+/- 666,997) = 747 MB/s test from_utf8_mixed_fast ... bench: 2,321 ns/iter (+/- 123) = 2081 MB/s test from_utf8_mixed_regular ... bench: 2,702 ns/iter (+/- 408) = 1788 MB/s test from_utf8_mostlyasc_fast ... bench: 249 ns/iter (+/- 10) = 14666 MB/s test from_utf8_mostlyasc_regular ... bench: 276 ns/iter (+/- 5) = 13231 MB/s ```
2019-07-17Optimize RefCell read borrowingLuca Barbieri-3/+3
Instead of doing two comparisons we can do only one with a bit of cleverness. LLVM currently can't do this optimization itself on x86-64.
2019-07-17Auto merge of #62596 - cuviper:expect_none, r=rkruppebors-6/+99
Add Option::expect_none(msg) and unwrap_none() These are `Option` analogues to `Result::expect_err` and `unwrap_err`.
2019-07-17Add missing link to Infallible in TryFrom doclzutao-0/+1
2019-07-17Override Cycle::try_foldTim Vermeulen-0/+42
2019-07-16found more repeated wordingDodo-2/+2
2019-07-16fix double wordingDodo-1/+1
2019-07-16state also in the intro that UnsafeCell has no effect on &mutRalf Jung-2/+3
2019-07-16Stabilize <*mut _>::cast and <*const _>::castSimon Sapin-2/+2
FCP: https://github.com/rust-lang/rust/issues/60602#issuecomment-511146402