about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2015-03-02core: Audit num module for int/uintBrian Anderson-61/+121
* count_ones/zeros, trailing_ones/zeros return u32, not usize * rotate_left/right take u32, not usize * RADIX, MANTISSA_DIGITS, DIGITS, BITS, BYTES are u32, not usize Doesn't touch pow because there's another PR for it. [breaking-change]
2015-03-02Enable recursion for visit_ty in lint visitorIvan Petkov-0/+5
* The lint visitor's visit_ty method did not recurse, and had a reference to the now closed #10894 * The newly enabled recursion has only affected the `deprectated` lint which now detects uses of deprecated items in trait impls and function return types * Renamed some references to `CowString` and `CowVec` to `Cow<str>` and `Cow<[T]>`, respectively, which appear outside of the crate which defines them * Replaced a few instances of `InvariantType<T>` with `PhantomData<Cell<T>>` * Disabled the `deprecated` lint in several places that reference/implement traits on deprecated items which will get cleaned up in the future * Disabled the `exceeding_bitshifts` lint for compile-fail/huge-array-simple test so it doesn't shadow the expected error on 32bit systems * Unfortunately, this means that if a library declares `#![deny(deprecated)]` and marks anything as deprecated, it will have to disable the lint for any uses of said item, e.g. any impl the now deprecated item For any library that denies deprecated items but has deprecated items of its own, this is a [breaking-change]
2015-03-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-1/+1
This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change]
2015-03-02iter: use Option::map() in struct Iterater::map()Lai Jiangshan-16/+3
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
2015-03-02Add missing stability attributes on struct fields.Huon Wilson-0/+2
Unstable is the conservative choice. cc #22950.
2015-03-02Manual Clone for Windows/Chunks.Huon Wilson-2/+22
`#[derive(Clone)]` unnecessarily requires the element type to also be `Clone`.
2015-03-02Rollup merge of #22504 - GuillaumeGomez:audit-integer-libcore, r=ManishearthManish Goregaokar-44/+1
Part of #22240.
2015-03-01Auto merge of #22087 - GuillaumeGomez:int-pow, r=alexcrichtonbors-1/+2
Fixes issue #22016
2015-03-01Rollup merge of #22901 - thepowersgang:patch-1, r=eddybManish Goregaokar-1/+1
A misplaced uint->u32 instead of usize in fmt::Pointer. Added a basic test.
2015-03-01Rollup merge of #22898 - edwardw:one-less-unsafe-impl, r=huonwManish Goregaokar-5/+1
These implementations were temporary workaround. Now #22828 has been fixed, they can be removed.
2015-02-28Cleanup in the fmt::num moduleRyan Prichard-12/+9
* Make num::UpperHex private. I was unable to determine why this struct is public. The num module itself is not public, and the UpperHex struct is not referenced anywhere in the core::fmt module. (Only the UpperHex trait is reference.) num::LowerHex is not public. * Remove the suffix parameters from the macros that generate integral display traits. The code to print the Debug::fmt suffixes was removed when Show was renamed to Debug. It was an intentional change. From RFC 0565: * Focus on the *runtime* aspects of a type; repeating information such as suffixes for integer literals is not generally useful since that data is readily available from the type definition. * Because Show was renamed to Debug, rename show! to debug!.
2015-03-01Fix errors, remove unused filesGuillaumeGomez-41/+0
2015-03-01Remove int/uintGuillaumeGomez-3/+1
2015-03-01Make Int::pow() take exp as u32 instead usizeGuillaume Gomez-1/+2
2015-02-28Fix assuming 32-bit pointersJohn Hodge-1/+1
2015-02-28Remove two unsafe impls from `iter::Peekable`Edward Wang-5/+1
These implementations were temporary workaround. Now #22828 has been fixed, they can be removed.
2015-02-28Rollup merge of #22887 - JP-Ellis:master, r=huonwManish Goregaokar-34/+20
Updated the function to allow comparisons between different types since PartialOrd and PartialEq allow this.
2015-02-28Auto merge of #22669 - dotdash:fast_slice_iter, r=huonwbors-0/+3
This adds the assume() calls back that got lost when rebasing #21886.
2015-02-28Update iter::order to be more generic.JP-Ellis-34/+20
Signed-off-by: JP-Ellis <coujellis@gmail.com>
2015-02-27Rollup merge of #22848 - tshepang:redundant-mention, r=brsonManish Goregaokar-2/+1
2015-02-27Rollup merge of #22833 - laijs:remove-redundant-else-branch, r=dotdashManish Goregaokar-2/+0
The branch \"else { continue }\" is the last code inside a loop body, it is just useless. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
2015-02-27Rollup merge of #22817 - jmesmon:result-or-type, r=huonwManish Goregaokar-2/+2
Changes .or() so that it can return a Result with a different E type than the one it is called on. Essentially: fn or(self, res: Result<T, E>) -> Result<T, E> becomes fn or<F>(self, res: Result<T, F>) -> Result<T, F> This brings `or` in line with the existing `and` & `or_else` This is a [breaking-change] Due to some code needing additional type annotations.
2015-02-27Rollup merge of #22809 - nikomatsakis:issue-22655-infinite-recursion, r=pnkfelixManish Goregaokar-1/+7
Change MarkerTrait to be invariant. This is a (small) loss of expressiveness, but is necessary for now to work around #22806. Fixes #22655. r? @pnkfelix
2015-02-27Rollup merge of #22795 - alexcrichton:issue-22617, r=huonwManish Goregaokar-2/+2
Keeps the method consistent with `Iterator::any`. Closes #22617 [breaking-change]
2015-02-27Rollup merge of #22818 - pnkfelix:fsk-issue-22536, r=nikomatsakisManish Goregaokar-1/+6
Ensure we do not zero when \"moving\" types that are Copy. Uses more precise `type_needs_drop` for deciding about emitting cleanup code. Added notes about the weaknesses regarding `ty::type_contents` here. Fix #22536
2015-02-27Rollup merge of #22803 - huonw:field-stability, r=alexcrichtonManish Goregaokar-0/+1
We were recording stability attributes applied to fields in the compiler, and even annotating it in the libs, but the compiler didn't actually do the checks to give errors/warnings in user crates. Details in the commit messages.
2015-02-27Auto merge of #22853 - FlaPer87:snap, r=alexcrichtonbors-54/+0
r? @alexcrichton cc @nikomatsakis @pnkfelix
2015-02-27Add some missing stability attributes on struct fields.Huon Wilson-0/+1
2015-02-27register snapshot 880fb89Flavio Percoco-54/+0
2015-02-26doc: the last mention of the word 'iterator' is redundantTshepang Lekhonkhobe-2/+1
2015-02-26Add doc to `core::intrinsics` pointing out conservativeness of `needs_drop`.Felix S. Klock II-1/+6
2015-02-26remove the redundant else branchLai Jiangshan-2/+0
The branch "else { continue }" is the last code inside a loop body, it is just useless. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
2015-02-26Send/Sync audit for libcollectionsEdward Wang-2/+11
In the process, also replaces a raw mutable pointers with Unique to spell out the ownership semantics. cc #22709
2015-02-25Result::or : avoid over-specializing the typeCody P Schafer-2/+2
Changes .or() so that it can return a Result with a different E type than the one it is called on. Essentially: fn or(self, res: Result<T, E>) -> Result<T, E> becomes fn or<F>(self, res: Result<T, F>) -> Result<T, F> This brings `or` in line with the existing `and` and `or_else` member types. This is a [breaking-change] Due to some code needing additional type annotations.
2015-02-25Change MarkerTrait to be invariant. This is a (small) loss of expressiveness,Niko Matsakis-1/+7
but is necessary for now to work around #22806. Fixes #22655.
2015-02-24std: Require `&mut self` for Iterator::allAlex Crichton-2/+2
Keeps the method consistent with `Iterator::any`. Closes #22617 [breaking-change]
2015-02-25Rollup merge of #22729 - alexcrichton:ptr-stabilization, r=aturonManish Goregaokar-64/+66
Specifically, the following actions were takend: * The `copy_memory` and `copy_nonoverlapping_memory` functions to drop the `_memory` suffix (as it's implied by the functionality). Both functions are now marked as `#[stable]`. * The `set_memory` function was renamed to `write_bytes` and is now stable. * The `zero_memory` function is now deprecated in favor of `write_bytes` directly. * The `Unique` pointer type is now behind its own feature gate called `unique` to facilitate future stabilization. [breaking-change]
2015-02-25Rollup merge of #22635 - kmcallister:macros-chapter, r=steveklabnikManish Goregaokar-1/+1
r? @steveklabnik
2015-02-24std: Stabilize some `ptr` functionsAlex Crichton-64/+66
Specifically, the following actions were taken: * The `copy_memory` and `copy_nonoverlapping_memory` functions to drop the `_memory` suffix (as it's implied by the functionality). Both functions are now marked as `#[stable]`. * The `set_memory` function was renamed to `write_bytes` and is now stable. * The `zero_memory` function is now deprecated in favor of `write_bytes` directly. * The `Unique` pointer type is now behind its own feature gate called `unique` to facilitate future stabilization. * All type parameters now are `T: ?Sized` wherever possible and new clauses were added to the `offset` functions to require that the type is sized. [breaking-change]
2015-02-25Rollup merge of #22747 - krdln:fix-parsing-minus, r=alexcrichtonManish Goregaokar-0/+1
Makes Rust less amusing by fixing [#22745](https://github.com/rust-lang/rust/issues/22745)
2015-02-24Use arrays instead of vectors in testsVadim Petrochenkov-5/+5
2015-02-24core: fix typo that wasn't caught by the hacky previous implementation.Eduard Burtescu-1/+1
2015-02-24Rollup merge of #22730 - ipetkov:lint-docs, r=alexcrichtonManish Goregaokar-0/+22
This is a breaking change if missing docs are forbidden in any module or crate. I had to add documentation to undocumented associated types in libstd and libcore, please let me know if the documentation is inadequate anywhere! Fixes #20648
2015-02-24Rollup merge of #22700 - nick29581:ints_hash, r=alexcrichtonManish Goregaokar-40/+59
fmt and hash are pretty straightforward I think. sync is a bit more complex. I thought one or two of the `isize`s ought to be `i32`s, but that would require a bunch of casting (the root cause being the lack of atomics other than isize/usize). r? @alexcrichton
2015-02-24Rollup merge of #22632 - nagisa:kill-show-string-with-fire!, r=alexcrichtonManish Goregaokar-32/+0
Toss the tomatoes! r? @aturon Fixes #22478. The underlying bug(?) behind that issue still exists though and there’s another issue that reports it.
2015-02-24Stop parsing "-" as integer, fixes #22745Michał Krasnoborski-0/+1
2015-02-24Auto merge of #21689 - FlaPer87:oibit-send-and-friends, r=nikomatsakisbors-1/+12
This is one more step towards completing #13231 This series of commits add support for default trait implementations. The changes in this PR don't break existing code and they are expected to preserve the existing behavior in the compiler as far as built-in bounds checks go. The PR adds negative implementations of `Send`/`Sync` for some types and it removes the special cases for `Send`/`Sync` during the trait obligations checks. That is, it now fully relies on the traits check rather than lang items. Once this patch lands and a new snapshot is created, it'll be possible to add default impls for `Send` and `Sync` and remove entirely the use of `BuiltinBound::{BoundSend,BoundSync}` for positive implementations as well. This PR also removes the restriction on negative implementations. That is, it is now possible to add negative implementations for traits other than `Send`/`Sync`
2015-02-23Rollup merge of #22320 - petrochenkov:eq, r=alexcrichtonManish Goregaokar-43/+61
2015-02-23Add documentation to associated types in libcore, libstdIvan Petkov-0/+22
2015-02-23int audit core::hashNick Cameron-4/+4