about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2018-12-09Resolve FIXME and cleanupShotaro Yamada-20/+8
2018-12-09Override Cycle::try_foldShotaro Yamada-0/+21
name old ns/iter new ns/iter diff ns/iter diff % speedup iter::bench_cycle_take_ref_sum 927,152 927,194 42 0.00% x 1.00 iter::bench_cycle_take_sum 938,129 603,492 -334,637 -35.67% x 1.55
2018-12-08Rollup merge of #56602 - dwijnand:fix-ptr-hash-docs, r=CentrilMazdak Farrokhzad-2/+5
Fix the just-introduced ptr::hash docs Follow-up to #56250.
2018-12-08Rollup merge of #56599 - dlrobertson:fix_va_arg, r=eddybMazdak Farrokhzad-0/+2
codegen: Fix va_list - aarch64 iOS/Windows ## Summary Fix code generated for `VaList` on Aarch64 iOS/Windows. ## Details According to the [Apple - ARM64 Function Calling Conventions]: > ... the type va_list is an alias for char * rather than for the struct > type specified in the generic PCS. The current implementation uses the generic Aarch64 structure for `VaList` for Aarch64 iOS. Switch to using the `char *` variant of the `VaList` and use the corresponding `emit_ptr_va_arg` for the `va_arg` intrinsic. Windows always uses the `char *` variant of the `VaList`. Update the `va_arg` intrinsic to use `emit_ptr_va_arg`. [Apple - ARM64 Function Calling Conventions]: https://developer.apple.com/library/archive/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html
2018-12-08Auto merge of #56578 - alexreg:cosmetic-1, r=alexregbors-109/+110
Various minor/cosmetic improvements to code r? @Centril 😄
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-109/+110
2018-12-07codegen: Fix va_list - aaarch64 iOS/WindowsDan Robertson-0/+2
According to the Apple developer docs: > The type va_list is an alias for char * rather than for the struct > type specified in the generic PCS. The current implementation uses the generic Aarch64 structure for VaList for Aarch64 iOS. Windows always uses the char * variant of the va_list.
2018-12-07use top level `fs` functions where appropriateAndy Russell-4/+3
This commit replaces many usages of `File::open` and reading or writing with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code complexity, and will improve performance for most reads, since the functions allocate the buffer to be the size of the file. I believe that this commit will not impact behavior in any way, so some matches will check the error kind in case the file was not valid UTF-8. Some of these cases may not actually care about the error.
2018-12-07grammarDale Wijnand-1/+1
2018-12-07Fix the just-introduced ptr::hash docsDale Wijnand-2/+5
2018-12-07Unique/NonNull::from: make sure we convert to raw pointers ASAPRalf Jung-4/+4
By going through a shared reference, we share the destination as read-only, meaning we can read but not write with the raw pointers
2018-12-07Rollup merge of #56574 - cbarrick:master, r=varkorkennytm-2/+1
Fix a stutter in the docs for slice::exact_chunks Before this change, the docs for `slice::exact_chunks` reads like this: > See `chunks` for a variant of this iterator that also returns the remainder as a smaller chunk, and `rchunks_exact` for the same iterator but starting at the end of the slice of the slice. Notice that stutter at the end? This commit fixes it.
2018-12-07Rollup merge of #56250 - dwijnand:ptr-hash, r=alexcrichtonkennytm-0/+30
Introduce ptr::hash for references The RHS is what I used, which wasn't as convenient as `ptr::eq`, so I wondered: should `ptr::hash` exist? My first Rust PR, so I'm going to need some guidance. :)
2018-12-06Fix a stutter in the docs for slice::exact_chunksChris Barrick-2/+1
2018-12-06Auto merge of #56557 - pietroalbini:rollup, r=pietroalbinibors-7/+7
Rollup of 11 pull requests Successful merges: - #56315 (Rustdoc inline macro reexport) - #56332 ([rustdoc] Specific crate search) - #56362 (Stabilise exhaustive integer patterns) - #56426 (libsyntax_pos: A few tweaks) - #56441 (rustbuild: Fix issues with compiler docs) - #56446 (pass the parameter environment to `traits::find_associated_item`) - #56500 (cleanup: remove static lifetimes from consts) - #56525 (Avoid extra copy and syscall in std::env::current_exe) - #56528 (Remove unused dependency (rustc_lint -> rustc_mir)) - #56548 (Optimized string FromIterator + Extend impls) - #56553 (Don't print the profiling summary to stdout when -Zprofile-json is set) Failed merges: r? @ghost
2018-12-06Auto merge of #55635 - oli-obk:min_const_unsafe_fn, r=nikomatsakisbors-14/+23
Allow calling `const unsafe fn` in `const fn` behind a feature gate cc #55607 r? @Centril
2018-12-06Rollup merge of #56500 - ljedrz:cleanup_rest_of_const_lifetimes, r=zackmdavisPietro Albini-7/+7
cleanup: remove static lifetimes from consts A follow-up to https://github.com/rust-lang/rust/pull/56497.
2018-12-05Rollup merge of #56538 - xfix:patch-13, r=blussPietro Albini-1/+20
Use inner iterator may_have_side_effect for Cloned Previous implementation wasn't correct, as an inner iterator could have had side effects. Noticed by @bluss in #56534.
2018-12-05Rollup merge of #56424 - mark-i-m:explain-raw, r=CentrilPietro Albini-0/+4
Mention raw-ident syntax According to https://github.com/rust-lang/rust/pull/56419#pullrequestreview-180542790 Blocked on #56419 r? @Centril
2018-12-05Rollup merge of #56119 - frewsxcv:frewsxcv-option-carrier, r=TimNNPietro Albini-4/+3
Utilize `?` instead of `return None`. None
2018-12-05Avoid calling clone in DoubleEndedIterator implementation of CopiedKonrad Borowski-2/+2
2018-12-05Add a test for cloned side effectsKonrad Borowski-0/+17
2018-12-05Use inner iterator may_have_side_effect for ClonedKonrad Borowski-1/+3
Previous implementation wasn't correct, as an inner iterator could have had side effects.
2018-12-05Copy may_have_side_effect from I for Copied<I>Konrad Borowski-1/+3
2018-12-05Use copied method instead of cloned in Copied::next_back()Konrad Borowski-1/+1
2018-12-05Add tests for Iterator::copied()Konrad Borowski-0/+18
2018-12-05Add tests for Option::copied()Konrad Borowski-0/+22
2018-12-05Add unstable Iterator::copied()Konrad Borowski-1/+128
2018-12-05Add unstable Option::copied()Konrad Borowski-0/+42
2018-12-04Utilize `?` instead of `return None`.Corey Farwell-4/+3
2018-12-04cleanup: remove static lifetimes from constsljedrz-7/+7
2018-12-04Increase code-reuse and -readabilityOliver Scherer-1/+1
2018-12-04Add tests for stable unsafe features in const fnOliver Scherer-1/+0
2018-12-04Also make immutable references to non-freeze restricted value range types unsafeOliver Scherer-5/+6
2018-12-04Make sure the initialization of constrained int range newtypes is unsafeOliver Scherer-10/+19
2018-12-04Fix ptr::hash, just hash the raw pointerDale Wijnand-1/+1
2018-12-04Make ptr::hash take a raw painter like ptr::eqDale Wijnand-1/+1
2018-12-03...and fix a linkCorey Farwell-1/+1
2018-12-03tweak 'known issues' wordingCorey Farwell-2/+2
2018-12-03link to raw identifiersMark Mansi-1/+3
2018-12-03Explain raw identifer syntaxMark Mansi-0/+2
2018-12-03Rollup merge of #56419 - mark-i-m:remove-try, r=Centrilkennytm-5/+5
Remove some uses of try!
2018-12-02Auto merge of #56275 - RalfJung:win-mutex, r=SimonSapinbors-0/+6
use MaybeUninit instead of mem::uninitialized for Windows Mutex I hope this builds, I do not have a Windows machine to test...
2018-12-02let FIXME refer to tracking issueRalf Jung-2/+2
2018-12-01remove some uses of try!Mark Mansi-5/+5
2018-12-01Auto merge of #56165 - RalfJung:drop-glue-type, r=eddyb,nikomatsakisbors-2/+12
drop glue takes in mutable references, it should reflect that in its type When drop glue begins, it should retag, like all functions taking references do. But to do that, it needs to take the reference at a proper type: `&mut T`, not `*mut T`. Failing to retag can mean that the memory the reference points to remains frozen, and `EscapeToRaw` on a frozen location is a NOP, meaning later mutations cause a Stacked Borrows violation. Cc @nikomatsakis @Gankro because Stacked Borrows Cc @eddyb for the changes to miri argument passing (the intention is to allow passing `*mut [u8]` when `&mut [u8]` is expected and vice versa)
2018-12-01Rollup merge of #55011 - vi:panic_immediate_abort, r=alexcrichtonkennytm-3/+25
Add libstd Cargo feature "panic_immediate_abort" It stop asserts and panics from libstd to automatically include string output and formatting code. Use case: developing static executables smaller than 50 kilobytes, where usual formatting code is excessive while keeping debuggability in debug mode. May resolve #54981.
2018-12-01Rollup merge of #56355 - Zoxc:inline-things, r=michaelwoeristerkennytm-0/+1
Add inline attributes and add unit to CommonTypes
2018-12-01Rollup merge of #56216 - SimonSapin:array-tryfrom-slice, r=withoutboatskennytm-0/+87
Add TryFrom<&[T]> for [T; $N] where T: Copy `TryFrom<&[T]> for &[T; $N]` (note *reference* to an array) already exists, but not needing to dereference makes type inference easier for example when using `u32::from_be_bytes`. Also add doc examples doing just that.
2018-11-30Remove unused feature gate from `libcore`Oliver Scherer-1/+0