about summary refs log tree commit diff
path: root/src/libstd/num/strconv.rs
AgeCommit message (Collapse)AuthorLines
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-556/+0
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-21Model lexer: Fix remaining issuesPiotr Czarnecki-2/+0
2015-04-14test: Fixup many library unit testsAlex Crichton-14/+14
2015-04-01Fallout in public-facing and semi-public-facing libsNiko Matsakis-3/+3
2015-03-31Stabilize std::numAaron Turon-0/+1
This commit stabilizes the `std::num` module: * The `Int` and `Float` traits are deprecated in favor of (1) the newly-added inherent methods and (2) the generic traits available in rust-lang/num. * The `Zero` and `One` traits are reintroduced in `std::num`, which together with various other traits allow you to recover the most common forms of generic programming. * The `FromStrRadix` trait, and associated free function, is deprecated in favor of inherent implementations. * A wide range of methods and constants for both integers and floating point numbers are now `#[stable]`, having been adjusted for integer guidelines. * `is_positive` and `is_negative` are renamed to `is_sign_positive` and `is_sign_negative`, in order to address #22985 * The `Wrapping` type is moved to `std::num` and stabilized; `WrappingOps` is deprecated in favor of inherent methods on the integer types, and direct implementation of operations on `Wrapping<X>` for each concrete integer type `X`. Closes #22985 Closes #21069 [breaking-change]
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-26/+26
Now that support has been removed, all lingering use cases are renamed.
2015-03-18Register new snapshotsAlex Crichton-7/+0
2015-03-16impl<T> [T]Jorge Aparicio-0/+1
2015-03-16impl strJorge Aparicio-0/+1
2015-03-16impl charJorge Aparicio-0/+3
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-7/+7
2015-03-03Auto merge of #22532 - pnkfelix:arith-overflow, r=pnkfelix,eddybbors-4/+5
Rebase and follow-through on work done by @cmr and @aatch. Implements most of rust-lang/rfcs#560. Errors encountered from the checks during building were fixed. The checks for division, remainder and bit-shifting have not been implemented yet. See also PR #20795 cc @Aatch ; cc @nikomatsakis
2015-03-03Rollup merge of #22876 - Florob:const, r=nikomatsakisManish Goregaokar-2/+2
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-03Accommodate arith-overflow in `core::num`, `std::num`, `coretest::num`.Felix S. Klock II-4/+5
* `core::num`: adjust `UnsignedInt::is_power_of_two`, `UnsignedInt::next_power_of_two`, `Int::pow`. In particular for `Int::pow`: (1.) do not panic when `base` overflows if `acc` never observes the overflowed `base`, and (2.) if `acc` does observe the overflowed `base`, make sure we only panic if we would have otherwise (e.g. during a computation of `base * base`). * also in `core::num`: avoid underflow during computation of `uint::MAX`. * `std::num`: adjust tests `uint::test_uint_from_str_overflow`, `uint::test_uint_to_str_overflow`, `strconv` * `coretest::num`: adjust `test::test_int_from_str_overflow`.
2015-03-02core: Audit num module for int/uintBrian Anderson-2/+2
* 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-02Use `const`s instead of `static`s where appropriateFlorian Zeitz-2/+2
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-02-18Remove `i`, `is`, `u`, or `us` suffixes that are not necessary.Niko Matsakis-3/+3
2015-02-15Fix the falloutVadim Petrochenkov-7/+7
2015-02-04remove all kind annotations from closuresJorge Aparicio-2/+2
2015-02-04Deprecate in-tree `rand`, `std::rand` and `#[derive(Rand)]`.Huon Wilson-0/+1
Use the crates.io crate `rand` (version 0.1 should be a drop in replacement for `std::rand`) and `rand_macros` (`#[derive_Rand]` should be a drop-in replacement). [breaking-change]
2015-01-21Fallout from stabilization.Aaron Turon-2/+2
2015-01-05Merge `UnicodeChar` and `CharExt`.Huon Wilson-1/+1
This "reexports" all the functionality of `core::char::CharExt` as methods on `unicode::u_char::UnicodeChar` (renamed to `CharExt`). Imports may need to be updated (one now just imports `unicode::CharExt`, or `std::char::CharExt` rather than two traits from either), so this is a [breaking-change]
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-3/+3
2015-01-03sed -i -s 's/\bmod,/self,/g' **/*.rsJorge Aparicio-2/+2
2015-01-02merge `*SliceExt` traits, use assoc types in `SliceExt`, `Raw[Mut]Ptr`Jorge Aparicio-1/+1
2015-01-02Fallout - change array syntax to use `;`Nick Cameron-1/+1
2014-12-31std: unbox closures used in let bindingsJorge Aparicio-2/+2
2014-12-23Rename and namespace `FPCategory`Tobias Bucher-4/+5
Rename `FPCategory` to `FpCategory` and `Fp* to `*` in order to adhere to the naming convention This is a [breaking-change]. Existing code like this: ``` use std::num::{FPCategory, FPNaN}; ``` should be adjusted to this: ``` use std::num::FpCategory as Fp ``` In the following code you can use the constants `Fp::Nan`, `Fp::Normal`, etc.
2014-12-21Fallout of std::str stabilizationAlex Crichton-1/+1
2014-12-21Remove a ton of public reexportsCorey Farwell-3/+3
Remove most of the public reexports mentioned in #19253 These are all leftovers from the enum namespacing transition In particular: * src/libstd/num/strconv.rs * ExponentFormat * SignificantDigits * SignFormat * src/libstd/path/windows.rs * PathPrefix * src/libstd/sys/windows/timer.rs * Req * src/libcollections/str.rs * MaybeOwned * src/libstd/collections/hash/map.rs * Entry * src/libstd/collections/hash/table.rs * BucketState * src/libstd/dynamic_lib.rs * Rtld * src/libstd/io/net/ip.rs * IpAddr * src/libstd/os.rs * MemoryMapKind * MapOption * MapError * src/libstd/sys/common/net.rs * SocketStatus * InAddr * src/libstd/sys/unix/timer.rs * Req [breaking-change]
2014-12-19libstd: use `#[deriving(Copy)]`Jorge Aparicio-7/+3
2014-12-14std: Collapse SlicePrelude traitsAlex Crichton-5/+3
This commit collapses the various prelude traits for slices into just one trait: * SlicePrelude/SliceAllocPrelude => SliceExt * CloneSlicePrelude/CloneSliceAllocPrelude => CloneSliceExt * OrdSlicePrelude/OrdSliceAllocPrelude => OrdSliceExt * PartialEqSlicePrelude => PartialEqSliceExt
2014-12-13libstd: use unboxed closuresJorge Aparicio-1/+5
2014-12-09Rollback accidental documentation changesTobias Bucher-29/+21
These probably happened during the merge of the commit that made `Copy` opt-in. Also, convert the last occurence of `/**` to `///` in `src/libstd/num/strconv.rs`
2014-12-08librustc: Make `Copy` opt-in.Niko Matsakis-19/+32
This change makes the compiler no longer infer whether types (structures and enumerations) implement the `Copy` trait (and thus are implicitly copyable). Rather, you must implement `Copy` yourself via `impl Copy for MyType {}`. A new warning has been added, `missing_copy_implementations`, to warn you if a non-generic public type has been added that could have implemented `Copy` but didn't. For convenience, you may *temporarily* opt out of this behavior by using `#![feature(opt_out_copy)]`. Note though that this feature gate will never be accepted and will be removed by the time that 1.0 is released, so you should transition your code away from using it. This breaks code like: #[deriving(Show)] struct Point2D { x: int, y: int, } fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } Change this code to: #[deriving(Show)] struct Point2D { x: int, y: int, } impl Copy for Point2D {} fn main() { let mypoint = Point2D { x: 1, y: 1, }; let otherpoint = mypoint; println!("{}{}", mypoint, otherpoint); } This is the backwards-incompatible part of #13231. Part of RFC #3. [breaking-change]
2014-12-06libstd: remove unnecessary `to_string()` callsJorge Aparicio-8/+8
2014-11-27Documentation fix for std::num::strconvBarosl Lee-41/+35
- int_to_str_bytes_common() doesn't have a return value. - float_to_str_bytes_common() has an old-style doc comment.
2014-11-25/** -> ///Steve Klabnik-25/+26
This is considered good convention.
2014-11-21Fix various deprecation warnings from char changesBrian Anderson-1/+2
2014-11-17Switch to purely namespaced enumsSteven Fackler-0/+4
This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change]
2014-11-16Move ToString to collections::stringBrendan Zabarauskas-1/+1
This also impls `FormatWriter` for `Vec<u8>`
2014-11-16Move FromStr to core::strBrendan Zabarauskas-232/+21
2014-11-14auto merge of #18880 : barosl/rust/doc-fail-to-panic, r=alexcrichtonbors-6/+6
I found some occurrences of "failure" and "fails" in the documentation. I changed them to "panics" if it means a task panic. Otherwise I left it as is, or changed it to "errors" to clearly distinguish them. Also, I made a minor fix that is breaking the layout of a module page. "Example" is shown in an irrelevant place from the following page: http://doc.rust-lang.org/std/os/index.html
2014-11-13Deprecate Num, Unsigned and PrimitiveBrendan Zabarauskas-1/+1
2014-11-13Deprecate Zero and One traitsBrendan Zabarauskas-9/+9
2014-11-13Deprecate Bounded traitBrendan Zabarauskas-3/+2
2014-11-13Move checked arithmetic operators into Int traitBrendan Zabarauskas-4/+4
2014-11-12Fix remaining documentation to reflect fail!() -> panic!()Barosl Lee-6/+6
Throughout the docs, "failure" was replaced with "panics" if it means a task panic. Otherwise, it remained as is, or changed to "errors" to clearly differentiate it from a task panic.
2014-11-07Fixing #18659juxiliary-1/+17
Changes the radix multiplier to start at -0.0 instead of -1.0 when reading strings that start with '-'.
2014-11-06Prelude: rename and consolidate extension traitsAaron Turon-2/+2
This commit renames a number of extension traits for slices and string slices, now that they have been refactored for DST. In many cases, multiple extension traits could now be consolidated. Further consolidation will be possible with generalized where clauses. The renamings are consistent with the [new `-Prelude` suffix](https://github.com/rust-lang/rfcs/pull/344). There are probably a few more candidates for being renamed this way, but that is left for API stabilization of the relevant modules. Because this renames traits, it is a: [breaking-change] However, I do not expect any code that currently uses the standard library to actually break. Closes #17917