about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-02-18Audit `core::default` for `int`/`uint` usage.Felix S. Klock II-8/+8
* Use `i32` (`u32`) in doc examples, not `int` (`u32`). * Switch impl macros to use `isize`/`usize` rather than `int`/`uint`.
2015-02-18Audit `core::cmp` for `int/uint`.Felix S. Klock II-6/+6
* cast 3-valued `core::cmp::Ordering` to `i32`, not `int`. * use `isize`/`usize` in the impl macros.
2015-02-18Audit `core::borrow` for use of `int/uint`: use `i32` in doc example.Felix S. Klock II-1/+1
2015-02-18Avoid ptrtoint when checking if a pointer is nullBjörn Steinbrink-2/+2
Casting the pointer to an integer requires a ptrtoint, while casting 0 to a pointer is directly folded to a `null` value.
2015-02-17Register new snapshotsAlex Crichton-86/+9
2015-02-17rollup merge of #22319: huonw/send-is-not-staticAlex Crichton-0/+18
Conflicts: src/libstd/sync/task_pool.rs src/libstd/thread.rs src/libtest/lib.rs src/test/bench/shootout-reverse-complement.rs src/test/bench/shootout-spectralnorm.rs
2015-02-17Test fixes and rebase conflictsAlex Crichton-4/+5
2015-02-17rollup merge of #22435: aturon/final-stab-threadAlex Crichton-6/+6
Conflicts: src/test/bench/rt-messaging-ping-pong.rs src/test/bench/rt-parfib.rs src/test/bench/task-perf-spawnalot.rs
2015-02-17rollup merge of #22454: alexcrichton/stabilize-into-iteratorAlex Crichton-0/+9
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
2015-02-18Remove usage of .map(|&foo| foo)Kevin Butler-4/+4
2015-02-18Opt for .cloned() over .map(|x| x.clone()) etc.Kevin Butler-1/+1
2015-02-18Implement RandomAccessIterator for ClonedKevin Butler-0/+17
2015-02-17Fallout from stabilizationAaron Turon-6/+6
2015-02-18Add Send implementations for `&` and `&mut`.Huon Wilson-0/+8
Per RFC 458. Closes #22251.
2015-02-18Remove the implicit `'static` bound on `Send`.Huon Wilson-0/+10
Previously Send was defined as `trait Send: 'static {}`. As detailed in https://github.com/rust-lang/rfcs/pull/458, the `'static` bound is not actually necessary for safety, we can use lifetimes to enforce that more flexibly. `unsafe` code that was previously relying on `Send` to insert a `'static` bound now may allow incorrect patterns, and so should be audited (a quick way to ensure safety immediately and postpone the audit is to add an explicit `'static` bound to any uses of the `Send` type). cc #22251.
2015-02-17std: Stabilize the IntoIterator traitAlex Crichton-0/+9
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
2015-02-17Auto merge of #22311 - lfairy:consistent-fmt, r=alexcrichtonbors-10/+10
This brings it in line with its namesake in `std::io`. [breaking-change] r? @aturon
2015-02-17Rollup merge of #22311 - lfairy:consistent-fmt, r=alexcrichtonManish Goregaokar-10/+10
This brings it in line with its namesake in `std::io`. [breaking-change] r? @aturon
2015-02-17Rollup merge of #22364 - Manishearth:rfc-572-forbid-attr, r=nikomatsakisManish Goregaokar-0/+1
fixes #22203 r? @nikomatsakis This breaks code that might be using attributes randomly, so it's technically a [breaking-change]
2015-02-17Rollup merge of #22401 - pnkfelix:fsk-int-uint-audit, r=GankroManish Goregaokar-17/+17
cc #22240
2015-02-17Rollup merge of #22232 - alexcrichton:missing-fmt-stability, r=aturonManish Goregaokar-0/+1
The `Arguments::new_v1_formatted` function was accidentally left out when this module was stabilized.
2015-02-17Rollup merge of #22111 - robinst:option-docs-flatmap, r=steveklabnikManish Goregaokar-0/+2
Some newcomers might look for a "flatMap" method on Option. Include the reference so that searching the page would find "and_then".
2015-02-17Rollup merge of #22027 - iblech:patch-1, r=steveklabnikManish Goregaokar-2/+2
The first commit adds a short note which I believe will reduce worries in people who work with closures very often and read the Rust book for their first time. The second commit consists solely of tiny typo fixes. In some cases, I changed "logical" quotations like She said, "I like programming". to She said, "I like programming." because the latter seems to be the prevalent style in the book.
2015-02-17Rollup merge of #21990 - steveklabnik:doc_core_cmp, r=huonwManish Goregaokar-66/+206
Fix up, add examples, make them all the same.
2015-02-17Rollup merge of #22313 - japaric:iter, r=aturonManish Goregaokar-0/+73
`IntoIterator` now has an extra associated item: ``` rust trait IntoIterator { type Item; type IntoIter: Iterator<Self=Self::Item>; } ``` This lets you bind the iterator \"`Item`\" directly when writing generic functions: ``` rust // hypothetical change, not included in this PR impl Extend<T> for Vec<T> { // you can now write fn extend<I>(&mut self, it: I) where I: IntoIterator<Item=T> { .. } // instead of fn extend<I: IntoIterator>(&mut self, it: I) where I::IntoIter: Iterator<Item=T> { .. } } ``` The downside is that now you have to write an extra associated type in your `IntoIterator` implementations: ``` diff impl<T> IntoIterator for Vec<T> { + type Item = T; type IntoIter = IntoIter<T>; fn into_iter(self) -> IntoIter<T> { .. } } ``` Because this breaks all downstream implementations of `IntoIterator`, this is a [breaking-change] --- r? @aturon
2015-02-17Rollup merge of #22344 - nagisa:exactsizediter, r=alexcrichtonManish Goregaokar-0/+1
Appears to be just an oversight given it is the only method in a stable trait. r? @aturon because you did final alpha stabilisation of iterators.
2015-02-17Rollup merge of #22294 - nikomatsakis:integer-audit, r=huonwManish Goregaokar-110/+110
cc https://github.com/rust-lang/rust/issues/22240
2015-02-17Add gating for rustc_* attrsManish Goregaokar-0/+1
2015-02-16Update `core::cell` for `isize/usize` transition.Felix S. Klock II-7/+7
2015-02-16Update `core::nonzero` for `isize/usize` migration.Felix S. Klock II-2/+2
2015-02-16Update `core::mem` for `isize/usize` migration.Felix S. Klock II-8/+8
2015-02-15Change arbirary types from `usize` to `u32`.Niko Matsakis-13/+13
2015-02-15Audit integer types in finally.Niko Matsakis-1/+1
2015-02-15Audit integer types in result.Niko Matsakis-48/+48
2015-02-15Audit integer types in ops.Niko Matsakis-13/+13
2015-02-15Fix rollup (remove slicing_syntax)Manish Goregaokar-1/+1
2015-02-15Rollup merge of #22339 - petrochenkov:int, r=huonwManish Goregaokar-107/+109
Some function signatures have changed, so this is a [breaking-change]. In particular, radixes and numerical values of digits are represented by `u32` now. Part of #22240
2015-02-15Rollup merge of #22350 - brson:usize, r=GankroManish Goregaokar-120/+120
cc https://github.com/rust-lang/rust/issues/22240
2015-02-15Rollup merge of #22299 - bluss:range-64-is-not-exact-size, r=alexcrichtonManish Goregaokar-2/+2
Fixes #22047 `Range<u64>` and `Range<i64>` may be longer than usize::MAX on 32-bit platforms, and thus they cannot fulfill the protocol for ExactSizeIterator. We don't want a nonobvious platform dependency in basic iterator traits, so the trait impl is removed. The logic of this change assumes that usize is at least 32-bit. This is technically a breaking change; note that `Range<usize>` and `Range<isize>` are always ExactSizeIterators. [breaking-change]
2015-02-15Rollup merge of #22288 - steveklabnik:add_option_link, r=nikomatsakisManish Goregaokar-1/+1
2015-02-15Rollup merge of #22272 - steveklabnik:gh22064, r=alexcrichtonManish Goregaokar-2/+2
Fixes #22064.
2015-02-15Rollup merge of #22262 - lfairy:unsafe-cell-lang-item, r=alexcrichtonManish Goregaokar-1/+2
`Unsafe` was renamed to `UnsafeCell` a while ago, but the corresponding lang item kept the old name. This patch fixes the inconsistency. r? @eddyb
2015-02-15Rollup merge of #22254 - huonw:float-value--, r=aturonManish Goregaokar-11/+37
In `std::f32` and `std::f64`: - `MIN_VALUE` → `MIN` - `MAX_VALUE` → `MAX` - `MIN_POS_VALUE` → `MIN_POSITIVE` This matches the corresponding integer constants. [breaking-change]
2015-02-15Include "flatmap" in docs of Option::and_thenRobin Stocker-0/+2
Some newcomers might look for a "flatMap" method on Option. Include the reference so that searching the page would find "and_then".
2015-02-14core::slice: uint -> usize, int -> isizeBrian Anderson-117/+117
2015-02-14core: Use int/isize in Clone boilerplateBrian Anderson-2/+2
2015-02-14core::raw: uint -> usizeBrian Anderson-1/+1
2015-02-15Stabilise ExactSizeIterator::lenSimonas Kazlauskas-0/+1
2015-02-15Fix the falloutVadim Petrochenkov-9/+9
2015-02-15Audit integer types in libunicode, libcore/(char, str) and libstd/asciiVadim Petrochenkov-98/+100