about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2019-12-21Rollup merge of #67490 - Mark-Simulacrum:i-67371, r=Dylan-DPCMazdak Farrokhzad-0/+5
Document privacy of RangeInclusive fields Fixes #67371
2019-12-21Rollup merge of #67420 - lzutao:_val, r=CentrilMazdak Farrokhzad-2/+1
use _val to ignore parameter of any::type_name_of_val mem::drop does the same thing too.
2019-12-21use _val to ignore parameter of any::type_name_of_valLzu Tao-2/+1
2019-12-21Document privacy of RangeInclusive fieldsMark Rousskov-0/+5
2019-12-21Rollup merge of #67478 - brunobell:master, r=CentrilMazdak Farrokhzad-1/+1
Fix src/libcore/str/mod.rs doc comments Fix grammar in src/libcore/str/mod.rs doc comments. r? @steveklabnik
2019-12-21Rollup merge of #67462 - DutchGhost:const_slice_from_raw_parts, r=dtolnayMazdak Farrokhzad-2/+18
Make ptr::slice_from_raw_parts a const fn available under a feature flag A first step in the direction of https://github.com/rust-lang/rust/issues/67456 . This makes `ptr::slice_from_raw_parts` and `ptr::slice_from_raw_parts_mut` available as a const fn under a feature flag.
2019-12-21Fix src/libcore/str/mod.rs doc commentsBroono Lu-1/+1
2019-12-20Rollup merge of #67163 - TheSamsa:split-up-ptr-mod, r=Mark-SimulacrumMazdak Farrokhzad-1691/+1685
Split up ptr/mod.rs in libcore... ...one with implementation detail for const ptr and the other with mut ptr I am not sure if the "stable since 1.0.0" flags are the correct choice for the two additional mods. Also, is it necessary for them to be "pub"? If so, there should be a good description for them. Closes #66891
2019-12-20Make ptr::slice_from_raw_parts a const fn available under a feature flagDodo-2/+18
2019-12-19Rollup merge of #67436 - NieDzejkob:todo-stabilization-fix, r=alexcrichtonMark Rousskov-1/+1
Correct the todo! stabilization version None
2019-12-19Rollup merge of #67253 - elichai:2019-12-fmt, r=Dylan-DPCMark Rousskov-44/+76
Add more delegations to the fmt docs and add doctests HI, this is a continuation to #67021 I replaced the `Debug` example with one that use the `Debug*` helpers so that padding etc will work too. I also added asserts for the doctests as @RalfJung asked :) The only thing I left with the `write!` macro is the `Display` example as I didn't know if there's a better way to do that. r? @QuietMisdreavus
2019-12-19Correct the todo! stabilization versionJakub Kądziołka-1/+1
2019-12-19Split up ptr/mod.rs in libcore, one with implementation detail for const ptr ↵Christoph Schmidler-1691/+1685
and the other with mut ptr
2019-12-18Propagate cfg bootstrapMark Rousskov-513/+159
2019-12-16Rollup merge of #67349 - petertodd:2019-unsize-docs, r=CentrilMazdak Farrokhzad-1/+1
Minor: update Unsize docs for dyn syntax
2019-12-16Rollup merge of #67322 - lzutao:nonzero-use-self, r=joshtriplettMazdak Farrokhzad-3/+3
use Self alias in place of macros
2019-12-16Rollup merge of #67249 - ranma42:improve-starts-with-literal-char, r=BurntSushiMazdak Farrokhzad-15/+48
Improve code generated for `starts_with(<literal char>)` This PR includes two minor improvements to the code generated when checking for string prefix/suffix. The first commit simplifies the str/str operation, by taking advantage of the raw UTF-8 representation. The second commit replaces the current str/char matching logic with a char->str encoding and then the previous method. The resulting code should be equivalent in the generic case (one char is being encoded versus one char being decoded), but it becomes easy to optimize in the case of a literal char, which in most cases a developer might expect to be at least as simple as that of a literal string. This PR should fix #41993
2019-12-16Add benchmarks for `start_with` and `ends_with`Andrea Canciani-0/+44
2019-12-16Minor: update Unsize docs for dyn syntaxPeter Todd-1/+1
2019-12-16Rollup merge of #67317 - lcnr:type_name_docs, r=jonas-schievinkMazdak Farrokhzad-1/+1
fix type_name_of_val doc comment .
2019-12-16Rollup merge of #66771 - SimonSapin:panic-stability, r=KodrAusMazdak Farrokhzad-8/+10
Stabilize the `core::panic` module `std::panic` is already stable. `core::panic::PanicInfo` and `core::panic::Location` are stable and can be used through that path because of a bug in stability checking: #15702
2019-12-16Rollup merge of #66735 - SOF3:feature/str_strip, r=KodrAusMazdak Farrokhzad-1/+72
Add str::strip_prefix and str::strip_suffix Introduces a counterpart for `Path::strip_prefix` on `str`. This was also discussed in https://internals.rust-lang.org/t/pre-pr-path-strip-prefix-counterpart-in-str/11364/.
2019-12-16Rollup merge of #66570 - lzutao:stabilize-result-map_or, r=Dylan-DPCMazdak Farrokhzad-2/+1
stabilize Result::map_or r? @SimonSapin Closes #66293
2019-12-15Replace prints in fmt docs with assertsElichai Turkel-38/+64
2019-12-15use Self alias in place of macrosLzu Tao-3/+3
2019-12-15fix doc commentlcnr/Bastian Kauschke-1/+1
2019-12-15Set tracking issue for str_stripSOFe-2/+2
2019-12-15Rollup merge of #67305 - kappa:patch-1, r=jonas-schievinkMazdak Farrokhzad-1/+1
Doc typo
2019-12-14Doc typoAlex Kapranoff-1/+1
2019-12-14Auto merge of #67224 - nikomatsakis:revert-stabilization-of-never-type, ↵bors-16/+108
r=centril Revert stabilization of never type Fixes https://github.com/rust-lang/rust/issues/66757 I decided to keep the separate `never-type-fallback` feature gate, but tried to otherwise revert https://github.com/rust-lang/rust/pull/65355. Seemed pretty clean. ( cc @Centril, author of #65355, you may want to check this over briefly )
2019-12-14Revert "Stabilize the `never_type`, written `!`."Niko Matsakis-10/+10
This reverts commit 15c30ddd69d6cc3fffe6d304c6dc968a5ed046f1.
2019-12-14Revert "Redefine `core::convert::Infallible` as `!`."Niko Matsakis-7/+99
This reverts commit 089229a1935fa9795cfdefa518c8f8c3beb66db8.
2019-12-14Auto merge of #67136 - oli-obk:const_stability, r=Centrilbors-24/+463
Require stable/unstable annotations for the constness of all stable fns with a const modifier r? @RalfJung @Centril Every `#[stable]` const fn now needs either a `#[rustc_const_unstable]` attribute or a `#[rustc_const_stable]` attribute. You can't silently stabilize the constness of a function anymore.
2019-12-13Rollup merge of #67280 - shalzz:patch-1, r=jonas-schievinkMazdak Farrokhzad-1/+1
docs: std::convert::From: Fix typo Fix a minor typo
2019-12-13docs: std::convert::From: Fix typoShaleen Jain-1/+1
Fix a minor typo
2019-12-13The constness of 128 bit atomics will be stabilized together with the atomicsOliver Scherer-2/+2
2019-12-13be explicit that mem::uninitialized is the same as ↵Ralf Jung-1/+5
MaybeUninit::uninit().assume_init()
2019-12-13Address review commentsOliver Scherer-65/+0
2019-12-13Require stable/unstable annotations for the constness of all stable ↵Oliver Scherer-23/+527
functions with a `const` modifier
2019-12-13Reuse the `staged_api` feature for `rustc_const_unstable`Oliver Scherer-1/+1
2019-12-12Minor cleanup in `Pattern::{is_prefix_of,is_suffix_of}` for `char`Andrea Canciani-4/+2
2019-12-12Change fmt docs for more delegationsElichai Turkel-6/+12
2019-12-12Prefer encoding the char when checking for string prefix/suffixAndrea Canciani-10/+4
This enables constant folding when matching a literal char. Fixes #41993.
2019-12-12Rollup merge of #67237 - llogiq:improve-str, r=Dylan-DPCYuki Okushi-16/+6
Some small readability improvements
2019-12-11Improve `str` prefix/suffix comparisonAndrea Canciani-5/+2
The comparison can be performed on the raw bytes, as the chars can only match if their UTF8 encoding matches. This avoids the `is_char_boundary` checks and translates to a straight `u8` slice comparison which is optimized to a memcmp or inline comparison where appropriate.
2019-12-11Some small readability improvementsAndre Bogus-16/+6
2019-12-11Auto merge of #65345 - ↵bors-0/+2
davidtwco:issue-64130-async-send-sync-error-improvements, r=nikomatsakis async/await: improve not-send errors, part 2 Part of #64130. Fixes #65667. This PR improves the errors introduced in #64895 so that they have specialized messages for `Send` and `Sync`. r? @nikomatsakis
2019-12-11Rollup merge of #67174 - kraai:remove-checked_add, r=rkruppeMazdak Farrokhzad-2/+5
Remove `checked_add` in `Layout::repeat`
2019-12-11Rollup merge of #66881 - ↵Mazdak Farrokhzad-1/+19
krishna-veerareddy:issue-66780-bool-ord-optimization, r=sfackler Optimize Ord trait implementation for bool Casting the booleans to `i8`s and converting their difference into `Ordering` generates better assembly than casting them to `u8`s and comparing them. Fixes #66780 #### Comparison([Godbolt link](https://rust.godbolt.org/z/PjBpvF)) ##### Old assembly: ```asm example::boolean_cmp: mov ecx, edi xor ecx, esi test esi, esi mov eax, 255 cmove eax, ecx test edi, edi cmovne eax, ecx ret ``` ##### New assembly: ```asm example::boolean_cmp: mov eax, edi sub al, sil ret ``` ##### Old LLVM-MCA statistics: ``` Iterations: 100 Instructions: 800 Total Cycles: 234 Total uOps: 1000 Dispatch Width: 6 uOps Per Cycle: 4.27 IPC: 3.42 Block RThroughput: 1.7 ``` ##### New LLVM-MCA statistics: ``` Iterations: 100 Instructions: 300 Total Cycles: 110 Total uOps: 500 Dispatch Width: 6 uOps Per Cycle: 4.55 IPC: 2.73 Block RThroughput: 1.0 ```
2019-12-10Add better documentation for unsafe blockKrishna Sai Veera Reddy-1/+1