about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2019-03-18Simplify Iterator::{lt, gt}Tim Vermeulen-8/+2
2019-03-18Replaced self-reflective explicit types with clearer `Self` or `Self::…` ↵Vincent Esche-44/+44
in stdlib docs
2019-03-17Add iter::{bench_partial_cmp, bench_lt} benchmarksTim Vermeulen-0/+10
2019-03-17Forward Iterator::{ne, lt, le, gt, ge} to Iterator::{eq, partial_cmp}Tim Vermeulen-96/+18
2019-03-16Rollup merge of #59231 - matklad:copied, r=Centrilkennytm-7/+2
Stabilize Option::copied closes https://github.com/rust-lang/rust/issues/57126
2019-03-16Rollup merge of #59221 - czipperz:as_ref_documentation, r=Centrilkennytm-4/+4
Option and Result: Add references to documentation of as_ref and as_mut This makes the documentation more consistent with that of `Pin::as_ref` which converts "from `&Pin<Pointer<T>>` to `Pin<&t>`". This generally makes it clearer that the reference is going inside the option.
2019-03-16Rollup merge of #59206 - sntdevco:master, r=dtolnaykennytm-34/+34
Improved test output
2019-03-16Rollup merge of #59185 - lukaslueg:patch-2, r=cramertjkennytm-4/+2
No old chestnuts in iter::repeat docs The current language may be amusing, yet is just imprecise and most especially difficult to understand for someone who speaks English as a foreign language.
2019-03-16Rollup merge of #59152 - smmalis37:range_contains, r=SimonSapinkennytm-30/+19
Stabilize Range*::contains. Closes https://github.com/rust-lang/rust/issues/32311. There's also a bit of rustfmt on range.rs thrown in for good measure (I forgot to turn off format-on-save in VSCode).
2019-03-16Rollup merge of #59102 - newpavlov:duration_float, r=alexcrichtonkennytm-11/+129
Consistent naming for duration_float methods and additional f32 methods `duration_float` tracking issue: #54361 New list of methods: - `as_secs_f64(&self) -> f64` - `as_secs_f32(&self) -> f32` - `from_secs_f64(secs: f64) -> Duration` - `from_secs_f32(secs: f32) -> Duration` - `mul_f64(self, rhs: f64) -> Duration` - `mul_f32(self, rhs: f32) -> Duration` - `div_f64(self, rhs: f64) -> Duration` - `div_f32(self, rhs: f64) -> Duration` - `div_duration_f64(self, rhs: Duration) -> f64` - `div_duration_f32(self, rhs: Duration) -> f32` With [`num_traits::Float`](https://docs.rs/num-traits/0.2.6/num_traits/float/trait.Float.html) we could've reduced number of methods by factor of two, but unfortunately it's not part of `std`.
2019-03-16Rollup merge of #59082 - alexreg:cosmetic-2-doc-comments, r=Centrilkennytm-24/+27
A few improvements to comments in user-facing crates Not too many this time, and all concern comments (almost all doc comments) in user-facing crates (libstd, libcore, liballoc). r? @steveklabnik
2019-03-16Rollup merge of #59072 - RalfJung:miri-alloc-tests, r=kennytmkennytm-34/+0
we can now skip should_panic tests with the libtest harness
2019-03-16Tweak documentation of RefCell::borrow_stateAnthony Ramine-6/+10
2019-03-16Stabilize Option::copiedAleksey Kladov-7/+2
closes https://github.com/rust-lang/rust/issues/57126
2019-03-16Rollup merge of #58938 - dlrobertson:fix_58280, r=joshtriplettkennytm-7/+7
core: ensure VaList passes improper_ctypes lint Ensure the `core::ffi::VaList` structure passes the `improper_ctypes` lint. Fixes: #58280
2019-03-15Option and Result: Add references to documentation of as_ref and as_mutChris Gregory-4/+4
2019-03-15Revert "Deprecate std::cell::RefCell::borrow_state"Anthony Ramine-4/+0
This reverts commit dc2d5058e999abb18ab2686b4e3e385ec6e36666.
2019-03-15Revert "Remove RefCell::borrow_state"Anthony Ramine-0/+49
This reverts commit 313aab8fbeb98730f8ffa741ccf54f843d5e3525.
2019-03-15Improved test output for libcore/num/int_macrossntdevco-24/+24
2019-03-15Improved test output for libcore/opssntdevco-4/+4
2019-03-15Improved test output for libcore/cellsntdevco-6/+6
2019-03-15Auto merge of #58710 - EdorianDark:master, r=sfacklerbors-0/+26
Add clamp for ranges. Implements #44095 Ready for merge
2019-03-15consistent naming for Rhs type parameter in libcore/opsGrigorii Kargin-50/+50
2019-03-14Update sources.rslukaslueg-4/+2
The current language may be amusing, yet is just imprecise and most especially difficult to understand for someone who speaks English as a foreign language.
2019-03-12Stabilize Range*::contains.Steven Malis-30/+19
2019-03-13Rollup merge of #59138 - timvermeulen:simplify_select_fold1, r=sfacklerMazdak Farrokhzad-58/+49
Simplify Iterator::{min, max} This PR simplifies the `select_fold1` helper method used to implmement `Iterator::{min, min_by, min_by_key, max, max_by, max_by_key}` by removing the projection argument, which was only used by the implementations of `min_by_key` and `max_by_key`. I also added tests to ensure that the stability as mentioned in the comments of `min` and `max` is preserved, and fixed the `iter::{bench_max, bench_max_by_key}` benchmarks which the compiler presumably was able to collapse into closed-form expressions. None of the benchmark results were impacted, I suspect their generated assembly didn't change.
2019-03-13Rollup merge of #59130 - RalfJung:non-null, r=rkruppeMazdak Farrokhzad-0/+10
Note that NonNull does not launder shared references for mutation See https://users.rust-lang.org/t/relative-pointer-an-abstraction-to-build-movable-self-referential-types/26186/6
2019-03-13Rollup merge of #59124 - sntdevco:master, r=CentrilMazdak Farrokhzad-118/+118
Replace assert with assert_eq Use `assert_eq!` instead of `assert!` for the tests
2019-03-13Rollup merge of #59121 - czipperz:fix_assert_result_fromiterater, r=CentrilMazdak Farrokhzad-1/+1
impl FromIterator for Result: Use assert_eq! instead of assert!
2019-03-13Rollup merge of #59057 - czipperz:standardize_range_documentation, r=shepmasterMazdak Farrokhzad-27/+43
Standardize `Range*` documentation This updates the final example in the documentation for the types `Range`, `RangeFrom`, `RangeFull`, `RangeInclusive`, `RangeTo`, `RangeToInclusive`.
2019-03-13Rollup merge of #59056 - scottmcm:even-fewer-lifetimes, r=sfacklerMazdak Farrokhzad-39/+39
Use lifetime contravariance to elide more lifetimes in core+alloc+std Sample: ```diff - impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a mut A where A: PartialEq<B> { + impl<A: ?Sized, B: ?Sized> PartialEq<&mut B> for &mut A where A: PartialEq<B> { #[inline] - fn eq(&self, other: &&'b mut B) -> bool { PartialEq::eq(*self, *other) } + fn eq(&self, other: &&mut B) -> bool { PartialEq::eq(*self, *other) } #[inline] - fn ne(&self, other: &&'b mut B) -> bool { PartialEq::ne(*self, *other) } + fn ne(&self, other: &&mut B) -> bool { PartialEq::ne(*self, *other) } } ``` [I didn't know this worked](https://internals.rust-lang.org/t/why-can-you-use-different-unconstrained-lifetimes-to-implement-traits/9544/2?u=scottmcm) until recently, but since defining methods contravariantly in their lifetimes this way has worked back to Rust 1.0, we might as well take advantage of combining it with IHLE.
2019-03-13Rollup merge of #58998 - xTibor:doc_from_bytes, r=scottmcmMazdak Farrokhzad-8/+8
Fix documentation of from_ne_bytes and from_le_bytes Copypasta mistake, the documentation of `from_ne_bytes` and `from_le_bytes` used the big-endian variant in the example snippets.
2019-03-12Forward `max` and `min` to `max_by` and `min_by` respectivelyTim Vermeulen-4/+2
2019-03-12Auto merge of #58015 - icefoxen:tryfrom-docs, r=SimonSapinbors-6/+72
Expand docs for `TryFrom` and `TryInto`. The examples are still lacking for now, both for module docs and for methods/impl's. Will be adding those in further pushes. Should hopefully resolve the doc concern in #33417 when finished?
2019-03-12Add tests to ensure that Iterator::min and Iterator::max are stableTim Vermeulen-0/+28
2019-03-12Fix commentTim Vermeulen-1/+1
2019-03-12Remove the projection part of select_fold1Tim Vermeulen-56/+21
2019-03-12Fix the bench_max and bench_max_by_key benchmarksTim Vermeulen-2/+2
2019-03-12Remove stabilized feature gate in doctestSimon Sapin-1/+0
2019-03-12fix typoArtyom Pavlov-1/+1
2019-03-12expandRalf Jung-1/+2
2019-03-12Note that NonNull does not launder shared references for mutationRalf Jung-0/+9
2019-03-12Replace assert with assert_eq for better debuggingSayan Nandan-118/+118
2019-03-11impl FromIterator for Result: Use assert_eq! instead of assert!Chris Gregory-1/+1
2019-03-11Fix RangeBounds documentation to include inclusive operationsChris Gregory-1/+1
2019-03-11Standardize `Range*` documentationChris Gregory-26/+42
This updates the final example in the documentation for the types `Range`, `RangeFrom`, `RangeFull`, `RangeInclusive`, `RangeTo`, `RangeToInclusive`.
2019-03-11fix testArtyom Pavlov-2/+2
2019-03-11Add initial implementation of 'sort_at_index' for slices -- analog to C++'s ↵Pavel Krajcevski-0/+355
std::nth_element (a.k.a. quickselect) Add some more notes to the documentation: - Mention that the median can be found if we used `len() / 2`. - Mention that this function is usually called "kth element" in other libraries. Address some comments in PR: - Change wording on some of the documentation - Change recursive function into a loop Update name to `partition_at_index` and add convenience return values. Address reviewer comments: - Don't swap on each iteration when searching for min/max element. - Add some docs about when we panic. - Test that the sum of the lengths of the output matches the length of the input. - Style fix for for-loop. Address more reviewer comments Fix Rng stuff for test Fix doc test build Don't run the partition_at_index test on wasm targets Miri does not support entropy for test partition_at_index
2019-03-11fix testsnewpavlov-5/+9
2019-03-11move MAX_NANOS_F64/32 to methodsnewpavlov-2/+4