about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2019-10-13Rollup merge of #65370 - Cerberuser:patch-1, r=jonas-schievinkMazdak Farrokhzad-5/+5
Add `dyn` to `Any` documentation I noticed that in documentation to `Any` trait the old trait object syntax is used, which could be confusing for newcomers, since we generally recommend using `dyn Trait` instead of just `Trait`. This PR changes the documentation comment, so that it uses `&dyn Any`, `&mut dyn Any` and `Box<dyn Any>`, correspondingly.
2019-10-13Rollup merge of #65336 - BO41:typo, r=petrochenkovMazdak Farrokhzad-1/+1
Fix typo in task::Waker fixes #65323 in `libstd/error.rs` there are a few mentions of `trait@Send` and `trait@Sync`. Are they wrong as well?
2019-10-13Rollup merge of #65312 - tspiteri:signed-sat-mul, r=dtolnayMazdak Farrokhzad-1/+1
improve performance of signed saturating_mul Reciprocal throughput is improved from 2.3 to 1.7. https://godbolt.org/z/ROMiX6 Fixes #65309.
2019-10-13Rollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichtonMazdak Farrokhzad-70/+92
Split non-CAS atomic support off into target_has_atomic_load_store This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s: * `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations). * ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS). cc #32976 r? @alexcrichton
2019-10-13Added code elementCerberuser-1/+1
Co-Authored-By: Jonas Schievink <jonasschievink@gmail.com>
2019-10-13Add `dyn` to `Any` documentationCerberuser-5/+5
I noticed that in documentation to `Any` trait the old trait object syntax is used, which could be confusing for newcomers, since we generally recommend using `dyn Trait` instead of just `Trait`. This PR changes the documentation comment, so that it uses `&dyn Any`, `&mut dyn Any` and `Box<dyn Any>`, correspondingly.
2019-10-13Rollup merge of #65339 - RalfJung:atomic-ordering, r=CentrilMazdak Farrokhzad-25/+27
do not reference LLVM for our concurrency memory model Fixes https://github.com/rust-lang/rust/issues/65282
2019-10-13Rollup merge of #65165 - BO41:char_docs, r=varkorMazdak Farrokhzad-63/+109
Improve docs on some char boolean methods simple revival of #61794 (also rustfmt on rest of file :) Documentation for `is_xid_start()` and `is_xid_continue()` couldn't be improved since both methods got remove from this repository r? @dtolnay cc @JohnCSimon
2019-10-12fix link targetsRalf Jung-12/+12
2019-10-12it's C++20Ralf Jung-7/+7
2019-10-12do not reference LLVM for our concurrency memory modelRalf Jung-25/+27
2019-10-12Fix typoBO41-1/+1
2019-10-12Improve docs on some char boolean methodsBO41-63/+109
2019-10-11improve performance of signed saturating_mulTrevor Spiteri-1/+1
Reciprocal throughput is improved from 2.3 to 1.7. https://godbolt.org/z/ROMiX6
2019-10-08Stabilize mem::take (mem_take)Jon Gjengset-6/+1
Tracking issue: https://github.com/rust-lang/rust/issues/61129
2019-10-08Split non-CAS atomic support off into target_has_atomic_load_storeAmanieu d'Antras-70/+92
2019-10-08Rollup merge of #65046 - sinkuu:cell_reorder, r=shepmasterMazdak Farrokhzad-46/+46
Make `Cell::new` method come first in documentation Methods to create a thing usually comes first in `std` documentation, and `Cell` has been an exception. Also, `T: Copy` specialized methods should not be on top of the page. (This had led me to miss that most of its methods are not bounded by `Copy`...)
2019-10-08Rollup merge of #64726 - andrewbanchich:unimplemented, r=rkruppeMazdak Farrokhzad-15/+32
rewrite documentation for unimplemented! to clarify use The current docs for `unimplemented!` seem to miss the point of this macro. > This can be useful if you are prototyping and are just looking to have your code type-check, or if you're implementing a trait that requires multiple methods, and you're only planning on using one of them. You could also return a `()` if you just want your code to type-check. I think `unimplemented!` is useful for when you want your program to exit when it reaches an unimplemented area. I rewrote the explanation and gave examples of both forms of this macro that I think clarify its use a little better.
2019-10-06rewrite documentation for unimplemented!Andrew Banchich-15/+32
2019-10-05Rollup merge of #65151 - tmandry:revert-emscripten-upgrade, r=tmandryTyler Mandry-18/+54
Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend" This change caused the runtime of the linux-asmjs builder to nearly double from 2+ hours to about 4 hours, which happens to be the bors timeout. (It made it in barely under 4 hours when it was merged.) This is causing timeouts on all new changes. This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-05Rollup merge of #65106 - Mark-Simulacrum:unused-attr-allow, r=CentrilTyler Mandry-0/+2
Allow unused attributes to avoid incremental bug cc #65023 This isn't labeled as fixing that issue because it's not really a fix, just a patch.
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-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-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.