Commit Graph

19357 Commits

Author SHA1 Message Date
Brian Anderson
6511fe45e2 mk: Include all bins in the windows install 2013-06-27 19:00:12 -07:00
Brian Anderson
59905d1f27 mk: Make windows installer work with -pre versions 2013-06-27 19:00:10 -07:00
bors
4c86a0431b auto merge of #7418 : brson/rust/0.7-pre, r=cmr
There's a reason we didn't update this after 0.6 but I don't know
what it is. Let's see what breaks.
2013-06-27 12:52:43 -07:00
bors
9b6dfb8578 auto merge of #7414 : gifnksm/rust/max_by, r=catamorphism
`max_by` method returns the element that gives the maximum value from the specfied function.
`max_by`/`min_by` are convenient when you want to get the value which has greatest/smallest scores.

Inspired by [ruby's Enumerable module](http://ruby-doc.org/core-2.0/Enumerable.html).
2013-06-27 10:37:36 -07:00
bors
36527360a6 auto merge of #7429 : Blei/rust/delete-shared, r=huonw
Mostly just low-haning fruit, i.e. function arguments that were @ even
though & would work just as well.

Reduces librustc.so size by 200k when compiling without -O, by 100k when
compiling with -O.
2013-06-27 08:28:37 -07:00
Philipp Brüschweiler
7295a6da92 Remove many shared pointers
Mostly just low-haning fruit, i.e. function arguments that were @ even
though & would work just as well.

Reduces librustc.so size by 200k when compiling without -O, by 100k when
compiling with -O.
2013-06-27 15:06:19 +02:00
bors
c440743dcc auto merge of #7403 : catamorphism/rust/package-scripts, r=brson
r? @brson (or @graydon if available) rustpkg/api.rs provides functions intended for package scripts to call.
It will probably need more functionality added to it later, but this is
a start.

Added a test case checking that a package script can use the API.

Closes #6401
2013-06-27 06:01:30 -07:00
bors
0bad3e62b4 auto merge of #7395 : yichoi/rust/android_dummy, r=brson
add android dummy functions which does not exist in boinic.

after #7257, some mman related functions are needed for android.
2013-06-27 03:07:31 -07:00
bors
a28f9ba526 auto merge of #7361 : brson/rust/incoming, r=brson 2013-06-27 01:04:33 -07:00
bors
f1e09d6f1f auto merge of #7420 : mozilla/rust/rollup, r=thestinger 2013-06-26 23:07:41 -07:00
Corey Richardson
ab428b6480 Fix deque tests 2013-06-26 23:42:20 -04:00
bors
eda5e40b79 auto merge of #7111 : brson/rust/stack, r=brson
... through yields

This avoids the following pathological scenario that makes threadring OOM:

1) task calls C using fast_ffi, borrowing a big stack from the scheduler.
2) task returns from C and places the big stack on the task-local stack segment list
3) task calls further Rust functions that require growing the stack, and for this reuses the big stack
4) task yields, failing to return the big stack to the scheduler.
5) repeat 500+ times and OOM

(reopening after incoming fallout. *do not r+*. broken)
2013-06-26 20:40:31 -07:00
Brian Anderson
e8151de88f Update version number to 0.7-pre.
There's a reason we didn't update this after 0.6 but I don't know
what it is. Let's see what breaks.
2013-06-26 17:44:36 -07:00
bors
36d7f601d8 auto merge of #7354 : bblum/rust/trait-bounds, r=pcwalton
r? @nikomatsakis
2013-06-26 17:37:29 -07:00
Daniel Micay
9f5f609b1c vec: remove superseded reverse_part function
`reverse(xs.mut_slice(a, b))` replaces `reverse_part(xs, a, b)`
2013-06-26 19:42:34 -04:00
Corey Richardson
58fc1fccad last bit of whitespace 2013-06-26 19:00:44 -04:00
Brian Anderson
332671c479 Whitespace 2013-06-26 15:34:12 -07:00
Ramkumar Ramachandra
808b52351a treemap: remove .each in favor of .iter().advance
Both extra::treemap::TreeMap and extra::treemap::TreeSet have
corresponding iterators TreeMapIterator and TreeSetIterator.
Unfortunately, the tests and extra::serialize use the older .each.
Update all the dependent code, and remove .each.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-26 18:28:16 -04:00
Nick Desaulniers
82fa5b615e Fix run-pass/match-borrowed_str.rs Fixes #7306 2013-06-26 18:26:09 -04:00
Corey Richardson
394d28cac5 Fix old .each usage 2013-06-26 18:22:15 -04:00
Ben Blum
c37ccac931 Add a run-pass test for existential traits in ARCs. 2013-06-26 18:19:07 -04:00
Brian Anderson
8918461fc4 rt: Release big stacks immediately after use to avoid holding on to them through yields
This avoids the following pathological scenario that makes threadring OOM:

1) task calls C using fast_ffi, borrowing a big stack from the scheduler.
2) task returns from C and places the big stack on the task-local stack segment list
3) task calls further Rust functions that require growing the stack, and for this reuses the big stack
4) task yields, failing to return the big stack to the scheduler.
5) repeat 500+ times and OOM

Conflicts:
	src/rt/rust_task.cpp
2013-06-26 15:18:36 -07:00
Ben Blum
21aeb0f6cf Fix pretty-printing for bounded closures. Close #7333. 2013-06-26 18:14:43 -04:00
Ben Blum
d0f56db963 Change expected error message in kindchk compile-fail tests. 2013-06-26 18:14:43 -04:00
Ben Blum
ffc8c0ba21 Looser restrictions on what can be captured in unbounded heap closures. 2013-06-26 18:14:43 -04:00
Ben Blum
f8c892ab96 Make closure contents call out to trait_contents. 2013-06-26 18:14:43 -04:00
Ben Blum
108739f533 Looser restrictions on what can be captured in unbounded traits. 2013-06-26 18:14:43 -04:00
Ben Blum
7b968783d7 Infer default static/Owned bounds for unbounded heap fns/traits (#7264) 2013-06-26 18:14:43 -04:00
Ben Blum
12e09afd6d Work-around 'static bound requirement in io::with_bytes_reader (note: does not fix #5723, interface still unsafe) 2013-06-26 18:14:43 -04:00
Corey Richardson
f8ae9b0ae6 Fix whitespace issues (thanks @jedestep!) 2013-06-26 18:14:35 -04:00
bors
32adc0e730 auto merge of #7382 : msullivan/rust/cleanup, r=bblum 2013-06-26 15:13:37 -07:00
Kevin Ballard
3df37326cf Add methods .move_from() and .copy_from() to vec
Add method .move_from() to MutableVector, which consumes another vector
and moves elements into the receiver.

Add new trait MutableCloneableVector with one method .copy_from(), which
clones elements from another vector into the receiver.
2013-06-26 18:12:29 -04:00
Kevin Ballard
524a92c72f Add method .set_memory in vec::bytes for &[u8]
Add new trait vec::bytes::MutableByteVector which currently defines one
method .set_memory().
2013-06-26 18:11:18 -04:00
Jed Estep
35314c93fa Moving implementation details to a macro 2013-06-26 18:08:56 -04:00
Jed Estep
096fb795de A few iterator tests 2013-06-26 18:08:56 -04:00
Jed Estep
dfc9392c38 iterators use deque ordering 2013-06-26 18:08:56 -04:00
Jed Estep
4f7a742a06 deque iterator 2013-06-26 18:08:56 -04:00
Ramkumar Ramachandra
f4621cab68 priority_queue: implement simple iterator
Remove PriorityQueue::each and replace it with PriorityQueue::iter,
which ultimately calls into vec::VecIterator via PriorityQueueIterator.
Implement iterator::Iterator for PriorityQueueIterator.  Now you should
be able to do:

  extern mod extra;
  let mut pq = extra::priority_queue::PriorityQueue::new();
  pq.push(5);
  pq.push(6);
  pq.push(3);
  for pq.iter().advance |el| {
      println(fmt!("%d", *el));
  }

just like you iterate over vectors, hashmaps, hashsets etc.  Note that
the iteration order is arbitrary (as before with PriorityQueue::each),
and _not_ the order you get when you pop() repeatedly.

Add an in-file test to guard this.

Reported-by: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-26 18:08:43 -04:00
Tim Chevalier
2b17e4775c rustc: Eliminate extra failing case in metadata::loader::crate_from_metas
Closes #2406
2013-06-26 18:08:34 -04:00
Philipp Brüschweiler
2234f61038 Remove the last traces of shapes 2013-06-26 18:08:23 -04:00
Philipp Brüschweiler
87c1b59e8b Fix some warnings in the check-fast tests 2013-06-26 18:08:23 -04:00
Alex Crichton
8a4d359ffc Fix a formatting bug in rusti 2013-06-26 18:08:13 -04:00
Brian Anderson
9423850fc3 More 0.7 release notes 2013-06-26 18:08:04 -04:00
Kevin Ballard
0ae203a779 Refactor extra::term a bit
Move all the colors into a nested mod named color instead of prefixing
with "color_".

Define a new type color::Color, and make this a u16 instead of a u8 (to
allow for easy comparisons against num_colors, which is a u16).

Remove color_supported and replace it with num_colors.

Teach fg() and bg() to "dim" bright colors down to the normal intensity
if num_colors isn't high enough.

Remove unnecessary copies, and fix a bug where a terminfo parse failure
would try to use the wrong error and end up failing.
2013-06-26 18:07:17 -04:00
Ben Blum
00b4138857 Make ^~~~~ colour dependent on error/warning/note level. Also correct spelling of squigglies. 2013-06-26 18:00:11 -04:00
Ramkumar Ramachandra
41f953af2e .gitmodules: specify submodule.<path>.branch
So --remote can work.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-26 17:59:19 -04:00
gifnksm
8edb8f6d39 iterator: Add IteratorUtil::max_by/min_by method 2013-06-27 06:55:22 +09:00
bors
23fb2278c7 auto merge of #7356 : msullivan/rust/default-methods, r=bblum
r?
2013-06-26 12:08:33 -07:00
bors
3433851a37 auto merge of #7345 : blake2-ppc/rust/iterator-flat-map, r=thestinger
flat_map_ produces an iterator that maps each element to an iterator,
and yields the elements of the produced iterators.

This is the monadic bind :: M a -> (a -> M b) -> M b  for iterators.

Named just like the vec method, but with a trailing underline until the
method resolution bug is resolved.

We discussed the name chain_map, but I decided to go with flat_map_ for consistency with vec.

Since it.map(f).flatten()  would be the same as it.flat_map(f), we could choose
to just implement a flatten method instead. Either way the possibilities are the same but flat_map is more convenient.
2013-06-26 09:47:16 -07:00
bors
4e5b4807a5 auto merge of #7297 : huonw/rust/strip-expand-strip, r=cmr
This allows macros to both be conditionally defined, and expand
to items with #[cfg]'s.

This seems to have a performance improvement, e.g. for `std`:

```
# Before 
time: 1.660 s   expansion
time: 0.125 s   configuration
# After
time: 0.080 s   configuration 1
time: 1.127 s   expansion
time: 0.132 s   configuration 2
```

And for `extra`:

```
# Before
time: 0.593 s   expansion
time: 0.062 s   configuration
# After
time: 0.047 s   configuration 1
time: 0.147 s   expansion
time: 0.058 s   configuration 2
```

(This seems a little peculiar, but it is possibly because the expansion AST traversal is very slow, so removing as much as possible as early as possible has big benefits.)
2013-06-26 07:32:14 -07:00