Commit Graph

16448 Commits

Author SHA1 Message Date
bors
1e41bc7445 auto merge of #5501 : catamorphism/rust/manual, r=graydon
r? @graydon
2013-03-22 16:42:50 -07:00
Tim Chevalier
3633ba240f Copyedit macro tutorial 2013-03-22 16:11:27 -07:00
bors
5b43810841 auto merge of #5497 : luqmana/rust/clang-ver, r=thestinger 2013-03-22 15:15:54 -07:00
Daniel Micay
705c796ffa remove obsolete purity workarounds 2013-03-22 18:08:56 -04:00
Daniel Micay
0c8c3b4232 trie: make the TrieSet impl public 2013-03-22 18:04:35 -04:00
Daniel Micay
55fbb9518b trie: inline the other TrieSet wrapper methods 2013-03-22 18:04:35 -04:00
Daniel Micay
04e367b353 trie: rm workaround for issue #3469 2013-03-22 18:03:55 -04:00
Tim Chevalier
ab2a397ae7 docs: Copyedit my randomly assigned sections of the manual 2013-03-22 14:45:16 -07:00
bors
bd065d3311 auto merge of #5496 : catamorphism/rust/release-notes, r=catamorphism 2013-03-22 14:00:57 -07:00
bors
e9b077c0e9 auto merge of #5488 : pcwalton/rust/depure, r=pcwalton 2013-03-22 13:00:56 -07:00
Patrick Walton
3eda11a4f7 test: Remove pure from the test suite 2013-03-22 12:57:28 -07:00
Patrick Walton
fbe22afdbe librustdoc: Remove pure from fuzzer and rustdoc. 2013-03-22 12:57:28 -07:00
Patrick Walton
e7c60c141b librustc: Remove pure from libsyntax and librustc. 2013-03-22 12:57:27 -07:00
Patrick Walton
ec59ce5796 test: Fix test. rs=test 2013-03-22 12:57:27 -07:00
Luqman Aden
19c104000e configure: accept clang 3.3 when passed --enable-clang 2013-03-22 15:49:55 -04:00
Tim Chevalier
d049bf2492 Edit release notes a bit 2013-03-22 11:59:59 -07:00
bors
b6f9aa1fd7 auto merge of #5483 : pcwalton/rust/static-syntax, r=graydon
r? @nikomatsakis
2013-03-22 11:21:48 -07:00
Patrick Walton
c1084091d4 libstd: Remove all uses of pure from libstd. rs=depure 2013-03-22 10:29:17 -07:00
Patrick Walton
be9bddd463 libcore: Remove pure from libcore. rs=depure 2013-03-22 10:29:17 -07:00
Patrick Walton
4634f7edae librustc: Remove all uses of static from functions. rs=destatic 2013-03-22 10:27:39 -07:00
bors
f011f928dd auto merge of #5463 : alexcrichton/rust/faster-fmt, r=graydon
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-22 10:18:53 -07:00
bors
1616ffd0c2 auto merge of #5398 : dbaupp/rust/core-readlines, r=graydon
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-22 09:24:53 -07:00
Alex Crichton
e93654c96d Pass the fmt! buffer to each conversion method
Achieves a little more speedup and avoids allocations around some strings in
conv_str
2013-03-22 11:49:45 -04:00
Alex Crichton
c0bbc6242f Removing some unused imports 2013-03-22 11:49:45 -04:00
Alex Crichton
1a0d212dd9 Build up the result of fmt! in a buffer instead of a vector 2013-03-22 11:49:45 -04:00
bors
d700500d0c auto merge of #5471 : erickt/rust/incoming, r=bstrie
I made a typo in `str::levdistance` in my str pull request. This fixes it.
2013-03-22 06:21:51 -07:00
Huon Wilson
f8323397aa compiletest: Use lines_each instead of lines(..).each, or split(.., n).each 2013-03-23 00:15:06 +11:00
Huon Wilson
429b8a9b9e libcore: handle trailing newlines more like other languages.
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-23 00:15:05 +11:00
bors
059764779c auto merge of #5493 : apasel422/rust/leibniz, r=bstrie
Closes #5411.
2013-03-22 05:30:50 -07:00
Andrew Paseltiner
999e7ef9a9 syntax: make old #[deriving_foo] attribute obsolete 2013-03-22 07:15:13 -04:00
Andrew Paseltiner
e2abecd3ab syntax: replace uses of old deriving attribute with new one 2013-03-22 06:30:59 -04:00
Andrew Paseltiner
6e883c730e compiletest: replace uses of old deriving attribute with new one 2013-03-22 06:30:59 -04:00
Andrew Paseltiner
ec960963c1 test: replace uses of old deriving attribute with new one 2013-03-22 06:30:53 -04:00
Andrew Paseltiner
9966eaaba4 rustc: replace uses of old deriving attribute with new one 2013-03-22 06:24:19 -04:00
Andrew Paseltiner
72d7d60155 fuzzer: replace uses of old deriving attribute with new one 2013-03-22 06:24:19 -04:00
Andrew Paseltiner
baf6a6373f rustdoc: replace uses of old deriving attribute with new one 2013-03-22 06:24:19 -04:00
Andrew Paseltiner
4055fe83f6 std: replace uses of old deriving attribute with new one 2013-03-22 06:24:19 -04:00
Andrew Paseltiner
98e8fe12d2 core: replace uses of old deriving attribute with new one 2013-03-22 06:24:19 -04:00
bors
9584c60871 auto merge of #5484 : pcwalton/rust/snapshots, r=pcwalton 2013-03-22 00:00:50 -07:00
bors
27434e8219 auto merge of #5482 : thestinger/rust/install, r=pcwalton
Closes #4468
2013-03-21 22:57:50 -07:00
bors
334e921421 auto merge of #5481 : thestinger/rust/deque, r=z0w0 2013-03-21 21:57:52 -07:00
Erick Tryzelaar
557b8cce8e core: fix a typo in levdistance 2013-03-21 20:45:37 -07:00
bors
d52408d46a auto merge of #5480 : pcwalton/rust/at-const, r=pcwalton
r? @catamorphism
2013-03-21 20:39:51 -07:00
bors
5f2d4102c5 auto merge of #5479 : Kimundi/rust/str-dealloc, r=z0w0
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-21 19:39:53 -07:00
Patrick Walton
e7dbe6cd6f librustc: Register new snapshots 2013-03-21 18:10:20 -07:00
bors
d8c0da3940 auto merge of #5441 : lucab/rust/lucab/tutorial/struct, r=z0w0
In struct section of tutorial, make everything more coherent and
clear by always using "struct Point".
Also, do not prematurely introduce pointers and arrays.
Fixes #5240
2013-03-21 17:57:52 -07:00
Daniel Micay
2cbfe6d19d stop installing empty .so files
Closes #4468
2013-03-21 20:32:57 -04:00
Patrick Walton
94327d00c6 librustc: Replace the &static bound with 'static 2013-03-21 17:31:35 -07:00
Patrick Walton
02c49b32ca libsyntax: Remove @const from the language 2013-03-21 17:31:35 -07:00
Patrick Walton
d4fee24c7c librustc: Forbid destructors from being attached to any structs that might contain non-Owned fields. r=nmatsakis 2013-03-21 17:31:34 -07:00