about summary refs log tree commit diff
path: root/src/libnum
AgeCommit message (Collapse)AuthorLines
2014-10-19Remove a number of deprecated cratesAlex Crichton-4723/+0
All of these crates have been deprecated for some time and properly live in the rust-lang organization as cargo-based crates. To update your code, depend on the rust-lang/foo repository via cargo. [breaking-change]
2014-10-13Clean up rustc warnings.NODA, Kai-0/+1
compiletest: compact "linux" "macos" etc.as "unix". liballoc: remove a superfluous "use". libcollections: remove invocations of deprecated methods in favor of their suggested replacements and use "_" for a loop counter. libcoretest: remove invocations of deprecated methods; also add "allow(deprecated)" for testing a deprecated method itself. libglob: use "cfg_attr". libgraphviz: add a test for one of data constructors. libgreen: remove a superfluous "use". libnum: "allow(type_overflow)" for type cast into u8 in a test code. librustc: names of static variables should be in upper case. libserialize: v[i] instead of get(). libstd/ascii: to_lowercase() instead of to_lower(). libstd/bitflags: modify AnotherSetOfFlags to use i8 as its backend. It will serve better for testing various aspects of bitflags!. libstd/collections: "allow(deprecated)" for testing a deprecated method itself. libstd/io: remove invocations of deprecated methods and superfluous "use". Also add #[test] where it was missing. libstd/num: introduce a helper function to effectively remove invocations of a deprecated method. libstd/path and rand: remove invocations of deprecated methods and superfluous "use". libstd/task and libsync/comm: "allow(deprecated)" for testing a deprecated method itself. libsync/deque: remove superfluous "unsafe". libsync/mutex and once: names of static variables should be in upper case. libterm: introduce a helper function to effectively remove invocations of a deprecated method. We still see a few warnings about using obsoleted native::task::spawn() in the test modules for libsync. I'm not sure how I should replace them with std::task::TaksBuilder and native::task::NativeTaskBuilder (dependency to libstd?) Signed-off-by: NODA, Kai <nodakai@gmail.com>
2014-10-10auto merge of #17853 : alexcrichton/rust/issue-17718, r=pcwaltonbors-10/+10
This change is an implementation of [RFC 69][rfc] which adds a third kind of global to the language, `const`. This global is most similar to what the old `static` was, and if you're unsure about what to use then you should use a `const`. The semantics of these three kinds of globals are: * A `const` does not represent a memory location, but only a value. Constants are translated as rvalues, which means that their values are directly inlined at usage location (similar to a #define in C/C++). Constant values are, well, constant, and can not be modified. Any "modification" is actually a modification to a local value on the stack rather than the actual constant itself. Almost all values are allowed inside constants, whether they have interior mutability or not. There are a few minor restrictions listed in the RFC, but they should in general not come up too often. * A `static` now always represents a memory location (unconditionally). Any references to the same `static` are actually a reference to the same memory location. Only values whose types ascribe to `Sync` are allowed in a `static`. This restriction is in place because many threads may access a `static` concurrently. Lifting this restriction (and allowing unsafe access) is a future extension not implemented at this time. * A `static mut` continues to always represent a memory location. All references to a `static mut` continue to be `unsafe`. This is a large breaking change, and many programs will need to be updated accordingly. A summary of the breaking changes is: * Statics may no longer be used in patterns. Statics now always represent a memory location, which can sometimes be modified. To fix code, repurpose the matched-on-`static` to a `const`. static FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } change this code to: const FOO: uint = 4; match n { FOO => { /* ... */ } _ => { /* ... */ } } * Statics may no longer refer to other statics by value. Due to statics being able to change at runtime, allowing them to reference one another could possibly lead to confusing semantics. If you are in this situation, use a constant initializer instead. Note, however, that statics may reference other statics by address, however. * Statics may no longer be used in constant expressions, such as array lengths. This is due to the same restrictions as listed above. Use a `const` instead. [breaking-change] Closes #17718 [rfc]: https://github.com/rust-lang/rfcs/pull/246
2014-10-09Use the same html_root_url for all docsBrian Anderson-1/+1
2014-10-09Revert "Update html_root_url for 0.12.0 release"Brian Anderson-1/+1
This reverts commit 2288f332301b9e22db2890df256322650a7f3445.
2014-10-09num: Convert statics to constantsAlex Crichton-10/+10
2014-10-07Update html_root_url for 0.12.0 releaseBrian Anderson-1/+1
2014-10-07Put slicing syntax behind a feature gate.Nick Cameron-1/+2
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-07Use slice syntax instead of slice_to, etc.Nick Cameron-2/+2
2014-10-03Set the `non_uppercase_statics` lint to warn by defaultP1start-30/+36
2014-10-02Revert "Use slice syntax instead of slice_to, etc."Aaron Turon-2/+2
This reverts commit 40b9f5ded50ac4ce8c9323921ec556ad611af6b7.
2014-10-02Revert "Put slicing syntax behind a feature gate."Aaron Turon-2/+1
This reverts commit 95cfc35607ccf5f02f02de56a35a9ef50fa23a82.
2014-10-02Put slicing syntax behind a feature gate.Nick Cameron-1/+2
[breaking-change] If you are using slicing syntax you will need to add #![feature(slicing_syntax)] to your crate.
2014-10-02Use slice syntax instead of slice_to, etc.Nick Cameron-2/+2
2014-09-23Deprecate `#[ignore(cfg(...))]`Steven Fackler-1/+1
Replace `#[ignore(cfg(a, b))]` with `#[cfg_attr(all(a, b), ignore)]`
2014-09-23Fix regression and overflow bug for rationals.Joseph Crail-5/+44
2014-09-22Fix deprecation warnings in check-docs.Victor Berger-0/+10
Fallout of closing #17185.
2014-09-22auto merge of #17339 : treeman/rust/doc-things, r=alexcrichtonbors-20/+20
Also some cleanup to conform to documentation style.
2014-09-19Add enum variants to the type namespaceNick Cameron-31/+31
Change to resolve and update compiler and libs for uses. [breaking-change] Enum variants are now in both the value and type namespaces. This means that if you have a variant with the same name as a type in scope in a module, you will get a name clash and thus an error. The solution is to either rename the type or the variant.
2014-09-17Test fixes from the rollupAlex Crichton-0/+3
2014-09-17doc: Cleanup.Jonas Hietala-20/+20
Remove ~~~ for code block specification. Use /// Over /** */ for doc blocks.
2014-09-16Deprecate libnum in favor of rust-lang/numAaron Turon-1/+3
This is part of the migration of crates into the Cargo ecosystem. There is now an external repository https://github.com/rust-lang/num for bignums. The single use of libnum elsewhere in the repository is for a shootout benchmark, which is being moved into the external crate. Due to deprecation, this is a: [breaking-change]
2014-09-09Remove some test warnings.Jonas Hietala-42/+42
2014-09-07auto merge of #17005 : bjz/rust/bit-count, r=thestingerbors-1/+1
Fixes rust-lang/rfcs#224
2014-09-05auto merge of #16775 : jbcrail/rust/fix-rational-docs, r=pcwaltonbors-2/+2
Minor corrections to Rational documentation.
2014-09-05Make integer bit count methods return uintsBrendan Zabarauskas-1/+1
Fixes rust-lang/rfcs#224
2014-09-02auto merge of #16850 : vks/rust/hash-num, r=alexcrichtonbors-8/+24
Updates #15294.
2014-08-31Fix whitespace and missing parentheses.Joseph Crail-2/+2
2014-08-30rollup merge of #16778 : jbcrail/fix-issue-15826Alex Crichton-6/+29
2014-08-30Unify non-snake-case lints and non-uppercase statics lintsP1start-0/+1
This unifies the `non_snake_case_functions` and `uppercase_variables` lints into one lint, `non_snake_case`. It also now checks for non-snake-case modules. This also extends the non-camel-case types lint to check type parameters, and merges the `non_uppercase_pattern_statics` lint into the `non_uppercase_statics` lint. Because the `uppercase_variables` lint is now part of the `non_snake_case` lint, all non-snake-case variables that start with lowercase characters (such as `fooBar`) will now trigger the `non_snake_case` lint. New code should be updated to use the new `non_snake_case` lint instead of the previous `non_snake_case_functions` and `uppercase_variables` lints. All use of the `non_uppercase_pattern_statics` should be replaced with the `non_uppercase_statics` lint. Any code that previously contained non-snake-case module or variable names should be updated to use snake case names or disable the `non_snake_case` lint. Any code with non-camel-case type parameters should be changed to use camel case or disable the `non_camel_case_types` lint. [breaking-change]
2014-08-29complex: use `///...` instead of `/**...*/` for commentVinzent Steinberg-4/+2
2014-08-29num: implement `Hash` for `Complex` and `Ratio`Vinzent Steinberg-4/+22
2014-08-28Fix issue #15826.Joseph Crail-6/+29
The implemented fix rounds half-way cases away from zero as described in the original comments. This rounding algorithm is sometimes called arithmetic rounding. It is described further here: http://en.wikipedia.org/wiki/Rounding#Round_half_away_from_zero I also added several new tests to prevent regressions.
2014-08-26Use temp vars for implicit coercion to ^[T]Nick Cameron-3/+3
2014-08-17auto merge of #16558 : Gankro/rust/hashbig, r=pcwaltonbors-1/+55
Pretty self-explanatory. Only annoying thing is that it *seems* that I had to add `#![feature(default_type_params)]` to libnum because of Hasher. Don't know if there's a way around that. Fix #16551
2014-08-17Make BigUint and BigInt Hash, fixes #16551Alexis Beingessner-1/+55
2014-08-16auto merge of #16475 : treeman/rust/complex-divide-by-zero-test, r=alexcrichtonbors-0/+8
Did not find a test for it.
2014-08-14Add a test for complex divide by zero.Jonas Hietala-0/+8
2014-08-13core: Change the argument order on splitn and rsplitn for strs.Brian Anderson-2/+2
This makes it consistent with the same functions for slices, and allows the search closure to be specified last. [breaking-change]
2014-08-06Use byte literal in libnumnham-1/+1
2014-07-29Improve documentation of rounding functionsPiotr Jawniak-8/+19
2014-07-29Rename Integer trait `divides` to `is_multiple_of`.Jonas Hietala-20/+43
It is being changed because the previous wording was ambiguous. `a.divides(b)` implied `a % b == 0` but it sounds like the other way around. `9.divides(&3) == true` but we might read that as "does 9 divide 3?". It has been renamed to sidestep the ambiguity. Work around the change by using `is_multiple_of` instead. [breaking-change]
2014-07-17auto merge of #15718 : treeman/rust/integer-doc, r=alexcrichtonbors-18/+90
Simple usage examples for Integer methods. Also group `div_rem` and `div_mod_floor` together at the bottom of the trait, to reflect the documentation rendering.
2014-07-16Main example for bigint usage.Jonas Hietala-42/+68
Also use `///` for documentation instead of `/**`. End comments with `.`. Show imports for bigint example. They might be useful.
2014-07-16Examples for Integer trait methods.Jonas Hietala-18/+90
2014-07-11Update doc URLs for version bumpBrian Anderson-1/+1
2014-07-09Register new snapshotsAlex Crichton-2/+0
Closes #15544
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-7/+8
[breaking-change]
2014-07-06auto merge of #15417 : pfalabella/rust/rational-signed, r=alexcrichtonbors-0/+44
2014-07-05Add #[crate_name] attributes as necessaryAlex Crichton-2/+3