]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #8265 : blake2-ppc/rust/std-iter, r=thestinger
bors [Tue, 6 Aug 2013 05:38:15 +0000 (22:38 -0700)]
auto merge of #8265 : blake2-ppc/rust/std-iter, r=thestinger

Fix #8228 by replacing .iter() and .iter_err() in Result by external iterators.

Implement random access for `iterator::Invert` and `vec::ChunkIter` (and bidirectionality).

Implement Repeat iterator.

10 years agoauto merge of #8278 : cmr/rust/workaround, r=brson
bors [Tue, 6 Aug 2013 03:07:59 +0000 (20:07 -0700)]
auto merge of #8278 : cmr/rust/workaround, r=brson

10 years agostd: Fix bug in ChunkIter::idx
blake2-ppc [Sun, 4 Aug 2013 20:46:26 +0000 (22:46 +0200)]
std: Fix bug in ChunkIter::idx

ChunkIter .idx() didn't handle overflow correctly, even though it tried.

10 years agostd: Remove uint::iterate, replaced by `range`
blake2-ppc [Sun, 4 Aug 2013 15:10:09 +0000 (17:10 +0200)]
std: Remove uint::iterate, replaced by `range`

10 years agoextra: Simplify the bitv iterators using Repeat
blake2-ppc [Sun, 4 Aug 2013 02:49:44 +0000 (04:49 +0200)]
extra: Simplify the bitv iterators using Repeat

10 years agostd: Improve the documentation for iterator::Invert
blake2-ppc [Sat, 3 Aug 2013 19:34:00 +0000 (21:34 +0200)]
std: Improve the documentation for iterator::Invert

10 years agostd: Use method name Option::consume
blake2-ppc [Sat, 3 Aug 2013 19:34:00 +0000 (21:34 +0200)]
std: Use method name Option::consume

With Option as the simplest container, `consume` is the way to turn it
into a by-value iterator.

10 years agostd: Rewrite the HashSet set operation iterators
blake2-ppc [Sat, 3 Aug 2013 19:34:00 +0000 (21:34 +0200)]
std: Rewrite the HashSet set operation iterators

Use the Repeat iterator to carry the "explicit closure capture" that was
previously done with the custom EnvFilterIterator.

10 years agostd: Add iterator::Repeat to repeat an element endlessly
blake2-ppc [Sat, 3 Aug 2013 19:34:00 +0000 (21:34 +0200)]
std: Add iterator::Repeat to repeat an element endlessly

10 years agostd: Improve vec::ChunkIter
blake2-ppc [Sat, 3 Aug 2013 17:40:20 +0000 (19:40 +0200)]
std: Improve vec::ChunkIter

Implement clone, bidirectionality and random access for this iterator

10 years agostd: Implement RandomAccessIterator for Invert
blake2-ppc [Sat, 3 Aug 2013 17:40:20 +0000 (19:40 +0200)]
std: Implement RandomAccessIterator for Invert

10 years agostd: Remove unused trait bound in Result::map
blake2-ppc [Sat, 3 Aug 2013 17:40:20 +0000 (19:40 +0200)]
std: Remove unused trait bound in Result::map

10 years agostd: Convert Result to use external iterators
blake2-ppc [Sat, 3 Aug 2013 17:40:20 +0000 (19:40 +0200)]
std: Convert Result to use external iterators

convert iter() and iter_err() for Result. Use OptionIterator.

10 years agostd: Add .consume_iter() for Option, to make it reusable
blake2-ppc [Sat, 3 Aug 2013 17:40:20 +0000 (19:40 +0200)]
std: Add .consume_iter() for Option, to make it reusable

Let Option be a base for a widely useful one- or zero- item iterator.
Refactor OptionIterator to support any generic element type, so the same
iterator impl can be used for both &T, &mut T and T iterators.

10 years agoRe-enable rusti tests
Alex Crichton [Mon, 5 Aug 2013 16:25:20 +0000 (09:25 -0700)]
Re-enable rusti tests

10 years agoauto merge of #8288 : Kimundi/rust/opteitres4, r=brson
bors [Mon, 5 Aug 2013 23:47:01 +0000 (16:47 -0700)]
auto merge of #8288 : Kimundi/rust/opteitres4, r=brson

This is an alternative version to https://github.com/mozilla/rust/pull/8268, where instead of transitioning to `get()` completely, I transitioned to `unwrap()` completely.

My reasoning for also opening this PR is that having two different functions with identical behavior on a common datatype is bad for consistency and confusing for users, and should be solved as soon as possible. The fact that apparently half the code uses `get()`, and the other half `unwrap()` only makes it worse.

If the final naming decision ends up different, there needs to be a big renaming anyway, but until then it should at least be consistent.

---

- Made naming schemes consistent between Option, Result and Either
- Lifted the quality of the either and result module to that of option
- Changed Options Add implementation to work like the maybe Monad (return None if any of the inputs is None)
  See https://github.com/mozilla/rust/issues/6002, especially my last comment.
- Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
  See also https://github.com/mozilla/rust/issues/7887.

Todo:

Adding testcases for all function in the three modules. Even without the few functions I added, the coverage wasn't complete to begin with. But I'd rather do that as a follow up PR, I've touched to much code here already, need to go through them again later.

10 years agoLazily initialize 'leaf node' taskgroups for unlinked spawns, for an apparent 11...
Ben Blum [Mon, 5 Aug 2013 20:55:08 +0000 (16:55 -0400)]
Lazily initialize 'leaf node' taskgroups for unlinked spawns, for an apparent 11% speedup.

10 years ago(cleanup) Uncomment an assertion that now holds.
Ben Blum [Fri, 2 Aug 2013 23:35:13 +0000 (19:35 -0400)]
(cleanup) Uncomment an assertion that now holds.

10 years agoauto merge of #8298 : darkf/rust/fix-3948, r=pcwalton
bors [Mon, 5 Aug 2013 20:49:55 +0000 (13:49 -0700)]
auto merge of #8298 : darkf/rust/fix-3948, r=pcwalton

10 years agoUpdated std::Option, std::Either and std::Result
Marvin Löbel [Sat, 3 Aug 2013 23:59:24 +0000 (01:59 +0200)]
Updated std::Option, std::Either and std::Result

- Made naming schemes consistent between Option, Result and Either
- Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None)
- Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead

10 years agoUse TreeMap's ord implementation for Json
Alex Crichton [Mon, 5 Aug 2013 17:37:53 +0000 (10:37 -0700)]
Use TreeMap's ord implementation for Json

Closes #4430

10 years agoImprove debug spew in _match.
Michael Sullivan [Fri, 2 Aug 2013 17:34:33 +0000 (10:34 -0700)]
Improve debug spew in _match.

10 years agoGet rid of some NOTEs.
Michael Sullivan [Tue, 30 Jul 2013 23:47:22 +0000 (16:47 -0700)]
Get rid of some NOTEs.

10 years agoWarn when using -o option on libraries. Closes #6554.
Michael Sullivan [Tue, 30 Jul 2013 22:40:19 +0000 (15:40 -0700)]
Warn when using -o option on libraries. Closes #6554.

10 years agoFix an unused variable warning and clean up some dead code/names.
Michael Sullivan [Mon, 29 Jul 2013 21:19:04 +0000 (14:19 -0700)]
Fix an unused variable warning and clean up some dead code/names.

10 years agoauto merge of #8293 : dim-an/rust/trie-iterator, r=thestinger
bors [Mon, 5 Aug 2013 18:28:56 +0000 (11:28 -0700)]
auto merge of #8293 : dim-an/rust/trie-iterator, r=thestinger

Closes #5506.

10 years agoMake node_id_to_str print more useful info in some cases. Closes #2410.
Michael Sullivan [Mon, 29 Jul 2013 20:44:53 +0000 (13:44 -0700)]
Make node_id_to_str print more useful info in some cases. Closes #2410.

10 years agoauto merge of #8292 : thestinger/rust/fix_loop_warning, r=brson
bors [Mon, 5 Aug 2013 16:49:56 +0000 (09:49 -0700)]
auto merge of #8292 : thestinger/rust/fix_loop_warning, r=brson

10 years agostd: Use correct lifetime parameter on str::raw::slice_bytes
blake2-ppc [Mon, 5 Aug 2013 15:52:03 +0000 (17:52 +0200)]
std: Use correct lifetime parameter on str::raw::slice_bytes

fn slice_bytes is marked unsafe since it allows violating the valid
string encoding property; but the function did also allow extending the
lifetime of the slice by mistake, since it's returning `&str`.

Use the annotation `slice_bytes<'a>(&'a str, ...) -> &'a str` so
that all uses of slice_bytes are region checked correctly.

10 years agoauto merge of #8289 : sfackler/rust/push_byte, r=erickt
bors [Mon, 5 Aug 2013 15:10:55 +0000 (08:10 -0700)]
auto merge of #8289 : sfackler/rust/push_byte, r=erickt

It was previously pushing the byte on top of the string's null
terminator. I added a test to make sure it doesn't break in the future.

10 years agoauto merge of #8183 : omasanori/rust/migrate-new, r=sanxiyn
bors [Mon, 5 Aug 2013 13:22:57 +0000 (06:22 -0700)]
auto merge of #8183 : omasanori/rust/migrate-new, r=sanxiyn

It seems that relatively new code uses `Foo::new()` instead of `Foo()` so I wrote a patch to migrate some structs to the former style.
Is it a right direction? If there are any guidelines not to use new()-style, could you add them to the [style guide](https://github.com/omasanori/rust/wiki/Note-style-guide)?

10 years agoauto merge of #8279 : pcwalton/rust/no-main, r=brson
bors [Mon, 5 Aug 2013 11:37:58 +0000 (04:37 -0700)]
auto merge of #8279 : pcwalton/rust/no-main, r=brson

Useful for SDL and possibly Android too.

r? @brson

10 years agoauto merge of #8227 : dim-an/rust/tree-iter, r=thestinger
bors [Mon, 5 Aug 2013 09:52:55 +0000 (02:52 -0700)]
auto merge of #8227 : dim-an/rust/tree-iter, r=thestinger

10 years agoAdd extra::arena::Arena::new{, _with_size}.
OGINO Masanori [Mon, 5 Aug 2013 08:43:40 +0000 (17:43 +0900)]
Add extra::arena::Arena::new{, _with_size}.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoauto merge of #8303 : brson/rust/tls-magic-wtf, r=brson
bors [Mon, 5 Aug 2013 07:56:00 +0000 (00:56 -0700)]
auto merge of #8303 : brson/rust/tls-magic-wtf, r=brson

10 years agostd::rt: Use magic to make TLS work from annihilated boxes. #8302
Brian Anderson [Mon, 5 Aug 2013 07:32:46 +0000 (00:32 -0700)]
std::rt: Use magic to make TLS work from annihilated boxes. #8302

10 years agoauto merge of #8299 : brson/rust/yet-more-newsched-fixes, r=brson
bors [Mon, 5 Aug 2013 06:16:59 +0000 (23:16 -0700)]
auto merge of #8299 : brson/rust/yet-more-newsched-fixes, r=brson

10 years agostd::rt: Schedule more scheduler callbacks to avoid dropping messages
Brian Anderson [Mon, 5 Aug 2013 04:55:52 +0000 (21:55 -0700)]
std::rt: Schedule more scheduler callbacks to avoid dropping messages

10 years agostd: Fix newsched logging truncation
Brian Anderson [Mon, 5 Aug 2013 04:54:59 +0000 (21:54 -0700)]
std: Fix newsched logging truncation

The truncation needs to be done in the console logger in order
to catch all the logging output, and because truncation only matters
when outputting to the console.

10 years agoOpen files in binary mode. Closes #3948
darkf [Mon, 5 Aug 2013 04:54:24 +0000 (21:54 -0700)]
Open files in binary mode. Closes #3948

10 years agoauto merge of #8220 : luqmana/rust/arm-linux, r=cmr
bors [Mon, 5 Aug 2013 04:34:54 +0000 (21:34 -0700)]
auto merge of #8220 : luqmana/rust/arm-linux, r=cmr

Update the arm linux support some more. We had a previous patch for the RasberryPi. This adds a new target `arm-unknown-linux-gnueabi` for more general arm linux support.

Build/Host machine: x86_64 Debian testing (jessie) with the `gcc-4.4-arm-linux-gnueabi` package

Tested on targets:

- TS-7800 Feroceon (ARMv5TEJ) running Debian 7.0 wheezy
- Beaglebone black (ARMv7) running Angstrom GNU/Linux v2012.12
   - rustc flags:  `--target=arm-unknown-linux-gnueabi --linker=arm-linux-gnueabi-gcc`

- Samsung Galaxy S II (to make sure android still works)
   - rustc flags:  `--target=arm-linux-androideabi --android-cross-path=[path to standalone toolchain]`

Since not all arm devices (i.e. afaik anything older than armv6 like the ts-7800 i tested on) supported getting the tls address via the `mrc` instruction, I made it also try via the magic address the kernel maps into the address space (0xFFFF0FF0). One or the other should work (and on android it seems like both work).

Also fixes a bug where rustc would always try to invoke the android assembler for any kind of arm target.

10 years agoauto merge of #8297 : brson/rust/dlist-dtor, r=brson
bors [Mon, 5 Aug 2013 02:52:57 +0000 (19:52 -0700)]
auto merge of #8297 : brson/rust/dlist-dtor, r=brson

The compiler-generated dtor for DList recurses deeply to drop Nodes.
For big lists this can overflow the stack.

This is a problem for the new scheduler, where split stacks are not implemented.

Thanks @blake2-ppc

10 years agoextra: Don't recurse in DList drop glue. #8295
Brian Anderson [Mon, 5 Aug 2013 01:38:06 +0000 (18:38 -0700)]
extra: Don't recurse in DList drop glue. #8295

The compiler-generated dtor for DList recurses deeply to drop Nodes.
For big lists this can overflow the stack.

10 years agoauto merge of #8282 : brson/rust/more-newsched-fixes, r=brson
bors [Mon, 5 Aug 2013 01:10:53 +0000 (18:10 -0700)]
auto merge of #8282 : brson/rust/more-newsched-fixes, r=brson

10 years agoAdd support for vanilla linux on arm.
Luqman Aden [Thu, 1 Aug 2013 10:39:37 +0000 (06:39 -0400)]
Add support for vanilla linux on arm.

10 years agoauto merge of #8218 : brson/rust/nogc, r=brson
bors [Sun, 4 Aug 2013 23:25:54 +0000 (16:25 -0700)]
auto merge of #8218 : brson/rust/nogc, r=brson

These are both obsoleted by the forthcoming new GC.

10 years agoRemove debug printing.
Dmitry Ermolov [Sun, 4 Aug 2013 22:51:43 +0000 (02:51 +0400)]
Remove debug printing.

10 years agoImplemented iterator for TrieMap
Dmitry Ermolov [Sun, 4 Aug 2013 22:26:38 +0000 (02:26 +0400)]
Implemented iterator for TrieMap

Closes #5506.

10 years agofix warning still mentioning the `again` keyword
Daniel Micay [Sun, 4 Aug 2013 22:21:29 +0000 (18:21 -0400)]
fix warning still mentioning the `again` keyword

10 years agoRemove old tests and code for `select`
Brian Anderson [Sun, 4 Aug 2013 07:40:10 +0000 (00:40 -0700)]
Remove old tests and code for `select`

Not compatible with newsched

10 years agostd::rt: Remove the test for context()
Brian Anderson [Sun, 4 Aug 2013 06:50:28 +0000 (23:50 -0700)]
std::rt: Remove the test for context()

This is no longer testable once newsched is turned on

10 years agostd::rt: Don't allow schedulers to exit before handling all messages
Brian Anderson [Sun, 4 Aug 2013 06:29:21 +0000 (23:29 -0700)]
std::rt: Don't allow schedulers to exit before handling all messages

Every time run_sched_once performs a 'scheduling action' it needs to guarantee
that it runs at least one more time, so enqueue another run_sched_once callback.
The primary reason it needs to do this is because not all async callbacks
are guaranteed to run, it's only guaranteed that *a* callback will run after
enqueing one - some may get dropped.

At the moment this means we wastefully create lots of callbacks to ensure that
there will *definitely* be a callback queued up to continue running the scheduler.
The logic really needs to be tightened up here.

10 years agostd::rt: 3MB stacks!
Brian Anderson [Sun, 4 Aug 2013 06:28:47 +0000 (23:28 -0700)]
std::rt: 3MB stacks!

rustc needs *even more* megabytes when run without optimizations

10 years agostd::rt: Run the tests for Local in a bare thread
Brian Anderson [Sun, 4 Aug 2013 00:40:29 +0000 (17:40 -0700)]
std::rt: Run the tests for Local in a bare thread

Otherwise interferes with the existing runtime

10 years agostd::rt: Improve the error message when the thread-local ptr is null
Brian Anderson [Sun, 4 Aug 2013 00:39:59 +0000 (17:39 -0700)]
std::rt: Improve the error message when the thread-local ptr is null

Also fix some incorrect comments and variable names.

10 years agoauto merge of #8260 : omasanori/rust/fix-extra-unicode, r=pcwalton
bors [Sun, 4 Aug 2013 21:43:51 +0000 (14:43 -0700)]
auto merge of #8260 : omasanori/rust/fix-extra-unicode, r=pcwalton

WIth this patch `RUSTFLAGS='--cfg unicode' make check"` passed successfully.

* Why doesn't `#[link_name="icuuc"]` make libextra to link against libicuuc.so?
* In `extra::unicode::tests`, `use unicode; unicode::is_foo('a')` failed but `use unicode::*; is_foo('a')` succeeded. Is it right?

10 years agoFixed str::raw::push_byte
Steven Fackler [Sun, 4 Aug 2013 20:10:19 +0000 (16:10 -0400)]
Fixed str::raw::push_byte

It was previously pushing the byte on top of the string's null
terminator. I added a test to make sure it doesn't break in the future.

10 years agoauto merge of #7115 : alexcrichton/rust/llvm-upgrades, r=thestinger
bors [Sun, 4 Aug 2013 19:49:53 +0000 (12:49 -0700)]
auto merge of #7115 : alexcrichton/rust/llvm-upgrades, r=thestinger

This is a reopening of #6713

This is still blocked on windows failures. I'll re-push try once the existing crisis has passed.

10 years agoMerge pull request #8284 from huonw/emacs-in-kw
Daniel Micay [Sun, 4 Aug 2013 19:49:11 +0000 (12:49 -0700)]
Merge pull request #8284 from huonw/emacs-in-kw

etc: add the `in` keyword to the emacs mode.

10 years agoIntegrate new arm patch and fix an LLVM bug
Alex Crichton [Fri, 2 Aug 2013 07:55:49 +0000 (00:55 -0700)]
Integrate new arm patch and fix an LLVM bug

Thanks @luqama!

10 years agoAdd a workaround for 8199 for now
Alex Crichton [Thu, 1 Aug 2013 22:47:09 +0000 (15:47 -0700)]
Add a workaround for 8199 for now

10 years agoFix setting the fixed stack segment attribute on LLVM functions
Alex Crichton [Sun, 26 May 2013 02:26:08 +0000 (21:26 -0500)]
Fix setting the fixed stack segment attribute on LLVM functions

At the same time create a more robust wrapper to try to prevent this type of
issue from cropping up in the future.

10 years agoFix build issues once LLVM has been upgraded
Alex Crichton [Sat, 25 May 2013 22:23:12 +0000 (17:23 -0500)]
Fix build issues once LLVM has been upgraded

* LLVM now has a C interface to LLVMBuildAtomicRMW
* The exception handling support for the JIT seems to have been dropped
* Various interfaces have been added or headers have changed

10 years agoUpdate LLVM
Alex Crichton [Fri, 24 May 2013 05:43:59 +0000 (00:43 -0500)]
Update LLVM

10 years agoTry to fix a periodic windows build failure due to broken rwildcard macro
Brian Anderson [Tue, 21 May 2013 23:34:41 +0000 (16:34 -0700)]
Try to fix a periodic windows build failure due to broken rwildcard macro

10 years agoauto merge of #8262 : dotdash/rust/no_rval_copies, r=pcwalton
bors [Sun, 4 Aug 2013 17:55:53 +0000 (10:55 -0700)]
auto merge of #8262 : dotdash/rust/no_rval_copies, r=pcwalton

rvalues aren't going to be used anywhere but as the argument, so
there's no point in copying them. LLVM used to eliminate the copy
later, but why bother emitting it in the first place?

10 years agoauto merge of #8243 : stepancheg/rust/ipv, r=brson
bors [Sun, 4 Aug 2013 15:49:55 +0000 (08:49 -0700)]
auto merge of #8243 : stepancheg/rust/ipv, r=brson

multicast functions now take IpAddr (without port), because they dont't
need port.

Uv* types renamed:
* UvIpAddr -> UvSocketAddr
* UvIpv4 -> UvIpv4SocketAddr
* UvIpv6 -> UvIpv6SocketAddr

"Socket address" is a common name for (ip-address, port) pair (e.g. in
sockaddr_in struct).

P. S. Are there any backward compatibility concerns? What is std::rt module, is it a part of public API?

10 years agoauto merge of #8237 : blake2-ppc/rust/faster-utf8, r=brson
bors [Sun, 4 Aug 2013 14:10:56 +0000 (07:10 -0700)]
auto merge of #8237 : blake2-ppc/rust/faster-utf8, r=brson

Use unchecked vec indexing since the vector bounds are checked by the
loop. Iterators are not easy to use in this case since we skip 1-4 bytes
each lap. This part of the commit speeds up is_utf8 for ASCII input.

Check codepoint ranges by checking the byte ranges manually instead of
computing a full decoding for multibyte encodings. This is easy to read
and corresponds to the UTF-8 syntax in the RFC.

No changes to what we accept. A comment notes that surrogate halves are
accepted.

Before:

test str::bench::is_utf8_100_ascii ... bench: 165 ns/iter (+/- 3)
test str::bench::is_utf8_100_multibyte ... bench: 218 ns/iter (+/- 5)

After:
test str::bench::is_utf8_100_ascii ... bench: 130 ns/iter (+/- 1)
test str::bench::is_utf8_100_multibyte ... bench: 156 ns/iter (+/- 3)

An improvement upon the previous pull #8133

10 years agoauto merge of #8254 : brson/rust/libuv-mac-supp, r=pcwalton
bors [Sun, 4 Aug 2013 12:28:57 +0000 (05:28 -0700)]
auto merge of #8254 : brson/rust/libuv-mac-supp, r=pcwalton

I suspect that this is a race between process exit and the termination of
worker threads used by libuv (if I sleep before exit it doesn't leak). This
isn't going to cause any real problems but should probably be fixed at
some point.

r? @pcwalton

cc #8253

10 years agoauto merge of #8217 : brson/rust/reset_stack_limit, r=pcwalton
bors [Sun, 4 Aug 2013 10:34:56 +0000 (03:34 -0700)]
auto merge of #8217 : brson/rust/reset_stack_limit, r=pcwalton

In some scenarios upcall_rust_stack_limit fails to record the stack
limit, leaving it 0, and allowing subsequent Rust code to run into
the red zone.

10 years agostd: implement Total{Ord,Eq} for pointers.
Huon Wilson [Sat, 27 Jul 2013 15:25:30 +0000 (01:25 +1000)]
std: implement Total{Ord,Eq} for pointers.

10 years agosyntax: make #[deriving(TotalOrd)] lazy.
Huon Wilson [Sat, 27 Jul 2013 15:16:30 +0000 (01:16 +1000)]
syntax: make #[deriving(TotalOrd)] lazy.

Previously it would call:

  f(sf1.cmp(&of1), f(sf2.cmp(&of2), ...))

(where s/of1 = 'self/other field 1', and f was
std::cmp::lexical_ordering)

This meant that every .cmp subcall got evaluated when calling a derived
TotalOrd.cmp.

This corrects this to use

   let test = sf1.cmp(&of1);
   if test == Equal {
      let test = sf2.cmp(&of2);
      if test == Equal {
        // ...
      } else {
        test
      }
   } else {
     test
   }

This gives a lexical ordering by short-circuiting on the first comparison
that is not Equal.

10 years agolibsyntax/ext/deriving/cmp/* was ignored by the build system.
Huon Wilson [Sat, 20 Jul 2013 14:37:47 +0000 (00:37 +1000)]
libsyntax/ext/deriving/cmp/* was ignored by the build system.

10 years agoImplemented TreeMap::{lower_bound_iter,upper_bound_iter}
Dmitry Ermolov [Thu, 1 Aug 2013 20:59:07 +0000 (00:59 +0400)]
Implemented TreeMap::{lower_bound_iter,upper_bound_iter}

(issue #4604)

10 years agoRemove redundant print.
Dmitry Ermolov [Thu, 1 Aug 2013 20:57:34 +0000 (00:57 +0400)]
Remove redundant print.

10 years agoAdditional check in treemap iterator test.
Dmitry Ermolov [Wed, 31 Jul 2013 16:24:35 +0000 (20:24 +0400)]
Additional check in treemap iterator test.

10 years agort: Fix a corner-case in unwinding that leads to stack overflow
Brian Anderson [Fri, 2 Aug 2013 04:14:43 +0000 (21:14 -0700)]
rt: Fix a corner-case in unwinding that leads to stack overflow

In some scenarios upcall_rust_stack_limit fails to record the stack
limit, leaving it 0, and allowing subsequent Rust code to run into
the red zone.

10 years agostd: Remove gc and stackwalk
Brian Anderson [Fri, 2 Aug 2013 06:31:53 +0000 (23:31 -0700)]
std: Remove gc and stackwalk

These are both obsoleted by the forthcoming new GC.

10 years agoauto merge of #8264 : thestinger/rust/snapshot, r=Aatch
bors [Sun, 4 Aug 2013 06:25:55 +0000 (23:25 -0700)]
auto merge of #8264 : thestinger/rust/snapshot, r=Aatch

10 years agoauto merge of #8269 : brson/rust/fix-task-cleanup, r=brson
bors [Sun, 4 Aug 2013 04:46:56 +0000 (21:46 -0700)]
auto merge of #8269 : brson/rust/fix-task-cleanup, r=brson

...y/catch

And before collect_failure. These are both running user dtors and need to be handled
in the task try/catch block and before the final task cleanup code.

10 years agorm obsolete `for` support from the compiler
Daniel Micay [Sun, 4 Aug 2013 03:51:29 +0000 (23:51 -0400)]
rm obsolete `for` support from the compiler

10 years agolibrustc: Implement `#[no_main]`, which omits the entry point entirely.
Patrick Walton [Sun, 4 Aug 2013 02:59:46 +0000 (19:59 -0700)]
librustc: Implement `#[no_main]`, which omits the entry point entirely.

Useful for SDL and possibly Android too.

10 years agoremove obsolete `foreach` keyword
Daniel Micay [Sat, 3 Aug 2013 16:45:23 +0000 (12:45 -0400)]
remove obsolete `foreach` keyword

this has been replaced by `for`

10 years agoWork around #8256, do not fail the task, just return None
Corey Richardson [Sun, 4 Aug 2013 02:14:01 +0000 (22:14 -0400)]
Work around #8256, do not fail the task, just return None

10 years agoregister snapshots
Daniel Micay [Sat, 3 Aug 2013 16:21:57 +0000 (12:21 -0400)]
register snapshots

10 years agoMerge pull request #8251 from chris-morgan/vim-sigil-highlighting
Daniel Micay [Sun, 4 Aug 2013 01:02:04 +0000 (18:02 -0700)]
Merge pull request #8251 from chris-morgan/vim-sigil-highlighting

Highlight sigils and operators in Vim.

r=huonw, known spurious failure on one bot

10 years agostd::rt: Run local storage cleanup and the box annihilator inside the try/catch
Brian Anderson [Sat, 3 Aug 2013 21:43:16 +0000 (14:43 -0700)]
std::rt: Run local storage cleanup and the box annihilator inside the try/catch

And before collect_failure. These are both running user dtors and need to be handled
in the task try/catch block and before the final task cleanup code.

10 years agoauto merge of #8246 : stepancheg/rust/contains-key, r=thestinger
bors [Sat, 3 Aug 2013 20:40:49 +0000 (13:40 -0700)]
auto merge of #8246 : stepancheg/rust/contains-key, r=thestinger

Map::contains_key can be implemented with Map::find.

Remove several implementations of contains_key.

10 years agoauto merge of #8223 : davidhalperin/rust/master, r=Aatch
bors [Sat, 3 Aug 2013 18:52:50 +0000 (11:52 -0700)]
auto merge of #8223 : davidhalperin/rust/master, r=Aatch

Closes #7907

This is my first pull request so let me know if I've done anything wrong.  I tried to pick off a nice easy one.

10 years agoauto merge of #8219 : sstewartgallus/rust/fix_dynamic_lib, r=graydon
bors [Sat, 3 Aug 2013 17:04:58 +0000 (10:04 -0700)]
auto merge of #8219 : sstewartgallus/rust/fix_dynamic_lib, r=graydon

A test case was also created for this situation to prevent the problem
occuring again.

A similar problem was also fixed for the symbol method.

There was some minor code cleanup.

I am unsatisfied with using /dev/null as an invalid dynamic library. It is not cross platform.

10 years agoauto merge of #8213 : kballard/rust/fd-limit, r=brson
bors [Sat, 3 Aug 2013 14:46:53 +0000 (07:46 -0700)]
auto merge of #8213 : kballard/rust/fd-limit, r=brson

Revert the workaround 49b72bd and instead bump the fd limit on OS X.

10 years agotrans_arg_expr: Omit extra copies for rvalues
Björn Steinbrink [Sat, 3 Aug 2013 10:35:33 +0000 (12:35 +0200)]
trans_arg_expr: Omit extra copies for rvalues

rvalues aren't going to be used anywhere but as the argument, so
there's no point in copying them. LLVM used to eliminate the copy
later, but why bother emitting it in the first place?

10 years agoauto merge of #8186 : huonw/rust/hashmap-=rt, r=Aatch
bors [Sat, 3 Aug 2013 12:37:52 +0000 (05:37 -0700)]
auto merge of #8186 : huonw/rust/hashmap-=rt, r=Aatch

The `new` constructor uses the task-local RNG to retrieve seeds for the
two key values, which requires the runtime. Exposing a constructor that
takes the keys directly allows HashMaps to be used in programs that wish
to avoid the runtime.

10 years agostd: expose the keyed HashMap constructor, for runtime-less use.
Huon Wilson [Thu, 1 Aug 2013 08:11:25 +0000 (18:11 +1000)]
std: expose the keyed HashMap constructor, for runtime-less use.

The `new` constructor uses the task-local RNG to retrieve seeds for the
two key values, which requires the runtime. Exposing a constructor that
takes the keys directly allows HashMaps to be used in programs that wish
to avoid the runtime.

10 years agoFix building problems in extra::unicode.
OGINO Masanori [Fri, 2 Aug 2013 22:06:27 +0000 (07:06 +0900)]
Fix building problems in extra::unicode.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoauto merge of #8206 : omasanori/rust/blk-to-block, r=graydon
bors [Sat, 3 Aug 2013 10:55:52 +0000 (03:55 -0700)]
auto merge of #8206 : omasanori/rust/blk-to-block, r=graydon

Just for consistency.

10 years agoauto merge of #8204 : kballard/rust/str-into-owned, r=graydon
bors [Sat, 3 Aug 2013 09:10:54 +0000 (02:10 -0700)]
auto merge of #8204 : kballard/rust/str-into-owned, r=graydon

The method .into_owned() is meant to be used as an optimization when you
need to get a ~str from a Str, but don't want to unnecessarily copy it
if it's already a ~str.

This is meant to ease functions that look like

  fn foo<S: Str>(strs: &[S])

Previously they could work with the strings as slices using .as_slice(),
but producing ~str required copying the string, even if the vector
turned out be a &[~str] already.

I don't have any concrete uses for this yet, since the one conversion I've done to `&[S]` so far (see PR #8203) didn't actually need owned strings. But having this here may make using `Str` more attractive.

It also may be worth adding an `into_managed()` function, but that one is less obviously useful than `into_owned()`.

10 years agoetc: add the `in` keyword to the emacs mode.
Huon Wilson [Sat, 3 Aug 2013 08:31:23 +0000 (18:31 +1000)]
etc: add the `in` keyword to the emacs mode.

10 years agoauto merge of #8257 : mozilla/rust/rollup, r=thestinger
bors [Sat, 3 Aug 2013 07:25:56 +0000 (00:25 -0700)]
auto merge of #8257 : mozilla/rust/rollup, r=thestinger

1f9c392 r=brson
54e685d r=graydon
1992765 r=thestinger
75155cd r=bblum
def8891 r=graydon

10 years agoMove `use` statements.
OGINO Masanori [Thu, 1 Aug 2013 20:52:08 +0000 (05:52 +0900)]
Move `use` statements.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>