summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2020-05-04Allow the llvm_asm! shim to go unused on some archsJosh Stone-0/+1
2020-05-01Add a shim from llvm_asm! to asm! for stdarchJosh Stone-0/+5
2020-03-10Rollup merge of #69799 - TimDiekmann:zst, r=AmanieuMazdak Farrokhzad-43/+13
Allow ZSTs in `AllocRef` Allows ZSTs in all `AllocRef` methods. The implementation of `AllocRef` for `Global` and `System` were adjusted to reflect those changes. This is the second item on the roadmap to support ZSTs in `AllocRef`: https://github.com/rust-lang/wg-allocators/issues/38#issuecomment-595861542 After this has landed, I will adapt `RawVec`, but since this will be a pretty big overhaul, it makes sense to do a different PR for it. ~~Requires #69794 to land first~~ r? @Amanieu
2020-03-10Rollup merge of #69514 - GuillaumeGomez:remove-spotlight, r=kinnisonMazdak Farrokhzad-3/+0
Remove spotlight I had a few comments saying that this feature was at best misunderstood or not even used so I decided to organize a poll about on [twitter](https://twitter.com/imperioworld_/status/1232769353503956994). After 87 votes, the result is very clear: it's not useful. Considering the amount of code we have just to run it, I think it's definitely worth it to remove it. r? @kinnison cc @ollie27
2020-03-08Rollup merge of #69651 - Mark-Simulacrum:black-box-marker, r=eddybMazdak Farrokhzad-1/+11
Try to ensure usize marker does not get merged This follows up on [this conversation](https://github.com/rust-lang/rust/pull/69209#discussion_r379911282). However, I'm not confident this is quite correct, so feedback is appreciated, as always.
2020-03-08Allow ZSTs in `AllocRef`Tim Diekmann-43/+13
2020-03-07Rollup merge of #69797 - jongiddy:convert-version, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
Correct version that relaxed orphan rules Docs say > Prior to Rust 1.40, if the destination type was not part of the current crate then you couldn't implement From directly Version 1.41 of Rust introduced the change to the orphan rules - https://blog.rust-lang.org/2020/01/30/Rust-1.41.0.html#relaxed-restrictions-when-implementing-traits - so this should say > Prior to Rust 1.41...
2020-03-07Rollup merge of #69794 - TimDiekmann:dangling, r=AmanieuMazdak Farrokhzad-0/+16
Add `Layout::dangling()` to return a well-aligned `NonNull<u8>` Adds a convenient function to `Layout` to create a `NonNull<u8>` out of a layout to be returned on ZST allocations. This is the first item on the roadmap to support ZSTs in `AllocRef`: https://github.com/rust-lang/wg-allocators/issues/38#issuecomment-595861542 r? @Amanieu
2020-03-07Rollup merge of #69773 - matthiaskrgr:typos, r=petrochenkovMazdak Farrokhzad-15/+15
fix various typos
2020-03-07Correct version that relaxed orphan rulesJonathan Giddy-1/+1
2020-03-07Rollup merge of #69706 - cuviper:subslice-methods, r=CentrilMazdak Farrokhzad-22/+8
Use subslice patterns in slice methods For all of the methods that pick off the first or last element, we can use subslice patterns to implement them directly, rather than relying on deeper indexing function calls. At a minimum, this means the generated code will rely less on inlining for performance, but in some cases it also optimizes better.
2020-03-07Update alloc.rsTim Diekmann-2/+2
2020-03-07Add `Layout::dangling()` to return a well-aligned `NonNull<u8>`Tim Diekmann-0/+16
2020-03-06bless testsMatthias Krüger-1/+1
2020-03-06fix various typosMatthias Krüger-16/+16
2020-03-05Make link to `std::str` activeLeSeulArtichaut-1/+3
2020-03-04Use subslice patterns in slice methodsJosh Stone-22/+8
For all of the methods that pick off the first or last element, we can use subslice patterns to implement them directly, rather than relying on deeper indexing function calls. At a minimum, this means the generated code will rely less on inlining for performance, but in some cases it also optimizes better.
2020-03-04Auto merge of #68952 - faern:stabilize-assoc-int-consts, r=dtolnaybors-215/+255
Stabilize assoc_int_consts associated int/float constants The next step in RFC https://github.com/rust-lang/rfcs/pull/2700 (tracking issue #68490). Stabilizing the associated constants that were added in #68325. * Stabilize all constants under the `assoc_int_consts` feature flag. * Update documentation on old constants to say they are soft-deprecated and the new ones should be preferred. * Update documentation examples to use new constants. * Remove `uint_macro` and use `int_macro` for all integer types since the macros were identical anyway. r? @LukasKalbertodt
2020-03-03Try to ensure usize marker does not get mergedMark Rousskov-1/+11
2020-03-03Rollup merge of #69621 - matthiaskrgr:q, r=petrochenkovDylan DPC-6/+2
use question mark operator in a few places.
2020-03-03use question mark operator in a few places.Matthias Krüger-6/+2
2020-03-03Rollup merge of #69609 - TimDiekmann:excess, r=AmanieuYuki Okushi-224/+80
Remove `usable_size` APIs This removes the usable size APIs: - remove `usable_size` (obv) - change return type of allocating methods to include the allocated size - remove `_excess` API r? @Amanieu closes rust-lang/wg-allocators#17
2020-03-03Rollup merge of #69213 - LeSeulArtichaut:improve-doc-iter, r=steveklabnikYuki Okushi-2/+5
Improve documentation on iterators length Attempts to resolve #66491. @the8472 does this help? r? @steveklabnik
2020-03-03Remove `usable_size` APIsTim Diekmann-224/+80
2020-03-02Apply suggestions from code reviewLeSeulArtichaut-2/+3
2020-03-02Rollup merge of #69617 - DutchGhost:master, r=LukasKalbertodtDylan DPC-1/+2
constify mem::forget implements https://github.com/rust-lang/rust/issues/69616
2020-03-02Rollup merge of #69544 - lqd:unrevert-67174, r=Mark-SimulacrumDylan DPC-7/+5
Unrevert "Remove `checked_add` in `Layout::repeat`" This reapplies @kraai's original `libcore::alloc::Layout::repeat` change from #67174 which was temporarily reverted in #69241. Now that the proper LLVM fix has been cherry-picked, we can unrevert the revert. This change was originally reviewed by @hanna-kruppe on the initial PR. cc @RalfJung
2020-03-02Rollup merge of #68682 - LeSeulArtichaut:stable-intrinsics, r=steveklabnikDylan DPC-9/+473
Add documentation to compiler intrinsics This adds documentation to the compiler intrinsics having stable standard implementations. Relates to #34338 (cc @bstrie) r? @steveklabnik (for reassignment?)
2020-03-02actually mark the function constDutchGhost-1/+1
2020-03-01constify mem::forgetDutchGhost-0/+1
2020-03-01Remove assert that had been replaced by assert_neMichael Mc Donnell-1/+0
2020-02-29Rollup merge of #69582 - RalfJung:vec-parts, r=CentrilDylan DPC-6/+10
improve transmute and Vec::from_raw_parts docs I think this fixes https://github.com/rust-lang/rust/issues/64073. @Shnatsel please let me know if this is less confusing. :)
2020-02-29Rollup merge of #69581 - RalfJung:align_to_mut, r=CentrilDylan DPC-1/+15
fix aliasing violation in align_to_mut Fixes https://github.com/rust-lang/rust/issues/68549 I decided to add the testcase here to make it all one PR, but if you prefer I can also add that test case in the Miri repo instead.
2020-02-29Fix typoRalf Jung-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-02-29fix aliasing violation in align_to_mutRalf Jung-1/+15
2020-02-29transmute: improve Vec exampleRalf Jung-6/+10
2020-02-29Auto merge of #69570 - Dylan-DPC:rollup-d6boczt, r=Dylan-DPCbors-19/+22
Rollup of 6 pull requests Successful merges: - #69477 (docs: add mention of async blocks in move keyword docs) - #69504 (Use assert_ne in hash tests) - #69546 (use to_vec() instead of .iter().cloned().collect() to convert slices to vecs.) - #69551 (use is_empty() instead of len() == x to determine if structs are empty.) - #69563 (Fix no_std detection for target triples) - #69567 (use .to_string() instead of format!() macro to create strings) Failed merges: r? @ghost
2020-02-29Rollup merge of #69551 - matthiaskrgr:len_zero, r=Mark-SimulacrumDylan DPC-2/+2
use is_empty() instead of len() == x to determine if structs are empty.
2020-02-29Rollup merge of #69504 - MichaelMcDonnell:hash_assert_ne, r=LukasKalbertodtDylan DPC-17/+20
Use assert_ne in hash tests The hash tests were written before the assert_ne macro was added to the standard library. The assert_ne macro provides better output in case of a failure.
2020-02-29Auto merge of #69208 - RalfJung:debug-assert, r=Mark-Simulacrumbors-5/+19
debug_assert a few more raw pointer methods Makes progress for https://github.com/rust-lang/rust/issues/53871
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-2/+2
2020-02-28Unrevert "Remove `checked_add` in `Layout::repeat`"Remy Rakic-7/+5
2020-02-28Rollup merge of #69501 - matthiaskrgr:find_note, r=ecstatic-morseDylan DPC-0/+4
note that find(f) is equivalent to filter(f).next() in the docs. r? @ecstatic-morse
2020-02-28Rollup merge of #69495 - matthiaskrgr:op_ref, r=oli-obkDylan DPC-1/+1
don't take redundant references to operands
2020-02-27docs: note that find(f) is equivalent to filter(f).next() in the iterator docs.Matthias Krüger-0/+4
2020-02-27Remove spotlight usageGuillaume Gomez-3/+0
2020-02-27avoid a negation in is_nonoverlappingRalf Jung-2/+3
2020-02-27disable debug assertion in ptr::write for nowRalf Jung-1/+3
2020-02-27Rollup merge of #69479 - matthiaskrgr:op_pred, r=Dylan-DPCYuki Okushi-1/+1
clarify operator precedence
2020-02-26Use assert_ne in hash testsMichael Mc Donnell-17/+20
The hash tests were written before the assert_ne macro was added to the standard library. The assert_ne macro provides better output in case of a failure.