about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-04-28Add intrinsics for unchecked division and moduloNicholas Mazzuca-0/+17
The "unchecked_" div and rem functions will give UB in case of rhs == 0, or, in the signed versions, lhs == INT::min and rhs == -1
2015-04-28Register new snapshotsTamir Duberstein-132/+8
2015-04-29Auto merge of #24865 - bluss:range-size, r=alexcrichtonbors-4/+35
core: Fix size_hint for signed integer `Range<T>` iterators There was an overflow bug in .size_hint() for signed iterators, which produced an hilariously incorrect size or an overflow panic. Incorrect size is a serious bug since the iterators are marked ExactSizeIterator. (And leads to abort() on (-1i8..127).collect() when the collection tries to preallocate too much). > (-1i8..127).size_hint() (18446744073709551488, Some(18446744073709551488)) Bug found using quickcheck. Fixes #24851
2015-04-28Clarify offset rules a bitSimonas Kazlauskas-6/+12
2015-04-27Auto merge of #24701 - Stebalien:slice, r=alexcrichtonbors-25/+79
Instead of using the O(n) defaults, define O(1) shortcuts. I also copied (and slightly modified) the relevant tests from the iter tests into the slice tests just in case someone comes along and changes them in the future. Partially implements #24214.
2015-04-27core: Fix size_hint for signed integer Range<T> iteratorsUlrik Sverdrup-4/+35
There was an overflow bug in .size_hint() for signed iterators, which produced an hilariously incorrect size or an overflow panic. Incorrect size is a serious bug since the iterators are marked ExactSizeIterator. (And leads to abort() on (-1i8..127).collect() when the collection tries to preallocate too much). All signed range iterators were affected. > (-1i8..127).size_hint() (18446744073709551488, Some(18446744073709551488)) Bug found using quickcheck. Fixes #24851
2015-04-27Auto merge of #24869 - steveklabnik:rollup, r=steveklabnikbors-3/+1
- Successful merges: #24797, #24804, #24848, #24854, #24855, #24860, #24863, #24866, #24867, #24868 - Failed merges:
2015-04-27Rollup merge of #24854 - frewsxcv:patch-19, r=alexcrichtonSteve Klabnik-3/+1
2015-04-27Auto merge of #24834 - shepmaster:default-atomic-ptr, r=alexcrichtonbors-0/+6
Closes #24613
2015-04-27Auto merge of #24849 - gareins:master, r=steveklabnikbors-1/+1
Previous borrow() is enough to make borrow_mut() panic, no need to have borrow_mut() twice. [This](http://is.gd/woKKAW)
2015-04-26Make From::from example more idiomatic / simplerCorey Farwell-3/+1
2015-04-26Indicate function call is code-like in doc-commentCorey Farwell-2/+2
2015-04-26IMO better borrow_mut() documentation on RefCellgareins-1/+1
Previous borrow() is enough to make borrow_mut() panic, no need to have borrow_mut() twice. [This](http://is.gd/woKKAW)
2015-04-25Provide a Default implementation for AtomicPtrJake Goulding-0/+6
Closes #24613
2015-04-25Add singlethreaded fence intrinsics.Peter Marheine-0/+15
These new intrinsics are comparable to `atomic_signal_fence` in C++, ensuring the compiler will not reorder memory accesses across the barrier, nor will it emit any machine instructions for it. Closes #24118, implementing RFC 888.
2015-04-24Rollup merge of #24772 - steveklabnik:gh24712, r=alexcrichtonSteve Klabnik-1/+1
FIxes #24712
2015-04-24Deduplicate slice iter offset/transmute code.Steven Allen-45/+41
2015-04-24Remove reference to 'to'Steve Klabnik-1/+1
FIxes #24712
2015-04-22Address comments.Steven Allen-42/+46
1. Use next_back for last. 2. Use slices for computing nth. It might be possible to use the same code for both the mut/const case but I don't know how that will play with compiler optimizations.
2015-04-22Implement O(1) slice::Iter methods.Steven Allen-0/+54
Instead of using the O(n) defaults, define O(1) shortcuts.
2015-04-22Fix a tiny typo in core::rawRobin Kruppe-1/+1
2015-04-22Remove doc-comment default::Default importsCorey Farwell-9/+0
In 8f5b5f94dcdb9884737dfbc8efd893d1d70f0b14, `default::Default` was added to the prelude, so these imports are no longer necessary.
2015-04-21rollup merge of #24636: alexcrichton/remove-deprecatedAlex Crichton-2164/+400
Conflicts: src/libcore/result.rs
2015-04-21rollup merge of #24541: alexcrichton/issue-24538Alex Crichton-43/+50
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-21std: Bring back f32::from_str_radix as an unstable APIAlex Crichton-239/+175
This API was exercised in a few tests and mirrors the `from_str_radix` functionality of the integer types.
2015-04-21rollup merge of #24661: SimonSapin/fmt-write-charAlex Crichton-0/+17
as accepted in [RFC 526](https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md). Note that this brand new method is marked as **stable**. I judged this safe enough: it’s simple enough that it’s very unlikely to change. Still, I can mark it unstable instead if you prefer. r? @alexcrichton
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-1849/+226
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-21std: Remove deprecated AsOsStr/Str/AsSlice traitsAlex Crichton-84/+0
Cleaning out more deprecated items
2015-04-21Pick a feature name for write_charSimon Sapin-1/+1
2015-04-21write_char is unlikely to make it for 1.0, it’ll be 1.1Simon Sapin-1/+1
2015-04-21Auto merge of #24620 - pczarn:model-lexer-issues, r=cmrbors-6/+0
Fixes #15679 Fixes #15878 Fixes #15882 Closes #15883
2015-04-21Add a `write_char` method to `std::fmt::Write`Simon Sapin-0/+17
as accepted in [RFC 526](https://github.com/rust-lang/rfcs/blob/master/text/0526-fmt-text-writer.md).
2015-04-21Model lexer: Fix remaining issuesPiotr Czarnecki-6/+0
2015-04-20Rollup merge of #24628 - steveklabnik:gh24173, r=alexcrichtonSteve Klabnik-21/+0
Fixes #24173 These docs could all use examples, so for now, let's just remove the bad one, and when I go over this whole module I'll put in better ones.
2015-04-20Rollup merge of #24627 - steveklabnik:gh24008, r=alexcrichtonSteve Klabnik-13/+13
Fixes #24008.
2015-04-20Auto merge of #24606 - bombless:doc-result, r=alexcrichtonbors-2/+2
Get rid of the confusion that what does "custom" mean in this context.
2015-04-20remove bad example from PartialEq docsSteve Klabnik-21/+0
Fixes #24173
2015-04-20Make iterator struct docs more consistent.Steve Klabnik-13/+13
Fixes #24008.
2015-04-20Improve doc for `Result::unwrap()`York Xiang-2/+2
2015-04-18Indicate keywords are code-like in Fuse::reset_fuse doc commentCorey Farwell-2/+3
2015-04-18Auto merge of #24428 - kwantam:deprecate_unicode_fns, r=alexcrichtonbors-1/+1
This patch 1. renames libunicode to librustc_unicode, 2. deprecates several pieces of libunicode (see below), and 3. removes references to deprecated functions from librustc_driver and libsyntax. This may change pretty-printed output from these modules in cases involving wide or combining characters used in filenames, identifiers, etc. The following functions are marked deprecated: 1. char.width() and str.width(): --> use unicode-width crate 2. str.graphemes() and str.grapheme_indices(): --> use unicode-segmentation crate 3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(), char.compose(), char.decompose_canonical(), char.decompose_compatible(), char.canonical_combining_class(): --> use unicode-normalization crate
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-43/+50
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-17Auto merge of #24500 - pnkfelix:oflo-checked-neg, r=nikomatsakisbors-1/+5
Add conditional overflow-checking to signed negate operator. I argue this can land independently of #24420 , because one can write the implementation of `wrapped_neg()` inline if necessary (as illustrated in two cases on this PR). This needs to go into beta channel.
2015-04-17Rollup merge of #24491 - bluss:rangefull-debug, r=huonwManish Goregaokar-1/+1
Fix Debug impl for RangeFull The Debug impl was using quotes, which was inconsistent: => (.., 1.., 2..3, ..4) (\"..\", 1.., 2..3, ..4) Fix to use just ..
2015-04-17side-step potentially panic'ing negate in `fn abs`.Felix S. Klock II-1/+5
2015-04-17Auto merge of #24512 - steveklabnik:rollup, r=steveklabnikbors-9/+9
- Successful merges: #23782, #24455, #24490, #24493, #24494, #24496, #24498, #24499, #24501, #24502, #24506, #24507, #24508, #24509, #24510 - Failed merges: #24488
2015-04-16Fix broken links in the docsFlorian Hartwig-4/+4
2015-04-16Indicate None is code-like in doc commentsCorey Farwell-5/+5
2015-04-17Auto merge of #24420 - pnkfelix:oflo-api, r=alexcrichtonbors-1/+156
Fill in missing parts of Integer overflow API See todo list at #22020
2015-04-16deprecate Unicode functions that will be moved to crates.iokwantam-1/+1
This patch 1. renames libunicode to librustc_unicode, 2. deprecates several pieces of libunicode (see below), and 3. removes references to deprecated functions from librustc_driver and libsyntax. This may change pretty-printed output from these modules in cases involving wide or combining characters used in filenames, identifiers, etc. The following functions are marked deprecated: 1. char.width() and str.width(): --> use unicode-width crate 2. str.graphemes() and str.grapheme_indices(): --> use unicode-segmentation crate 3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(), char.compose(), char.decompose_canonical(), char.decompose_compatible(), char.canonical_combining_class(): --> use unicode-normalization crate