about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2019-10-05Rollup merge of #64708 - SimonSapin:option-deref, r=CentrilTyler Mandry-6/+2
Stabilize `Option::as_deref` and `Option::as_deref_mut` The tracking issue https://github.com/rust-lang/rust/issues/50264 still has unresolved question for the corresponding `Result` methods.
2019-10-05Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, ↵Tyler Mandry-18/+54
r=alexcrichton" This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-04Allow unused attributes to avoid incremental bugMark Rousskov-0/+2
2019-10-04make is_power_of_two a const functionTrevor Spiteri-2/+2
2019-10-04Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-54/+18
- Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the incorrect wasm32 C call ABI with the old asmjs version, which is correct for both wasm32 and JS. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Temporarily makes Emscripten targets use panic=abort by default because supporting unwinding will require an LLVM patch.
2019-10-03Rollup merge of #61879 - stjepang:stabilize-todo, r=withoutboatsTyler Mandry-6/+10
Stabilize todo macro The `todo!` macro is just another name for `unimplemented!`. Tracking issue: https://github.com/rust-lang/rust/issues/59277 This PR needs a FCP to merge. r? @withoutboats
2019-10-03Reorder methods of CellShotaro Yamada-46/+46
To make `new` method appear first in documentation.
2019-10-03Rollup merge of #64941 - lzutao:inline-max_min_value, r=nnethercoteMazdak Farrokhzad-4/+4
Inline `{min,max}_value` even in debug builds I think it is worth to inline `{min,max}_value` even in debug builds. See this godbolt link: https://godbolt.org/z/-COkVS
2019-10-02Always inline `mem::{size_of,align_of}` in debug buildsLzu Tao-2/+2
Those two are const fn and do not have any arguments. Inlining helps reducing generated code size in debug builds.
2019-10-02Inline `ptr::null(_mut)` even in debug buildsLzu Tao-2/+2
2019-10-01Rollup merge of #64885 - andjo403:iter, r=scottmcmTyler Mandry-13/+14
use try_fold instead of try_for_each to reduce compile time as it was stated in #64572 that the biggest gain was due to less code was generated I tried to reduce the number of functions to inline by using try_fold direct instead of calling try_for_each that calls try_fold. as there is some gains with using the try_fold function this is maybe a way forward. when I tried to compile the clap-rs benchmark I get times gains only some % from #64572 there is more function that use eg. fold that calls try_fold that also can be changed but the question is how mush "duplication" that is tolerated in std to give faster compile times can someone start a perf run? cc @nnethercote @scottmcm @bluss r? @ghost
2019-10-01Rollup merge of #64943 - lzutao:doc-saturating, r=shepmasterMazdak Farrokhzad-3/+6
Add lower bound doctests for `saturating_{add,sub}` signed ints Closes #64940
2019-10-01Rollup merge of #64912 - lzutao:unneeded-main-doc, r=jonas-schievinkMazdak Farrokhzad-121/+93
Remove unneeded `fn main` blocks from docs ## [No whitespace diff](https://github.com/rust-lang/rust/pull/64912/files?w=1)
2019-10-01Remove unneeded `fn main` blocks from docsLzu Tao-121/+93
2019-10-01replace try_for_each with try_fold to generate less codeAndreas Jonson-13/+14
removes two functions to inline by combining the check functions and extra call to try_for_each
2019-10-01Add lower bound doctests for `saturating_{add,sub}` signed intsLzu Tao-3/+6
2019-10-01Inline `{min,max}_value` even in debug buildsLzu Tao-4/+4
2019-09-30Rollup merge of #64923 - lzutao:improve-doc-needs_drop, r=jonas-schievinkTyler Mandry-4/+6
Add missing links for mem::needs_drop r? @jonas-schievink
2019-09-30Rollup merge of #64911 - hman523:64844, r=Dylan-DPCTyler Mandry-1/+1
Fixed a misleading documentation issue #64844 Made the suggested change from @steveklabnik on issue #64844
2019-09-30Add missing links for mem::needs_dropLzu Tao-4/+6
2019-09-30Auto merge of #64600 - scottmcm:no-slice-tryfold-unroll, r=blussbors-68/+1
Remove manual unrolling from slice::Iter(Mut)::try_fold While this definitely helps sometimes (particularly for trivial closures), it's also a pessimization sometimes, so it's better to leave this to (hypothetical) future LLVM improvements instead of forcing this on everyone. I think it's better for the advice to be that sometimes you need to unroll manually than you sometimes need to not-unroll manually (like #64545). --- For context see https://github.com/rust-lang/rust/pull/64572#issuecomment-532961046
2019-09-30Fixed a misleading documentation issue #64844hman523-1/+1
2019-09-28Rollup merge of #64837 - nliberg:patch-2, r=CentrilMazdak Farrokhzad-6/+6
Improve wording in documentation of MaybeUninit Changes > variables are properly initialized **at** their respective type into > variables are properly initialized **as** their respective type
2019-09-28Improve wording in documentation of MaybeUninitNils Liberg-6/+6
2019-09-27pin.rs: fix links to primitives in documentationrusty-snake-0/+2
2019-09-26Auto merge of #62661 - arielb1:never-reserve, r=nikomatsakisbors-0/+12
reserve `impl<T> From<!> for T` this is necessary for never-type stabilization. cc #57012 #35121 I think we wanted a crater run for this @nikomatsakis? r? @nikomatsakis
2019-09-25address rebase damageAriel Ben-Yehuda-1/+1
2019-09-25Rollup merge of #64764 - Mark-Simulacrum:snap, r=CentrilMazdak Farrokhzad-92/+11
Master is now 1.40 r? @pietroalbini
2019-09-25Rollup merge of #64386 - tspiteri:const-abs2, r=oli-obkMazdak Farrokhzad-3/+26
use `sign` variable in abs and wrapping_abs methods This also makes the code easier to understand by hinting at the significance of `self >> ($BITS - 1)`. Also, now `overflowing_abs` simply uses `wrapping_abs`, which is clearer and avoids a potential performance regression in the LLVM IR. This PR follows from the discussion from #63786. r? @eddyb cc @nikic
2019-09-25Snap cfgs to new betaMark Rousskov-92/+11
2019-09-24Rollup merge of #64717 - andrewbanchich:master, r=joshtriplettMazdak Farrokhzad-3/+3
update mem::discriminant test to use assert_eq and assert_ne over comparison operators Use assert_eq and assert_ne over comparison operators.
2019-09-24Rollup merge of #64296 - KodrAus:chore/iter_order_by, r=CentrilMazdak Farrokhzad-3/+3
Document the unstable iter_order_by library feature Tracking issue: #64295 Follow-up for: #62205 References the tracking issue and adds a page to the unstable book for the new unstable `iter_order_by` feature.
2019-09-24add a rustdoc comment to the reservation implNiko Matsakis-0/+5
2019-09-24nit: update error text to cite tracking issueNiko Matsakis-6/+2
2019-09-24add error message for caseAriel Ben-Yehuda-1/+6
2019-09-24reserve `impl<T> From<!> for T`Ariel Ben-Yehuda-0/+6
this is necessary for never-type stabilization
2019-09-24Stabilize `str::len`, `[T]::len`, `is_empty` and `str::as_bytes` as const fnOliver Scherer-8/+12
2019-09-23Just delete the overrides now that they match the default implementationsScott McMurray-62/+1
2019-09-23update testAndrew Banchich-3/+3
Use assert_eq and assert_ne over comparison operators.
2019-09-23Fix rebase conflictsAlex Crichton-1/+1
2019-09-23Move `--cfg bootstrap` out of `rustc.rs`Alex Crichton-33/+33
Instead let's do this via `RUSTFLAGS` in `builder.rs`. Currently requires a submodule update of `stdarch` to fix a problem with previous compilers.
2019-09-23Stabilize Option::deref and Option::deref_mutSimon Sapin-6/+2
The tracking issue https://github.com/rust-lang/rust/issues/50264 still has unresolved question for the corresponding `Result` methods.
2019-09-21Remove manual unrolling from slice::Iter(Mut)::try_foldScott McMurray-13/+7
While this definitely helps sometimes (particularly for trivial closures), it's also a pessimization sometimes, so it's better to leave this to (hypothetical) future LLVM improvements instead of forcing this on everyone. I think it's better for the advice to be that sometimes you need to unroll manually than you sometimes need to not-unroll manually (like #64545).
2019-09-21Rollup merge of #64641 - cuviper:extern-rust-ctypes, r=estebankMazdak Farrokhzad-1/+1
Exempt extern "Rust" from improper_ctypes It should be fine for Rust ABIs to involve any Rust type. Fixes #64593.
2019-09-21Auto merge of #64047 - timvermeulen:cmp_min_max_by, r=cuviperbors-34/+129
Add `cmp::{min_by, min_by_key, max_by, max_by_key}` This adds the following functions to `core::cmp`: - `min_by` - `min_by_key` - `max_by` - `max_by_key` `min_by` and `max_by` are somewhat trivial to implement, but not entirely because `min_by` returns the first value in case the two are equal (and `max_by` the second). `min` and `max` can be implemented in terms of `min_by` and `max_by`, but not as easily the other way around. To give an example of why I think these functions could be useful: the `Iterator::{min_by, min_by_key, max_by, max_by_key}` methods all currently hard-code the behavior mentioned above which is an ever so small duplication of logic. If we delegate them to `cmp::{min_by, max_by}` methods instead, we get the correct behavior for free. (edit: this is now included in the PR) I added `min_by_key` / `max_by_key` for consistency's sake but I wouldn't mind removing them. I don't have a particular use case in mind for them, and `min_by` / `max_by` seem to be more useful. Tracking issue: #64460
2019-09-20Exempt extern "Rust" from improper_ctypesJosh Stone-1/+1
It should be fine for Rust ABIs to involve any Rust type.
2019-09-18Rollup merge of #64348 - arnohaase:pr_documentation_spin_loop_hint, ↵Tyler Mandry-29/+20
r=alexcrichton PR: documentation spin loop hint The documentation for 'spin loop hint' explains that yield is better if the lock holder is running on the same CPU. I suggest that 'CPU or core' would be clearer.
2019-09-18broken hyperlinks in documentationArno Haase-2/+2
2019-09-18doc: Format some primitives examplesLzu Tao-12/+18
2019-09-17Rollup merge of #64529 - taiki-e:docs-pin-as-mut, r=RalfJungTyler Mandry-0/+21
Add an example to Pin::as_mut https://github.com/taiki-e/pin-project/issues/89#issuecomment-531701172 r? @RalfJung