about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2013-03-22librustc: Add explicit lifetime binders and new lifetime notation in ↵Patrick Walton-116/+135
core/std/syntax/rustc
2013-03-22libsyntax: Stop parsing `const`.Patrick Walton-1/+13
2013-03-22librustc: Remove the `const` declaration form everywherePatrick Walton-1063/+1061
2013-03-22libsyntax: Introduce the new `assert!` macro; make `assert` no longer a keywordPatrick Walton-12/+16
2013-03-22libsyntax: Stop parsing `pure` and `static`Patrick Walton-8/+26
2013-03-22remove obsolete purity workaroundsDaniel Micay-117/+101
2013-03-22trie: make the TrieSet impl publicDaniel Micay-2/+1
2013-03-22trie: inline the other TrieSet wrapper methodsDaniel Micay-0/+3
2013-03-22trie: rm workaround for issue #3469Daniel Micay-2/+1
2013-03-22auto merge of #5488 : pcwalton/rust/depure, r=pcwaltonbors-2553/+2517
2013-03-22test: Remove `pure` from the test suitePatrick Walton-158/+153
2013-03-22librustdoc: Remove `pure` from fuzzer and rustdoc.Patrick Walton-38/+38
2013-03-22librustc: Remove `pure` from libsyntax and librustc.Patrick Walton-252/+251
2013-03-22test: Fix test. rs=testPatrick Walton-1/+1
2013-03-22auto merge of #5483 : pcwalton/rust/static-syntax, r=graydonbors-57/+60
r? @nikomatsakis
2013-03-22libstd: Remove all uses of `pure` from libstd. rs=depurePatrick Walton-353/+353
2013-03-22libcore: Remove `pure` from libcore. rs=depurePatrick Walton-1576/+1551
2013-03-22librustc: Remove all uses of `static` from functions. rs=destaticPatrick Walton-286/+281
2013-03-22auto merge of #5463 : alexcrichton/rust/faster-fmt, r=graydonbors-61/+281
This is a minor step towards #3571, although I'm sure there's still more work to be done. Previously, `fmt!` collected a bunch of strings in a vector and then called `str::concat`. This changes the behavior by maintaining only one buffer and appending directly into that buffer. This avoids doubly-allocating memory, and it has the added bonus of reducing some allocations in `core::unstable::extfmt` One of the unfortunate side effects of this is that the `rt` module in `extfmt.rs` had to be duplicated to avoid `stage0` errors. Dealing with the change in conversion functions may require a bit of a dance when a snapshot happens, but I think it's doable. If the second speedup commit isn't deemed necessary, I got about a 15% speedup with just the first patch which doesn't require any modification of `extfmt.rs`, so no snapshot weirdness. Here's some other things I ran into when looking at `fmt!`: * I don't think that #2249 is relevant any more except for maybe removing one of `%i` or `%d` * I'm not sure what was in mind for using traits with #3571, but I thought that formatters like `%u` could invoke the `to_uint()` method on the `NumCast` trait, but I ran into some problems like those in #5462 I'm having trouble thinking of other wins for `fmt!`, but if there's some suggestions I'd be more than willing to look into if they'd work out or not.
2013-03-22auto merge of #5398 : dbaupp/rust/core-readlines, r=graydonbors-43/+152
The `each_line` function in `ReaderUtil` acts very differently to equivalent functions in Python, Ruby, Clojure etc. E.g. given a file `t` with contents `trailing\nnew line\n` and `n` containing `no trailing\nnew line`: Rust: ```Rust t: ~[~"trailing", ~"new line", ~""] n: ~[~"no trailing", ~"new line"] ``` Python: ```Python >>> open('t').readlines() ['trailing\n', 'new line\n'] >>> open('n').readlines() ['no trailing\n', 'new line'] ``` Ruby: ```Ruby irb(main):001:0> File.readlines('t') => ["trailing\n", "new line\n"] irb(main):002:0> File.readlines('n') => ["no trailing\n", "new line"] ``` Clojure ```Clojure user=> (read-lines "t") ("trailing" "new line") user=> (read-lines "n") ("no trailing" "new line") ``` The extra string that rust includes at the end is inconsistent, and means that it is impossible to distinguish between the "real" empty line a file that ends `...\n\n`, and the "fake" one after the last `\n`. The code attached makes Rust's `each_line` act like Clojure (and PHP, i.e. not including the `\n`), as well as adjusting `str::lines` to fix the trailing empty line problem. Also, add a convenience `read_lines` method to read all the lines in a file into a vector.
2013-03-22Pass the fmt! buffer to each conversion methodAlex Crichton-58/+268
Achieves a little more speedup and avoids allocations around some strings in conv_str
2013-03-22Removing some unused importsAlex Crichton-4/+0
2013-03-22Build up the result of fmt! in a buffer instead of a vectorAlex Crichton-30/+44
2013-03-22auto merge of #5471 : erickt/rust/incoming, r=bstriebors-2/+2
I made a typo in `str::levdistance` in my str pull request. This fixes it.
2013-03-23compiletest: Use lines_each instead of lines(..).each, or split(.., n).eachHuon Wilson-11/+11
2013-03-23libcore: handle trailing newlines more like other languages.Huon Wilson-32/+141
Specifically, `lines` and `each_line` will not emit a trailing empty string when given "...\n". Also, add `read_lines`, which just collects all of `each_line` into a vector, and `split_*_no_trailing` which will is the generalised version of `lines`.
2013-03-22syntax: make old `#[deriving_foo]` attribute obsoleteAndrew Paseltiner-3/+48
2013-03-22syntax: replace uses of old deriving attribute with new oneAndrew Paseltiner-100/+100
2013-03-22compiletest: replace uses of old deriving attribute with new oneAndrew Paseltiner-1/+1
2013-03-22test: replace uses of old deriving attribute with new oneAndrew Paseltiner-27/+27
2013-03-22rustc: replace uses of old deriving attribute with new oneAndrew Paseltiner-62/+62
2013-03-22fuzzer: replace uses of old deriving attribute with new oneAndrew Paseltiner-1/+1
2013-03-22rustdoc: replace uses of old deriving attribute with new oneAndrew Paseltiner-18/+18
2013-03-22std: replace uses of old deriving attribute with new oneAndrew Paseltiner-21/+21
2013-03-22core: replace uses of old deriving attribute with new oneAndrew Paseltiner-19/+19
2013-03-22auto merge of #5484 : pcwalton/rust/snapshots, r=pcwaltonbors-99/+8
2013-03-21auto merge of #5481 : thestinger/rust/deque, r=z0w0bors-0/+2
2013-03-21core: fix a typo in levdistanceErick Tryzelaar-2/+2
2013-03-21auto merge of #5480 : pcwalton/rust/at-const, r=pcwaltonbors-295/+277
r? @catamorphism
2013-03-21auto merge of #5479 : Kimundi/rust/str-dealloc, r=z0w0bors-110/+116
This makes the `trim` and `substr` functions return a slice instead of an `~str`, and removes the unnecessary `Trimmable` trait (`StrSlice` already contains the same functionality). Also moves the `ToStr` implementations for the three str types into the str module in anticipation of further untangling.
2013-03-21librustc: Register new snapshotsPatrick Walton-99/+8
2013-03-21librustc: Replace the `&static` bound with `'static`Patrick Walton-57/+60
2013-03-21libsyntax: Remove `@const` from the languagePatrick Walton-248/+41
2013-03-21librustc: Forbid destructors from being attached to any structs that might ↵Patrick Walton-47/+236
contain non-Owned fields. r=nmatsakis
2013-03-21auto merge of #5476 : thestinger/rust/bench, r=graydonbors-250/+87
The old string benchmarks weren't very useful because the strings weren't long enough, so I just threw those out for now. I left out benchmarks of `oldmap` because it's clear that it's 30-40% slower and it doesn't implement the `Map` trait. This also cleanly divides up `insert`, `search` and `remove`.
2013-03-21deque: add a module docstringDaniel Micay-0/+2
2013-03-21auto merge of #5407 : jbclements/rust/add-assert-eq-macro, r=jbclementsbors-296/+279
Adds an assert_eq! macro that asserts that its two arguments are equal. Error messages can therefore be somewhat more informative than a simple assert, because the error message includes "expected" and "given" values.
2013-03-21Un-renamed trim and substr functions.Marvin Löbel-78/+78
2013-03-21Switched over substr and trim functions in str to be non-allocating, ↵Marvin Löbel-122/+128
temporary renamed them to better track use-sites
2013-03-21replace the core-map benchmarkDaniel Micay-247/+86
* Closes #4603