summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2017-08-12std: Stabilize the `str_{mut,box}_extras` featureAlex Crichton-4/+4
Stabilizes * `<&mut str>::as_bytes_mut` * `<Box<str>>::into_boxed_bytes` * `std::str::from_boxed_utf8_unchecked` * `std::str::from_utf8_mut` * `std::str::from_utf8_unchecked_mut` Closes #41119
2017-08-12Stabilize the `compile_error_macro` featureAlex Crichton-1/+1
Stabilizes: * `compile_error!` as a macro defined by rustc Closes #40872
2017-08-12std: Stabilize `manually_drop` featureAlex Crichton-10/+7
Stabilizes * `core::mem::ManuallyDrop` * `std::mem::ManuallyDrop` * `ManuallyDrop::new` * `ManuallyDrop::into_inner` * `ManuallyDrop::drop` * `Deref for ManuallyDrop` * `DerefMut for ManuallyDrop` Closes #40673
2017-08-12std: Stabilize `utf8_error_error_len` featureAlex Crichton-1/+1
Stabilizes: * `Utf8Error::error_len` Closes #40494
2017-08-12std: Stabilize `str_checked_slicing` featureAlex Crichton-10/+10
Stabilized * `<str>::get` * `<str>::get_mut` * `<str>::get_unchecked` * `<str>::get_unchecked_mut` Closes #39932
2017-08-12std: Stabilize `option_entry` featureAlex Crichton-6/+2
Stabilized: * `Option::get_or_insert` * `Option::get_or_insert_with` Closes #39288
2017-08-12std: Stabilize `char_escape_debug`Alex Crichton-6/+5
Stabilizes: * `<char>::escape_debug` * `std::char::EscapeDebug` Closes #35068
2017-08-12Avoid calling the column!() macro in panicest31-2/+12
2017-07-16Auto merge of #43237 - ↵bors-1/+1
zackmdavis:missing_sum_and_product_for_128_bit_integers, r=nagisa add u128/i128 to sum/product implementors Resolves #43235.
2017-07-16Auto merge of #43252 - vbrandl:doc/default-values, r=GuillaumeGomezbors-18/+19
Document default values for primitive types All primitive types implement the `Default` trait but the documentation just says `Returns the "default value" for a type.` and doesn't give a hint about the actual default value. I think it would be good to document the default values in a proper way. I changed the `default_impl` macro to accept a doc string as a third parameter and use this string to overwrite the documentation of `default()` for each primitive type. The generated documentation now looks like this: ![Documentation of default() on the bool primitive](https://i.imgur.com/nK6TApo.png)
2017-07-15Rephrase the doc stringValentin Brandl-17/+17
2017-07-15Document default values for primitive typesValentin Brandl-18/+19
2017-07-14Rollup merge of #43159 - cuviper:ptr-swap-simd, r=arielb1Corey Farwell-1/+4
Disable big-endian simd in swap_nonoverlapping_bytes This is a workaround for #42778, which was git-bisected to #40454's optimizations to `mem::swap`, later moved to `ptr` in #42819. Natively compiled rustc couldn't even compile stage1 libcore on powerpc64 and s390x, but they work fine without this `repr(simd)`. Since powerpc64le works OK, it seems probably related to being big-endian. The underlying problem is not yet known, but this at least makes those architectures functional again in the meantime. cc @arielb1
2017-07-14add u128/i128 to sum/product implementorsZack M. Davis-1/+1
Resolves #43235.
2017-07-13Forward more Iterator methods for iter::RevSimon Sapin-0/+8
`position` could not be implemented because calling `rposition` on the inner iterator would require more trait bounds.
2017-07-13Forward more Iterator methods for str::BytesSimon Sapin-0/+38
These are overridden by slice::Iter
2017-07-12Rollup merge of #43137 - ollie27:stab, r=aturonMark Simulacrum-5/+5
Correct some stability attributes These show up in rustdoc so need to be correct.
2017-07-12Rollup merge of #43011 - qnighy:unsized-tuple-impls, r=aturonMark Simulacrum-7/+23
Implement Eq/Hash/Debug etc. for unsized tuples. As I mentioned in [the comment in #18469](https://github.com/rust-lang/rust/issues/18469#issuecomment-306767422), the implementations of `PartialEq`, `Eq`, `PartialOrd`, `Ord`, `Debug`, `Hash` can be generalized to unsized tuples. This is consistent with the `derive` behavior for unsized structs. ```rust #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Default, Hash)] struct MyTuple<X, Y, Z: ?Sized>(X, Y, Z); fn f(x: &MyTuple<i32, i32, [i32]>) { x == x; x < x; println!("{:?}", x); } ``` Questions: - Need an RFC? - Need a feature gate? I don't think it does because the unsized tuple coercion #42527 is feature-gated. - I changed `builder.field($name);` into `builder.field(&$name);` in the `Debug` implementation to pass compilation. This won't affect the behavior because `Debug for &'a T` is a mere redirection to `Debug for T`. However, I don't know if it affects code size / performance.
2017-07-12Rollup merge of #42670 - dns2utf8:panic_return_code, r=steveklabnikMark Simulacrum-1/+1
Add hint about the return code of panic! I hope the link works on all cases, since the `unreachable` doc is copied to `std::` as well.
2017-07-10Disable big-endian simd in swap_nonoverlapping_bytesJosh Stone-1/+4
This is a workaround for #42778, which was git-bisected to #40454's optimizations to `mem::swap`, later moved to `ptr` in #42819. Natively compiled rustc couldn't even compile stage1 libcore on powerpc64 and s390x, but they work fine without this `repr(simd)`. Since powerpc64le works OK, it seems probably related to being big-endian. The underlying problem is not yet known, but this at least makes those architectures functional again in the meantime. cc @arielb1
2017-07-10Correct some stability attributesOliver Middleton-5/+5
These show up in rustdoc so need to be correct.
2017-07-08Add tests for reaching the end of RangeInclusive as an iteratorSimon Sapin-0/+20
2017-07-08Add tests for Range*::nthSimon Sapin-0/+51
2017-07-08Implement O(1)-time Iterator::nth for Range*Simon Sapin-5/+84
2017-07-08Factorize some macros in iter/range.rsSimon Sapin-57/+28
2017-07-08Remove Step::steps_between, rename steps_between_by_one to steps_betweenSimon Sapin-51/+10
2017-07-08Remove unused Step methodsSimon Sapin-34/+0
2017-07-08Remove unused Add bounds in iterator for ranges impls.Simon Sapin-23/+8
2017-07-06remove associated_consts feature gateSean McArthur-1/+2
2017-07-05Add `rustc_on_unimplemented` message to `std::ops::Try`Esteban Küber-0/+2
2017-07-05Insert current implementation headerStefan Schindler-1/+1
2017-07-04Rollup merge of #43043 - sfackler:reverse-stability, r=Mark-SimulacrumMark Simulacrum-1/+1
Add a stability marker for core::cmp::Reverse.0 Closes #43027
2017-07-04Rollup merge of #42836 - rthomas:29355-debug, r=GuillaumeGomezMark Simulacrum-10/+129
Update docs for Debug* structs. #29355 This adds docs for the Debug* structs as well as examples from the Formatter::debug_* methods, so that a user knows how to construct them. I added these examples as the builders module is not public and hence the debug_*_new() functions are not available to a user. r? @steveklabnik
2017-07-04Auto merge of #43012 - scottmcm:delete-range-step-by, r=alexcrichtonbors-246/+16
Delete deprecated & unstable range-specific `step_by` Using the new one is annoying while this one exists, since the inherent method hides the one on iterator. Tracking issue: #27741 Replacement: #41439 Deprecation: #42310 for 1.19 Fixes #41477
2017-07-03Add a stability marker for core::cmp::Reverse.0Steven Fackler-1/+1
Closes #43027
2017-07-02Auto merge of #43010 - stjepang:stabilize-sort-unstable, r=alexcrichtonbors-6/+5
Stabilize feature sort_unstable Closes #40585
2017-07-02Remove the remaining feature gatesStjepan Glavina-1/+0
2017-07-02Add docs for Debug* structs. #29355Ryan Thomas-10/+129
This adds docs for the Debug* structs as well as examples from the Formatter::debug_* methods, so that a user knows how to construct them. I added these examples as the builders module is not public and hence the debug_*_new() functions are not available to a user. r? @steveklabnik Review comments. Mainly adding in the links for all of the structs and functions. Remove rust tag on code blocks.
2017-07-02Style fixest31-1/+1
2017-07-02Documentationest31-2/+2
2017-07-02Fix the test failure, add comment, and refactor a little bitest31-102/+22
2017-07-02Output line column info when panickingest31-17/+120
2017-07-02Fix tidy errorsStjepan Glavina-3/+3
2017-07-01Delete deprecated & unstable range-specific `step_by`Scott McMurray-246/+16
Replacement: 41439 Deprecation: 42310 for 1.19 Fixes 41477
2017-07-02Stabilize feature sort_unstableStjepan Glavina-2/+2
2017-07-02Implement Eq/Hash/Debug etc. for unsized tuples.Masaki Hara-7/+23
2017-07-01Auto merge of #42991 - sfackler:unstable-rangeargument, r=alexcrichtonbors-168/+9
Revert "Stabilize RangeArgument" This reverts commit 143206d54d7558c2326212df99efc98110904fdb. From the discussion in #30877 it seems like this is premature.
2017-06-30Revert "Stabilize RangeArgument"Steven Fackler-168/+9
This reverts commit 143206d54d7558c2326212df99efc98110904fdb.
2017-06-30Track `iterator_for_each` in #42986Josh Stone-1/+1
2017-06-30Auto merge of #42782 - cuviper:iterator_for_each, r=alexcrichtonbors-0/+94
Add `Iterator::for_each` This works like a `for` loop in functional style, applying a closure to every item in the `Iterator`. It doesn't allow `break`/`continue` like a `for` loop, nor any other control flow outside the closure, but it may be a more legible style for tying up the end of a long iterator chain. This was tried before in #14911, but nobody made the case for using it with longer iterators. There was also `Iterator::advance` at that time which was more capable than `for_each`, but that no longer exists. The `itertools` crate has `Itertools::foreach` with the same behavior, but thankfully the names won't collide. The `rayon` crate also has a `ParallelIterator::for_each` where simple `for` loops aren't possible. > I really wish we had `for_each` on seq iterators. Having to use a > dummy operation is annoying. - [@nikomatsakis][1] [1]: https://github.com/nikomatsakis/rayon/pull/367#issuecomment-308455185