about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2019-03-25Rework documentation to be about fat pointersChris Gregory-5/+9
2019-03-25black_box should use inline assembly on wasm32gnzlbg-3/+3
2019-03-25Refactor tuple comparison testsChris Gregory-20/+24
2019-03-25Clarify `{Ord,f32,f64}::clamp` docs a littleTobias Bucher-4/+9
Explicitly call out when it returns NaN, adhere to the panic doc guidelines.
2019-03-25add missing bracesFelix S Klock II-2/+2
add missing braces analogous to those suggested by killercup
2019-03-25black_box should inhibit optimizations on platforms without inline assemblygnzlbg-3/+6
2019-03-25Update src/libcore/option.rsPascal Hertleif-1/+1
Co-Authored-By: pnkfelix <pnkfelix@pnkfx.org>
2019-03-25Remove dupplicated configgnzlbg-2/+2
2019-03-25Moves test::black_box to core::hintgnzlbg-0/+19
This changes removes a cyclic dependency between the "test" and "libtest" crates, where "libtest" depends on "test" for "black_box", but "test" depends on "libtest" for everything else. I've chosen the "hint" module because there seems to be enough consensus in the discussion of RFC2360 that this module is where such an intrinsic would belong, but this PR does not implement that RFC! (note: if that RFC ever gets merged, the API, docs, etc. of this API will need to change). For backwards compatibility reasons I've chosen to also keep the "test" feature gate for these instead of adding a new feature gate. If we change the feature gate, we'll potentially all benchmarks, and while that's something that we could do, it seems unnecessary to do that now - if RFC2360 gets merged, we'll need to do that anyways.
2019-03-24Rollup merge of #59328 - koalatux:iter-nth-back, r=scottmcmkennytm-0/+26
Implement specialized nth_back() for Box and Windows. Hi there, this is my first pull request to rust :-) I started implementing some specializations for DoubleEndedIterator::nth_back() and these are the first two. The problem has been discussed in #54054 and nth_back() is tracked in #56995. I'm stuck with the next implementation so I though I do a PR for the ones I'm confident with to get some feedback.
2019-03-24Rollup merge of #59239 - gnzlbg:fix_spin_loop, r=nagisakennytm-6/+25
Remove inline assembly from hint::spin_loop This PR removes the inline assembly which was not required since these instructions are available in core::arch, and extends support of the spin_loop hint to arm targets with the v6 feature which also support the yield instruction.
2019-03-23Make `ptr::eq` documentation mention smart-pointer behaviorChris Gregory-0/+4
Resolves #59214
2019-03-22review commentsEsteban Küber-1/+1
2019-03-22Add suggestion to use `&*var` when `&str: From<String>` is expectedEsteban Küber-0/+6
2019-03-22ffi: rename VaList::copy to VaList::with_copyDan Robertson-1/+1
Rename `VaList::copy` to `VaList::with_copy`.
2019-03-22add suggestions to trim_{left,right} deprecationsAndy Russell-4/+20
2019-03-22Rollup merge of #59190 - greg-kargin:master, r=sanxiynMazdak Farrokhzad-50/+50
consistent naming for Rhs type parameter in libcore/ops Rename RHS type parameter occurrences RHS->Rhs to make it consistent throughout files and follow naming conventions.
2019-03-22Expand `impl FromIterator for Result` doc to include examples of `Err` and ↵Felix S. Klock II-0/+28
early termination.
2019-03-22Expand `impl FromIterator for Option` doc to include example of early ↵Felix S. Klock II-0/+20
termination.
2019-03-21Wrapped a line such that it does not exceed 100 characters.Christian-1/+2
2019-03-21Changed inline code by using a single quote.Christian-20/+20
2019-03-21Added back a reference to "the book"Christian-2/+2
2019-03-21Fixed indentation of list items.Christian-4/+2
2019-03-21Reformatted the text such that the line length does not exceed 100.Christian-15/+22
2019-03-21Fix undefined behavior in hint::spin_loop for x86 targets without SSE2gnzlbg-6/+25
The pause instruction requires SSE2 but was being unconditionally used on targets without it, resulting in undefined behavior. This PR fixes that by only using the pause intrinsic if SSE2 is available. It also removes the inline assembly which was not required since these instructions are available in core::arch, and extends support of the spin_loop hint to arm targets with the v6 feature which also support the yield instruction. Closes #59237 .
2019-03-20Add improved doc example for Sum<Option<T>>John Downey-8/+5
2019-03-20Initial version of the documentation change of std::convert.Christian-85/+85
2019-03-19Update stable attribute to be since 1.35.0Mazdak Farrokhzad-2/+2
Co-Authored-By: jtdowney <jdowney@gmail.com>
2019-03-19Fix missing cfg for aarch64 + ios in ffi.rsJames Duley-4/+6
2019-03-19Fix AArch64 typo in commentsJames Duley-1/+1
2019-03-19Fix aarch64 typoJames Duley-2/+2
2019-03-19Rollup merge of #59280 - joshlf:sandbox/joshlf/stabilize-refcell-map-split, ↵Mazdak Farrokhzad-5/+2
r=cramertj,Centril Stabilize refcell_map_split feature Closes #51476.
2019-03-19Rollup merge of #59275 - regexident:docs-self, r=joshtriplettMazdak Farrokhzad-44/+44
Replaced self-reflective explicit types with clearer `Self` or `Self::…` in stdlib docs Many docs examples use explicit types instead of the semantically more clear `Self`/`Self::…` aliases. By using the latter it's clear that the value's type depends on either `Self`, or an associated type of `Self`, instead of some constant type. It's also more consistent (and I'd argue correct), as the current docs aren't really consistent in this, as can be seen from the diff. This is a best effort PR, as I was basically going through the docs manually, looking for offending examples. I'm sure I missed a few. Gotta start somewhere.
2019-03-19Rollup merge of #58939 - taeguk:fix-doc-about-pin, r=rkruppeMazdak Farrokhzad-1/+1
Fix a tiny error in documentation of std::pin. `new_unmoved` must be `mut` for passing to `std::mem::swap`.
2019-03-19Rollup merge of #58778 - xfix:exact_size_case_mapping_iter, r=SimonSapinMazdak Farrokhzad-0/+26
Implement ExactSizeIterator for ToLowercase and ToUppercase
2019-03-19ASCII uppercase: add "subtract multiplied bool" benchmarkSimon Sapin-0/+12
2019-03-19Introduce RefCell::try_borrow_unguardedAnthony Ramine-49/+38
This replaces RefCell::borrow_state to something that encodes the use case of Servo better.
2019-03-19Update since annotation for ExactSizeIterator for ToUppercase/LowercaseKonrad Borowski-2/+2
This functionality was added in 1.35.0, not 1.34.0.
2019-03-19ASCII uppercase: add "subtract shifted bool" benchmarkSimon Sapin-0/+12
2019-03-19Simplify u8::to_ascii_{upp,low}ercase while keeping it fastSimon Sapin-43/+27
2019-03-19Benchmark more possibles impls of [u8]::make_ascii_uppercaseSimon Sapin-1/+83
2019-03-18Remove ASCII_CHARACTER_CLASS table, use `match` with range patterns instead.Simon Sapin-55/+20
2019-03-18Add benchmarks for `u8::is_ascii*`Simon Sapin-17/+32
2019-03-18Rename src/libcore/benches/ascii_case.rs to ascii.rsSimon Sapin-1/+7
2019-03-18Stabilize refcell_map_split featureJoshua Liebow-Feeser-5/+2
- Closes #51476
2019-03-18TidySimon Sapin-2/+4
2019-03-18Add benchmark for not-quite-correct “fake SIMD” make_ascii_uppercaseSimon Sapin-0/+46
2019-03-18Make u8::to_ascii_lowercase and to_ascii_uppercase branchlessSimon Sapin-101/+43
2019-03-18Add benchmarks for [u8]::make_ascii_uppercaseSimon Sapin-0/+173
2019-03-18Add todo!() macroAleksey Kladov-0/+59
The use-case of `todo!()` macro is to be a much easier to type alternative to `unimplemented!()` macro.