| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Also added unit tests of range code to test refactoring. The
num-range-rev.rs test will need to be updated when the range_rev
semantics change.
|
|
The free-standing functions in f32, f64, i8, i16, i32, i64, u8, u16,
u32, u64, float, int, and uint are replaced with generic functions in
num instead.
If you were previously using any of those functions, just replace them
with the corresponding function with the same name in num.
Note: If you were using a function that corresponds to an operator, use
the operator instead.
|
|
|
|
Continuation of #7430.
I haven't removed the `map` method, since the replacement `v.iter().transform(f).collect::<~[SomeType]>()` is a little ridiculous at the moment.
|
|
This allows the integral paths to avoid allocations on the heap
Closes #4424, #4423
|
|
|
|
They evaluated the receiver twice. They should be added back with
`AddAssign`, `SubAssign`, etc., traits.
|
|
This is the backwards-incompatible part of per-binding-site "mut".
|
|
|
|
|
|
|
|
.as_bytes_with_null[_consume]().
The first acts on &str and is not nul-terminated, the last two act on strings
that are always null terminated (&'static str, ~str and @str).
|
|
|
|
|
|
You can still initialize multiple variables at once with "let (x, y) = (1, 2)".
|
|
|
|
Adds documentation for various things that I understand.
Adds #[allow(missing_doc)] for lots of things that I don't understand.
|
|
|
|
|
|
|
|
|
|
This works with pandoc linked against highlighting-kate >= 0.5.3.8. It seems to just be a no-op with earlier versions, because I successfully ran this through `try`.
This also fixes some consistency issues (like making `Example`/`Examples` always a header and always using three tildes).
|
|
|
|
There were several old `#[doc(hidden)]` attributes in libstd and
libextra, left over from when rustdoc didn't hide private
definitions, tagged with `FIXME #3538`.
Since #3538 is now closed, I removed the `#[doc(hidden)]` attributes
as well as the FIXMEs, but I left `#[doc(hidden)]` in
libstd/task/spawn.rs and libstd/task/rt.rs since those two are
apparently `pub`, as well as in libextra/std.rc since std/extra is
`pub`.
|
|
|
|
|
|
This only changes the directory names; it does not change the "real"
metadata names.
|
|
|
|
`std::ratio` module contains `BigRational` type, but the type is not usable by following reasons.
* `Ratio::new` requires `T: Copy + Num + Ord`, but `BigInt` is not implicitly copyable, because it contains unique vector.
* `BigInt` is not implements `Num`
So, I rewrite `Ratio` as follows.
* `Ratio` requires `T: Clone + Integer + Ord`.
* `Copy` -> `Clone`: to be able to use `BigRational`
* `Num` -> `Integer`: It is incorrect that a rational number constructed by two non-integer numbers.
* `BigInt` implements `Num` and `Orderable` which are required by `Integer` bound
|
|
fail!() used to require owned strings but can handle static strings
now. Also, it can pass its arguments to fmt!() on its own, no need for
the caller to call fmt!() itself.
|
|
|
|
This allows creating `Ratio<T>` which `T` is non-implicitly copyable types
such as `BigInt`.
|
|
|
|
|
|
|
|
`BigUint::is_even()` didn't return correct value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`std::bigint` contains the following code.
```rust
borrow = *elem << (uint::bits - n_bits);
```
The code above contains a bug that the value of the right operand of the shift operator exceeds the size of the left operand,
because sizeof(*elem) == 32, and 0 <= n_bits < 32 in 64bit architecture.
If `--opt-level` option is not given to rustc, the code above runs as if the right operand is `(uint::bits - n_bits) % 32`,
but if --opt-level is given, `borrow` is always zero.
I wonder why this bug is not catched in the libstd's testsuite (I try the `rustc --test --opt-level=2 bigint.rs` before fixing the bug,
but the unittest passes normally.)
This pull request also removes the implicit vector copies in `bigint.rs`.
|
|
'is_even'
|
|
|
|
borrow = *elem << (uint::bits - n_bits);
The code above contains a bug that the value of the right operand of the shift operator exceeds the size of the left operand,
because sizeof(*elem) == 32, and 0 <= n_bits < 32 in 64bit architecture.
If `--opt-level` option is not given to rustc, the code above runs as if the right operand is `(uint::bits - n_bits) % 32`,
but if --opt-level is given, `borrow` is always zero.
I wonder why this bug is not catched in the libstd's testsuite (I try the `rustc --test --opt-level=2 bigint.rs` before fixing the bug,
but the unittest passes normally.)
|