about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2018-05-23move type def out of unsafe blockJoe ST-6/+4
from https://github.com/rust-lang/rust/pull/50863#discussion_r190213000 move the union definition outside of the unsafe block
2018-05-22Add Option::as_pin_mutTaylor Cramer-0/+11
2018-05-22Add PinMut::setTaylor Cramer-0/+8
2018-05-22Add Pinned type for opting out of Unpin on stableTaylor Cramer-0/+10
2018-05-22Make `Unpin` safe to implementTaylor Cramer-2/+2
2018-05-22Remove the unstable Float traitSimon Sapin-411/+204
Following up to #49896 and #50629. Fixes #32110. E0689 is weird.
2018-05-23Rollup merge of #50945 - stjepang:stabilize-from-ref, r=SimonSapinkennytm-3/+3
Stabilize feature from_ref Function `from_ref_mut` is now renamed to `from_mut`, as discussed in #45703. Closes #45703. r? @SimonSapin
2018-05-23Rollup merge of #50913 - d-e-s-o:fix-typo, r=joshtriplettkennytm-1/+1
Fix typo in cell.rs
2018-05-23Rollup merge of #50863 - oli-obk:const_len, r=SimonSapin,Gankrokennytm-16/+39
Make `[T]::len` and `str::len` const fn r? @Gankro
2018-05-21Auto merge of #49283 - varkor:combining-chars-escape_debug, r=SimonSapinbors-25/+173
Escape combining characters in char::Debug Although combining characters are technically printable, they make little sense to print on their own with `Debug`: it'd be better to escape them like non-printable characters. This is a breaking change, but I imagine the fact `escape_debug` is rare and almost certainly primarily used for debugging that this is an acceptable change. Resolves #41922. r? @alexcrichton cc @clarcharr
2018-05-21Fix tables.rsvarkor-6/+45
2018-05-21Avoid counting characters and add explanatory comment to testvarkor-1/+1
2018-05-21Only escape extended grapheme characters in the first positionvarkor-13/+23
2018-05-21Make {char, str}::escape_debug and impl Debug for {char, str} consistentvarkor-16/+3
2018-05-21Use Grapheme_Extend instead of Mnvarkor-174/+137
2018-05-21Use the correct output directory for downloading Unicode filesvarkor-2/+1
2018-05-21Remove example in test for is_nonspacing_mark because it's currently privatevarkor-10/+0
2018-05-21Add test for Debug formatting of charvarkor-0/+8
2018-05-21Escape combining characters in escape_debugvarkor-5/+33
2018-05-21Keep tables.rs copyright notice up to datevarkor-5/+5
2018-05-21Download unicode data files in directory of unicode.pyvarkor-7/+11
2018-05-21Update unicode/tables.rs with Mnvarkor-1/+121
2018-05-21Make `[T]::len` and `str::len` const fnOliver Schneider-16/+39
2018-05-21Stabilize feature from_refStjepan Glavina-3/+3
2018-05-21Auto merge of #50898 - shepmaster:typo, r=QuietMisdreavusbors-13/+14
UnsafeCell doc typos and minor flow improvements r? @QuietMisdreavus
2018-05-20Auto merge of #50234 - cramertj:extend, r=alexcrichtonbors-0/+7
Add implementation of Extend for () This is useful in some generic code which wants to collect iterators of items into a result.
2018-05-20Auto merge of #50719 - frewsxcv:frewsxcv-iterator-zip, r=alexcrichtonbors-2/+1
Fix incorrect statement about return value for Iterator::zip. Fixes https://github.com/rust-lang/rust/issues/50225.
2018-05-19Fix typo in cell.rsDaniel Mueller-1/+1
2018-05-19UnsafeCell doc typos and minor flow improvementsJake Goulding-13/+14
2018-05-19Add as_micros and as_millis methodsJonathan Behrens-2/+36
2018-05-19Fix warning when building stage0 libcoreDan Robertson-0/+1
When building stage0 a warning will be triggered when compiling libcore due to align_to_offsets not being used.
2018-05-18Auto merge of #50319 - nagisa:align_to, r=alexcrichtonbors-78/+518
Implement [T]::align_to Note that this PR deviates from what is accepted by RFC slightly by making `align_offset` to return an offset in elements, rather than bytes. This is necessary to sanely support `[T]::align_to` and also simply makes more sense™. The caveat is that trying to align a pointer of ZST is now an equivalent to `is_aligned` check, rather than anything else (as no number of ZST elements will align a misaligned ZST pointer). It also implements the `align_to` slightly differently than proposed in the RFC to properly handle cases where size of T and U aren’t co-prime. Furthermore, a promise is made that the slice containing `U`s will be as large as possible (contrary to the RFC) – otherwise the function is quite useless. The implementation uses quite a few underhanded tricks and takes advantage of the fact that alignment is a power-of-two quite heavily to optimise the machine code down to something that results in as few known-expensive instructions as possible. Currently calling `ptr.align_offset` with an unknown-at-compile-time `align` results in code that has just a single "expensive" modulo operation; the rest is "cheap" arithmetic and bitwise ops. cc https://github.com/rust-lang/rust/issues/44488 @oli-obk As mentioned in the commit message for align_offset, many thanks go to Chris McDonald.
2018-05-18Auto merge of #50758 - varkor:stabilise-inclusive_range_methods, r=SimonSapinbors-15/+14
Stabilise inclusive_range_methods r? @SimonSapin Closes #49022.
2018-05-17Fix align_offset_stride1 & align_to_simple testsSimonas Kazlauskas-2/+2
2018-05-17Remove the intrinsic for align_offsetSimonas Kazlauskas-54/+26
Keep only the language item. This removes some indirection and makes codegen worse for debug builds, but simplifies code significantly, which is a good tradeoff to make, in my opinion. Besides, the codegen can be improved even further with some constant evaluation improvements that we expect to happen in the future.
2018-05-17Implement [T]::align_toSimonas Kazlauskas-20/+287
2018-05-17Add doc comments mentioning unspecified behaviour upon exhaustionvarkor-1/+10
2018-05-17Stabilise into_innervarkor-3/+1
2018-05-17Stabilise inclusive_range_methodsvarkor-11/+3
2018-05-17Rollup merge of #50837 - steveklabnik:revert-49767, r=QuietMisdreavusMark Simulacrum-430/+101
Revert #49767 There was [some confusion](https://github.com/rust-lang/rust/pull/49767#issuecomment-389250815) and I accidentally merged a PR that wasn't ready.
2018-05-17Rollup merge of #50553 - clarcharr:option_xor, r=sfacklerMark Simulacrum-0/+36
Add Option::xor method Implements the method requested in #50512.
2018-05-17Change align_offset to support different stridesSimonas Kazlauskas-55/+256
This is necessary if we want to implement `[T]::align_to` and is more useful in general. This implementation effort has begun during the All Hands and represents a month of my futile efforts to do any sort of maths. Luckily, I found the very very nice Chris McDonald (cjm) on IRC who figured out the core formulas for me! All the thanks for existence of this PR go to them! Anyway… Those formulas were mangled by yours truly into the arcane forms you see here to squeeze out the best assembly possible on most of the modern architectures (x86 and ARM were evaluated in practice). I mean, just look at it: *one actual* modulo operation and everything else is just the cheap single cycle ops! Admitedly, the naive solution might be faster in some common scenarios, but this code absolutely butchers the naive solution on the worst case scenario. Alas, the result of this arcane magic also means that the code pretty heavily relies on the preconditions holding true and breaking those preconditions will unleash the UB-est of all UBs! So don’t.
2018-05-17Revert #49767steveklabnik-430/+101
There was [some confusion](https://github.com/rust-lang/rust/pull/49767#issuecomment-389250815) and I accidentally merged a PR that wasn't ready.
2018-05-17Auto merge of #50629 - Mark-Simulacrum:stage-step, r=alexcrichtonbors-1261/+385
Switch to bootstrapping from 1.27 It's possible the Float trait could be removed from core, but I couldn't tell whether it was intended to be removed or not. @SimonSapin may be able to comment more here; we can presumably also do that in a follow up PR as this one is already quite large.
2018-05-17Switch to 1.26 bootstrap compilerMark Simulacrum-1261/+385
2018-05-17Rename trans to codegen everywhere.Irina Popa-1/+1
2018-05-17Rollup merge of #50808 - SimonSapin:nonzero, r=alexcrichtonkennytm-132/+14
Stabilize num::NonZeroU* Tracking issue: https://github.com/rust-lang/rust/issues/49137
2018-05-16Stabilize num::NonZeroU*Simon Sapin-10/+7
Tracking issue: https://github.com/rust-lang/rust/issues/49137
2018-05-16Remove unstable deprecated num::NonZeroI* typesSimon Sapin-17/+1
2018-05-16Make core::nonzero privateSimon Sapin-106/+7
It is now an implementation detail of ptr::NonNull and num::NonZero*