Commit Graph

20332 Commits

Author SHA1 Message Date
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
Eric Reed
42f3f069fa changed NOTE to TODO 2013-06-26 13:48:49 -07:00
bors
23fb2278c7 auto merge of #7356 : msullivan/rust/default-methods, r=bblum
r?
2013-06-26 12:08:33 -07:00
Eric Reed
ce97bd4c8b cleaned up uv/net 2013-06-26 10:17:10 -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
Eric Reed
87ecfb7435 converted TCP interface to newtype structs 2013-06-26 09:37:48 -07:00
Eric Reed
d0dc6970d8 removed unecessary method 2013-06-26 09:37: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
Huon Wilson
73e3dbf9c0 driver: perform stripping before and after macro expansion.
This allows macros to both be conditionally defined, and expand
to items with #[cfg]'s.
2013-06-26 23:02:14 +10:00
bors
a30ab764e1 auto merge of #7255 : michaelwoerister/rust/debuginfo, r=jdm
This PR contains no real code changes. Just some documentation additions in the form of comments and some internal reordering of functions within debuginfo.rs.
2013-06-26 05:20:06 -07:00
bors
4ec05e02fa auto merge of #7216 : kballard/rust/task_rng, r=brson 2013-06-26 03:08:04 -07:00
bors
09b4525f84 auto merge of #7113 : alexcrichton/rust/banned-warnings, r=cmr
Reopening of #7031, Closes #6963

I imagine though that this will bounce in bors once or twice... Because attributes can't be cfg(stage0)'d off, there's temporarily a lot of new stage0/stage1+ code.
2013-06-26 00:56:04 -07:00
Tim Chevalier
3789433b4f rustpkg: Begin allowing package scripts to call the default build logic
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-25 22:29:38 -07:00
bors
ebed4d00d0 auto merge of #7393 : alexcrichton/rust/enable-threads, r=catamorphism
Closes #7071
2013-06-25 22:26:05 -07:00
bors
22408d9ad5 auto merge of #7269 : luqmana/rust/drop, r=thestinger
Finally rename finalize to drop.
Closes #4332.
2013-06-25 20:29:06 -07:00
Brian Anderson
5d3ca4b843 Merge remote-tracking branch 'mozilla/master' into incoming
Conflicts:
	src/librustc/middle/astencode.rs
	src/librustc/middle/check_const.rs
2013-06-25 19:32:00 -07:00
Young-il Choi
6a77273104 rt: add android dummy functions for mman related 2013-06-26 10:25:12 +09:00
Luqman Aden
ca2966c6d0 Change finalize -> drop. 2013-06-25 21:14:39 -04:00
bors
e9ac7194ff auto merge of #7365 : cmr/rust/syntax_cleanup, r=Aatch
Sets the stage for further cleanup (especially mass-slaughter of `@`)
2013-06-25 18:02:02 -07:00
Alex Crichton
7f61b31f5f Stop passing --disable-threads to LLVM 2013-06-25 17:42:28 -07:00
Alex Crichton
c109bed15b Deny common lints by default for lib{std,extra} 2013-06-25 17:39:43 -07:00
Corey Richardson
a616531ebb Remove extra 2013-06-25 20:25:56 -04:00
Eric Reed
34b1135b59 Converted UdpSocket into a newtype struct and (dis)connecting uses move semantics rather than ~. 2013-06-25 17:05:59 -07:00
Eric Reed
f604686295 converted UvUdpSocket into a newtype struct 2013-06-25 17:04:28 -07:00
Eric Reed
c5b19f0bf9 changed outdated match on IpAddr 2013-06-25 16:04:09 -07:00
Eric Reed
d0c812f2a8 IPv6 struct 2013-06-25 16:03:24 -07:00
Eric Reed
2c5cfe1037 removed obsolete FIXMEs. formatting changes. 2013-06-25 16:02:51 -07:00
bors
efd1438770 auto merge of #7373 : thestinger/rust/iterator, r=huonw 2013-06-25 15:22:55 -07:00
Eric Reed
f202713b73 satisfy the formatting check 2013-06-25 14:40:36 -07:00
Daniel Micay
e44e33dfa9 xfail test hitting a codegen bug (issue #7385) 2013-06-25 16:31:17 -04:00
Daniel Micay
e67c48a591 remove each from vec, HashMap and HashSet 2013-06-25 16:28:02 -04:00
Daniel Micay
64ee9668a2 container: remove internal iterators from Map
the maps are being migrated to external iterators
2013-06-25 16:26:23 -04:00
Daniel Micay
5242e8d2ba remove the redundant each method from OptVec 2013-06-25 16:26:23 -04:00
Corey Richardson
0d471d310d great renaming propagation: syntax 2013-06-25 16:15:07 -04:00
bors
4967bd0508 auto merge of #7325 : artagnon/rust/resolve-module, r=cmr
Fix #7322.

I started out with a band-aid approach to special-case the duplicate module error using `is_duplicate_module`, but thought this would be better in the long term.
2013-06-25 13:11:11 -07:00
Eric Reed
1af2016358 removed unncessary unsafe block that was stopping compliation. 2013-06-25 11:59:47 -07:00
Eric Reed
4870dce3eb Merge remote-tracking branch 'upstream/io' into io
Conflicts:
	src/rt/rustrt.def.in
2013-06-25 11:45:44 -07:00
Eric Reed
794923c995 UDP networking with tests 2013-06-25 11:43:40 -07:00