| Age | Commit message (Collapse) | Author | Lines |
|
Closes #12640
|
|
port all code over to use it.
|
|
This also changes some of the download links in the documentation
to 'nightly'.
|
|
Merging the 0.10 release into the master branch.
|
|
|
|
|
|
|
|
These were only free functions on `~[T]` because taking self by-value
used to be broken.
|
|
Closes #2569
|
|
value
|
|
|
|
`TotalEq` is now just an assertion about the `Eq` impl of a
type (i.e. `==` is a total equality if a type implements `TotalEq`) so
the extra method is just confusing.
Also, a new method magically appeared as a hack to allow deriving to
assert that the contents of a struct/enum are also TotalEq, because the
deriving infrastructure makes it very hard to do anything but create a
trait method. (You didn't hear about this horrible work-around from me
:(.)
|
|
|
|
`~[T]` in test, libgetopts, compiletest, librustdoc, and libnum.
|
|
It's now in the prelude.
|
|
Closes #12771
|
|
I also removed a couple of methods that were silly and added sort.
|
|
|
|
|
|
|
|
This is useless at the moment (since pretty much every crate uses
`~[]`), but should help avoid regressions once completely removed from a
crate.
|
|
Closes #7141.
|
|
|
|
only lowercase characters
|
|
|
|
Formatting via reflection has been a little questionable for some time now, and
it's a little unfortunate that one of the standard macros will silently use
reflection when you weren't expecting it. This adds small bits of code bloat to
libraries, as well as not always being necessary. In light of this information,
this commit switches assert_eq!() to using {} in the error message instead of
{:?}.
In updating existing code, there were a few error cases that I encountered:
* It's impossible to define Show for [T, ..N]. I think DST will alleviate this
because we can define Show for [T].
* A few types here and there just needed a #[deriving(Show)]
* Type parameters needed a Show bound, I often moved this to `assert!(a == b)`
* `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths.
I don't think this is much of a regression though because {:?} on paths looks
awful (it's a byte array).
Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime
significant for smaller binaries.
|
|
|
|
|
|
This also inverts the dependency between libserialize and libcollections.
cc #8784
|
|
This commit changes the ToStr trait to:
impl<T: fmt::Show> ToStr for T {
fn to_str(&self) -> ~str { format!("{}", *self) }
}
The ToStr trait has been on the chopping block for quite awhile now, and this is
the final nail in its coffin. The trait and the corresponding method are not
being removed as part of this commit, but rather any implementations of the
`ToStr` trait are being forbidden because of the generic impl. The new way to
get the `to_str()` method to work is to implement `fmt::Show`.
Formatting into a `&mut Writer` (as `format!` does) is much more efficient than
`ToStr` when building up large strings. The `ToStr` trait forces many
intermediate allocations to be made while the `fmt::Show` trait allows
incremental buildup in the same heap allocated buffer. Additionally, the
`fmt::Show` trait is much more extensible in terms of interoperation with other
`Writer` instances and in more situations. By design the `ToStr` trait requires
at least one allocation whereas the `fmt::Show` trait does not require any
allocations.
Closes #8242
Closes #9806
|
|
|
|
I don't think `extra` is a good/meaningful name for a library. `libextra` should disappear, and we move all of its sub modules out of it. This PR is just one of that steps: move `extra::test` to `libtest`.
I didn't add `libtest` to doc index, because it's an internal library currently.
**Update:**
All comments addressed. All tests passed. Rebased and squashed.
|
|
|
|
Closes #12383.
Test suite did not capture this and can't as long as it is in the same module hierarchy. This is probably something that should be addressed in the future.
|
|
Preparatory work for removing unique vectors from the language, which is
itself preparatory work for dynamically sized types.
|
|
Closes #12383.
|
|
This is part of the effort to simplify `std::num`, as tracked in issue #10387.
|
|
This was previously implemented, and it just needed a snapshot to go through
|
|
|
|
::num::bigint, Remove a source of O(n^2) running time in `fn shr_bits`.
I'll cut to the chase: On my laptop, this brings the running time on
`pidigits 2000` (from src/test/bench/shootout-pidigits.rs) from this:
```
% time ./pidigits 2000 > /dev/null
real 0m7.695s
user 0m7.690s
sys 0m0.005s
```
to this:
```
% time ./pidigits 2000 > /dev/null
real 0m0.322s
user 0m0.318s
sys 0m0.004s
```
The previous code was building up a vector by repeatedly making a
fresh copy for each element that was unshifted onto the front,
yielding quadratic running time. This fixes that by building up the
vector in reverse order (pushing elements onto the end) and then
reversing it.
(Another option would be to build up a zero-initialized vector of the
desired length and then installing all of the shifted result elements
into their target index, but this was easier to hack up quickly, and
yields the desired asymptotic improvement. I have been thinking of
adding a `vec::from_fn_rev` to handle this case, maybe I will try that
this weekend.)
|
|
Removed use of globs present in earlier versions of modules.
Fix tutorial.md to reflect `extra::rational` ==> `num::rational`.
|