about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2018-02-19Fix count usize link typo in docsGil Cottle-1/+1
2018-02-19Make ".e0" not parse as 0.0varkor-1/+8
This forces floats to have either a digit before the separating point, or after. Thus ".e0" is invalid like ".", when using `parse()`.
2018-02-19Add non-panicking variants of pow to all integer typesJewoo Lee-0/+308
Currently, calling pow may panic in case of overflow, and the function does not have non-panicking counterparts. Thus, it would be beneficial to add those in.
2018-02-18Rollup merge of #48282 - Centril:spelling-fix/iter-repeat-with, r=kennytmGuillaume Gomez-1/+1
Fix spelling in core::iter::repeat_with: s/not/note Fixes spelling error in https://github.com/rust-lang/rust/pull/48156#discussion_r168718452. Tracking issue: https://github.com/rust-lang/rust/issues/48169
2018-02-18Auto merge of #47687 - SimonSapin:panic-impl, r=sfacklerbors-0/+252
RFC 2070 part 1: PanicInfo and Location API changes This implements part of https://rust-lang.github.io/rfcs/2070-panic-implementation.html Tracking issue: https://github.com/rust-lang/rust/issues/44489 * Move `std::panic::PanicInfo` and `std::panic::Location` to a new `core::panic` module. The two types and the `std` module were already `#[stable]` and stay that way, the new `core` module is `#[unstable]`. * Add a new `PanicInfo::message(&self) -> Option<&fmt::Arguments>` method, which is `#[unstable]`. * Implement `Display` for `PanicInfo` and `Location`
2018-02-17Rollup merge of #48260 - dns2utf8:add_link_to_yield, r=kennytmGuillaume Gomez-3/+4
[doc] Add link to yield_now A convenient link.
2018-02-17Rollup merge of #48243 - rust-lang:steveklabnik-patch-1, r=kennytmGuillaume Gomez-1/+1
spelling fix in comment r? @Manishearth
2018-02-17Rollup merge of #48152 - antoyo:primitive-docs-relevant, r=QuietMisdreavusGuillaume Gomez-1671/+1914
Primitive docs relevant This fixes the documentation to show the right types in the examples for many integer methods. I need to check if the result is correct before we merge.
2018-02-16core::iter::repeat_with: fix spelling, s/not/noteMazdak Farrokhzad-1/+1
2018-02-16Notify users that this example is shared through integer typesGuillaume Gomez-19/+47
2018-02-16Force the link to std::thread::yield_now()Stefan Schindler-1/+1
2018-02-16Add link to yield_nowStefan Schindler-3/+4
2018-02-16Auto merge of #45404 - giannicic:defaultimpl2, r=nikomatsakisbors-3/+3
#37653 support `default impl` for specialization this commit implements the second part of the `default impl` feature: > - a `default impl` need not include all items from the trait > - a `default impl` alone does not mean that a type implements the trait The first point allows rustc to compile and run something like this: ``` trait Foo { fn foo_one(&self) -> &'static str; fn foo_two(&self) -> &'static str; } default impl<T> Foo for T { fn foo_one(&self) -> &'static str { "generic" } } struct MyStruct; fn main() { assert!(MyStruct.foo_one() == "generic"); } ``` but it shows a proper error if trying to call `MyStruct.foo_two()` The second point allows a `default impl` to be considered as not implementing the `Trait` if it doesn't implement all the trait items. The tests provided (in the compile-fail section) should cover all the possible trait resolutions. Let me know if some tests is missed. See [referenced ](https://github.com/rust-lang/rust/issues/37653) issue for further info r? @nikomatsakis
2018-02-15spelling fix in commentSteve Klabnik-1/+1
2018-02-15add Self: Trait<..> inside the param_env of a default implGianni Ciccarelli-3/+3
2018-02-15Auto merge of #48203 - kennytm:rollup, r=kennytmbors-29/+337
Rollup of 23 pull requests - Successful merges: #47784, #47806, #47846, #48005, #48033, #48065, #48087, #48114, #48126, #48130, #48133, #48151, #48154, #48156, #48162, #48163, #48165, #48167, #48181, #48186, #48195, #48035, #48210 - Failed merges:
2018-02-15Rollup merge of #48210 - jacob-hughes:clarify_sized_trait_in_api_docs, ↵kennytm-3/+7
r=QuietMisdreavus Clarified why `Sized` bound not implicit on trait's implicit `Self` type. This part of the documentation was a little confusing to me on first read. I've added a couple lines for further explanation. Hopefully this makes things a bit clearer for new readers.
2018-02-14Review change - Expanded on explanation.Jacob Hughes-3/+3
2018-02-15Partially revert #47333.kennytm-9/+15
Removed the `assume()` which we assumed is the cause of misoptimization in issue #48116.
2018-02-14Clarified why `Sized` bound not implicit on trait's implicit `Self` type.Jacob Hughes-3/+7
2018-02-14Rollup merge of #48156 - Centril:feature/iterator_repeat_with, r=alexcrichtonkennytm-0/+164
Add std/core::iter::repeat_with Adds an iterator primitive `repeat_with` which is the "lazy" version of `repeat` but also more flexible since you can build up state with the `FnMut`. The design is mostly taken from `repeat`. r? @rust-lang/libs cc @withoutboats, @scottmcm
2018-02-14Rollup merge of #48151 - echochamber:update_range_example, r=estebankkennytm-5/+5
Update ops range example to avoid confusion between indexes and values. Makes clearer the numbers in the range refer to indexes, not the values at those indexes.
2018-02-14Rollup merge of #48130 - ollie27:stab, r=Mark-Simulacrumkennytm-7/+7
Correct a few stability attributes * `core_float_bits`, `duration_core`, `path_component_asref`, and `repr_align` were stabalized in 1.25.0 not 1.24.0. * Impls for `NonNull` involving unstable things should remain unstable. * `Duration` should remain stable since 1.3.0 so it appears correctly in the `std` docs. * `cursor_mut_vec` is an impl on only stable things so should be marked stable.
2018-02-14Rollup merge of #48087 - scottmcm:range_is_empty, r=kennytm,alexcrichtonkennytm-14/+154
Add Range[Inclusive]::is_empty During https://github.com/rust-lang/rfcs/pull/1980, it was discussed that figuring out whether a range is empty was subtle, and thus there should be a clear and obvious way to do it. It can't just be ExactSizeIterator::is_empty (also unstable) because not all ranges are ExactSize -- such as `Range<i64>` and `RangeInclusive<usize>`. Things to ponder: - Unless this is stabilized first, this makes stabilizing ExactSizeIterator::is_empty more icky, since this hides that. - This is only on `Range` and `RangeInclusive`, as those are the only ones where it's interesting. But one could argue that it should be on more for consistency, or on RangeArgument instead. - The bound on this is PartialOrd, since that works ok (see tests for float examples) and is consistent with `contains`. But ranges like `NAN..=NAN`_are_ kinda weird. - [x] ~~There's not a real issue number on this yet~~
2018-02-14fix tidy checksMaxim Nazarenko-2/+2
2018-02-14rephrase UnsafeCell docMaxim Nazarenko-8/+9
Make UnsafeCell doc easier to follow
2018-02-14Add missing featureGuillaume Gomez-218/+270
2018-02-13core::iter::repeat_with: fix missing word, see @Pazzaz's reviewMazdak Farrokhzad-1/+1
2018-02-12core::iter::repeat_with: tracking issue is #48169Mazdak Farrokhzad-5/+5
2018-02-12core::iter::repeat_with: document DoubleEndedIterator behaviorMazdak Farrokhzad-0/+6
2018-02-12Fix tidy errorsAntoni Boucher-6/+10
2018-02-12Add Iterator::try_for_eachScott McMurray-6/+42
The fallible version of for_each and the stateless version of try_fold.
2018-02-12core::iter::repeat_with: fix doc testsMazdak Farrokhzad-2/+2
2018-02-12core::iter::repeat_with: fix tests some moreMazdak Farrokhzad-5/+5
2018-02-12core::iter::repeat_with: fix testsMazdak Farrokhzad-1/+3
2018-02-12core::iter::repeat_with: derive Copy, Clone, DebugMazdak Farrokhzad-0/+1
2018-02-12core::iter::repeat_with: general fixesMazdak Farrokhzad-0/+7
2018-02-12add core::iter::repeat_withMazdak Farrokhzad-0/+148
2018-02-11Make primitive types docs relevant (unsigned)Antoni Boucher-735/+815
2018-02-11Make primitive types docs relevantGuillaume Gomez-937/+1016
2018-02-11Update ops range example to avoid confusion between indexes and values.Jason Schein-5/+5
2018-02-10Add the emptiness condition to the docs; add a PartialOrd example with NANScott McMurray-2/+24
2018-02-10Correct a few stability attributesOliver Middleton-7/+7
2018-02-11Rollup merge of #47547 - varkor:infinite-iterators-warning-doc, r=frewsxcvkennytm-0/+18
Document the behaviour of infinite iterators on potentially-computable methods It’s not entirely clear from the current documentation what behaviour calling a method such as `min` on an infinite iterator like `RangeFrom` is. One might expect this to terminate, but in fact, for infinite iterators, `min` is always nonterminating (at least in the standard library). This adds a quick note about this behaviour for clarification.
2018-02-11Rollup merge of #48120 - matthiaskrgr:typos_src_1, r=alexcrichtonkennytm-1/+1
fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}} via codespell
2018-02-10fix typos in src/{bootstrap,ci,etc,lib{backtrace,core,fmt_macros}}Matthias Krüger-1/+1
2018-02-10Rollup merge of #48100 - Mark-Simulacrum:fetch-nand, r=alexcrichtonkennytm-0/+61
Add fetch_nand to atomics I think this is all fine but I have little familiarity with the atomic code (or libcore in general) so I may have accidentally done something wrong here... cc #13226 (the tracking issue)
2018-02-10Rollup merge of #48107 - matthiaskrgr:typo__substract_to_subtract, r=kennytmkennytm-2/+2
fix typo: substract -> subtract
2018-02-10Rollup merge of #47790 - tinaun:patch-1, r=sfacklerkennytm-1/+1
derive PartialEq and Eq for `ParseCharError` unlike the other Parse*Error types, ParseCharError didn't have these implemented for whatever reason
2018-02-09range_is_empty tracking issue is #48111Scott McMurray-2/+2