]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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>
10 years agoRename sum -> _sum.
OGINO Masanori [Thu, 1 Aug 2013 20:51:29 +0000 (05:51 +0900)]
Rename sum -> _sum.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoRemove unused variables.
OGINO Masanori [Thu, 1 Aug 2013 14:46:42 +0000 (23:46 +0900)]
Remove unused variables.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoExplicitly impl Clone for RWArc
Kevin Ballard [Thu, 1 Aug 2013 22:02:03 +0000 (15:02 -0700)]
Explicitly impl Clone for RWArc

RWArc had a clone() method, but it was part of impl RWArc instead of
an implementation of Clone.

Stick with the explicit implementation instead of deriving Clone so we
can have a docstring.

Fixes #8052.

10 years agostd: add benchmark for vec.mut_iter.
Huon Wilson [Fri, 2 Aug 2013 14:23:05 +0000 (00:23 +1000)]
std: add benchmark for vec.mut_iter.

10 years agostd: use ptr.offset where possible in the vec iterator.
Huon Wilson [Fri, 2 Aug 2013 13:34:11 +0000 (23:34 +1000)]
std: use ptr.offset where possible in the vec iterator.

Closes #8212.

10 years agooption: mutate() and mutate_default() should return bool
Kevin Ballard [Thu, 1 Aug 2013 22:18:10 +0000 (15:18 -0700)]
option: mutate() and mutate_default() should return bool

Fixes #8047.

10 years agofixed the buffer to make it a more reasonable size
toddaaro [Fri, 2 Aug 2013 23:53:04 +0000 (16:53 -0700)]
fixed the buffer to make it a more reasonable size

10 years agomodified logging function to truncate output and adjusted error output formatting...
toddaaro [Fri, 2 Aug 2013 23:48:29 +0000 (16:48 -0700)]
modified logging function to truncate output and adjusted error output formatting tests to be compatible with both the new and old runtimes

10 years agoMerge pull request #8244 from thestinger/for
Daniel Micay [Sat, 3 Aug 2013 07:07:20 +0000 (00:07 -0700)]
Merge pull request #8244 from thestinger/for

make `for` parse as `foreach` does

r=huonw, bors is acting up and this has been run through the try bots

10 years agorm obsolete documentation on `for`
Daniel Micay [Sat, 3 Aug 2013 05:33:06 +0000 (01:33 -0400)]
rm obsolete documentation on `for`

it is documented in the container/iterator tutorial, not the basic
tutorial

10 years agomake `for` parse as `foreach` does
Daniel Micay [Sat, 3 Aug 2013 03:20:22 +0000 (23:20 -0400)]
make `for` parse as `foreach` does

Closes #6997

10 years agoreplace all remaining `for` with `foreach` or `do`
Daniel Micay [Fri, 2 Aug 2013 06:17:20 +0000 (02:17 -0400)]
replace all remaining `for` with `foreach` or `do`

10 years agoVim highlighting: remove `foreach` keyword
Chris Morgan [Sat, 3 Aug 2013 05:56:18 +0000 (15:56 +1000)]
Vim highlighting: remove `foreach` keyword

10 years agoSuppress a libuv leak on mac
Brian Anderson [Sat, 3 Aug 2013 05:05:32 +0000 (22:05 -0700)]
Suppress a libuv leak on mac

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.

10 years agoauto merge of #8235 : pcwalton/rust/unsafe-extern-fns, r=pcwalton
bors [Sat, 3 Aug 2013 05:05:03 +0000 (22:05 -0700)]
auto merge of #8235 : pcwalton/rust/unsafe-extern-fns, r=pcwalton

r? @brson

10 years agolibrustc: Disallow "unsafe" for external functions
Patrick Walton [Fri, 2 Aug 2013 21:30:00 +0000 (14:30 -0700)]
librustc: Disallow "unsafe" for external functions

10 years agolibrustc: Introduce a new visitor type based on traits and port syntax to it.
Patrick Walton [Sat, 20 Jul 2013 01:42:11 +0000 (18:42 -0700)]
librustc: Introduce a new visitor type based on traits and port syntax to it.

This is preparation for removing `@fn`.

This does *not* use default methods yet, because I don't know
whether they work. If they do, a forthcoming PR will use them.

This also changes the precedence of `as`.

10 years agoHighlight sigils and operators in Vim.
Chris Morgan [Sat, 3 Aug 2013 04:36:27 +0000 (14:36 +1000)]
Highlight sigils and operators in Vim.

Sigil highlighting isn't perfect (especially how it handles ``&``) but
after having used it for a week I feel it to be considerably nicer than
nothing. As usual, if you don't like it, you can turn it off easily by
overriding the default highlighting.

Generics are not handled specially; this means that for something like
``S<T>``, the ``<`` and ``>`` are highlighted as operators. For myself,
I like this, and there is no way to make it properly context aware
without expanding the syntax matching enormously.

Also, special characters are highlighted properly in strings/chars, e.g.
``"\x00"`` or ``'\Ufedcba98'`` appropriately.

10 years agoBump fd limit on macos when running rt tests
Kevin Ballard [Thu, 18 Jul 2013 01:50:53 +0000 (18:50 -0700)]
Bump fd limit on macos when running rt tests

OS X defaults the ulimit for open files to 256 for programs launched
from the Terminal (GUI apps get a higher default). Unfortunately this is
too low for the rt tests, which deliberately overcommit and create a lot
of threads (which means a lot of schedulers, and each scheduler needs at
least 2 fds).

By calling sysctl() and setrlimit() we can bump the fd limit up to the
maximum allowed (on stock OS X it's 10240).

Fixes #7772.

10 years agoRevert "std::rt: Use a constant 4 threads for multithreaded sched tests"
Kevin Ballard [Fri, 2 Aug 2013 01:23:30 +0000 (18:23 -0700)]
Revert "std::rt: Use a constant 4 threads for multithreaded sched tests"

This workaround was less than ideal. A better solution is to raise the
fd limit.

This reverts commit 49b72bdd77916e27aaf95909516702c1450f11ac.

10 years agoauto merge of #8174 : DaGenix/rust/digest-improvements, r=brson
bors [Sat, 3 Aug 2013 02:29:00 +0000 (19:29 -0700)]
auto merge of #8174 : DaGenix/rust/digest-improvements, r=brson

Same content as #8097, but bors had an issue with that pull request. Opening a new one.

10 years agoAdd default implementation of Map::contains_key function
Stepan Koltsov [Sat, 3 Aug 2013 01:54:05 +0000 (05:54 +0400)]
Add default implementation of Map::contains_key function

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

Remove several implementations of contains_key.

10 years agoSha1: Update Sha1 to use new functionality in cryptoutil.rs
Palmer Cox [Tue, 30 Jul 2013 04:07:59 +0000 (00:07 -0400)]
Sha1: Update Sha1 to use new functionality in cryptoutil.rs

10 years agoCrypto: Add overflow checking addition functions.
Palmer Cox [Tue, 30 Jul 2013 04:07:51 +0000 (00:07 -0400)]
Crypto: Add overflow checking addition functions.

Added functions to cryptoutil.rs that perform an addition after shifting
the 2nd parameter by a specified constant. These function fail!() if integer
overflow will result. Updated the Sha2 implementation to use these functions.

10 years agoCrypto: Add large input tests for all Digests
Palmer Cox [Tue, 30 Jul 2013 01:12:20 +0000 (21:12 -0400)]
Crypto: Add large input tests for all Digests

Create a helper function in cryptoutil.rs which feeds 1,000,000 'a's into
a Digest with varying input sizes and then checks the result. This is
essentially the same as one of Sha1's existing tests, so, that test was
re-implemented using this method. New tests were added using this method for
Sha512 and Sha256.

10 years agoCrypto: Remove DigestUtil and convert to default methods on the Digest trait.
Palmer Cox [Sat, 27 Jul 2013 19:12:49 +0000 (15:12 -0400)]
Crypto: Remove DigestUtil and convert to default methods on the Digest trait.

10 years agoSha2: Re-write the Sha2 compression functions to improve performance.
Palmer Cox [Sat, 27 Jul 2013 18:03:57 +0000 (14:03 -0400)]
Sha2: Re-write the Sha2 compression functions to improve performance.

The Sha2 compression functions were re-written to execute the message
scheduling calculations in the same loop as the rest of the compression
function. The compiler is able to generate much better code. Additionally,
innermost part of the compression functions were turned into macros to
reduce code duplicate and to make the functions more concise.

10 years agoSha2: Create cryptoutil.rs and re-write the Sha2 module to make use of it.
Palmer Cox [Sat, 27 Jul 2013 18:02:18 +0000 (14:02 -0400)]
Sha2: Create cryptoutil.rs and re-write the Sha2 module to make use of it.

There are 2 main pieces of functionality in cryptoutil.rs:
* A set of unsafe function for efficiently reading and writing u32 and u64
  values. All of these functions are fairly easy to audit to confirm that
  they do what they are supposed to.
* A FixedBuffer struct. This struct keeps track of input data until there
  is enough of it to execute the a function on it which expects a fixed
  block of data.

The Sha2 module was rewritten to take advantage of the new functions in
cryptoutil as well as FixedBuffer. The result is that the duplicate code
for maintaining a buffer of input data is removed from the Sha512 and
Sha256 implementation. Additionally, the FixedBuffer code is much more
efficient than the previous code was.

10 years agoSha2: Remove the result_X() methods; move logic into the Digest impls.
Palmer Cox [Sat, 27 Jul 2013 17:59:41 +0000 (13:59 -0400)]
Sha2: Remove the result_X() methods; move logic into the Digest impls.

The result_X() methods just calculate an output of a fixed size. They don't
really have much to do with running the actually hash algorithm until the very
last step - the output. It makes much more sense to put all this logic into
the Digest impls for each specific variation on the hash function.

10 years agoSha2: Rearrage traits / impls / structs.
Palmer Cox [Sat, 27 Jul 2013 17:46:58 +0000 (13:46 -0400)]
Sha2: Rearrage traits / impls / structs.

The code was arranged so that the core Sha2 code came first, and then
all of the various implementation of Digest followed along later. The
problem is that the Sha512 compression function code is far away from
the Sha512 Digest implementation, so, if you are trying to read over
the code, you need to scroll all around the file for no good reason. The
code was rearranged so that all of the Sha512 code is in one place and
all of the Sha256 code is in another and so that all impls for a struct
are near the definition of that struct.

10 years agoSha2: Remove unecessary integer type specifications.
Palmer Cox [Sat, 27 Jul 2013 17:41:50 +0000 (13:41 -0400)]
Sha2: Remove unecessary integer type specifications.

10 years agoRename IpAddr -> SocketAddr, extract IpAddr from SocketAddr
Stepan Koltsov [Fri, 2 Aug 2013 22:06:24 +0000 (02:06 +0400)]
Rename IpAddr -> SocketAddr, extract IpAddr from SocketAddr

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).

10 years agoauto merge of #8234 : bblum/rust/assorted-fixes, r=brson
bors [Fri, 2 Aug 2013 21:55:54 +0000 (14:55 -0700)]
auto merge of #8234 : bblum/rust/assorted-fixes, r=brson

This fixes 4 bugs that prevented the extra::arc and extra::sync tests from passing on the new runtime.

* In ```Add SendDeferred trait``` I add a non-rescheduling ```send_deferred``` method to our various channel types. The ```extra::sync``` concurrency primitives need this guarantee so they can send while inside of an exclusive. (This fixes deterministic deadlocks seen with ```RUST_THREADS=1```.)
* In "Fix nasty double-free bug" I make sure that a ```ChanOne``` suppresses_finalize *before* rescheduling away to the receiver, so in case it gets a kill signal upon coming back, the destructor is inhibited as desired. (This is pretty uncommon on multiple CPUs but showed up always with ```RUST_THREADS=1```.)
* In ```Fix embarrassing bug where 'unkillable' would unwind improperly``` I make sure the task's unkillable counter stays consistent when a kill signal is received right at the start of an unkillable section. (This is a very uncommon race and can only occur with multiple CPUs.)
* In ```Don't fail from kill signals if already unwinding``` I do pretty much what it says on the tin. Surprising that it took the whole suite of sync/arc tests to expose this.

The other two commits are cleanup.

r @brson

10 years agoAdd backticks around trait name in conflicting implementations error message
David Halperin [Fri, 2 Aug 2013 21:53:59 +0000 (17:53 -0400)]
Add backticks around trait name in conflicting implementations error message

10 years agoAdd trait name to conflicting implementation error message
David Halperin [Fri, 2 Aug 2013 11:11:53 +0000 (07:11 -0400)]
Add trait name to conflicting implementation error message

10 years agoAdd an assert_may_sleep() check on every context switch.
Ben Blum [Fri, 2 Aug 2013 21:23:00 +0000 (17:23 -0400)]
Add an assert_may_sleep() check on every context switch.

10 years agoDon't fail from kill signals if already unwinding.
Ben Blum [Fri, 2 Aug 2013 21:14:56 +0000 (17:14 -0400)]
Don't fail from kill signals if already unwinding.

10 years ago(cleanup) Use more do...finally in extra::sync.
Ben Blum [Fri, 2 Aug 2013 21:09:32 +0000 (17:09 -0400)]
(cleanup) Use more do...finally in extra::sync.

10 years agoFix embarrassing bug where 'unkillable' would unwind improperly when it receives...
Ben Blum [Fri, 2 Aug 2013 20:06:13 +0000 (16:06 -0400)]
Fix embarrassing bug where 'unkillable' would unwind improperly when it receives a kill signal.

10 years agoFix nasty double-free bug where a newrt chan could get killed after rescheduling...
Ben Blum [Fri, 2 Aug 2013 01:57:58 +0000 (21:57 -0400)]
Fix nasty double-free bug where a newrt chan could get killed after rescheduling but before suppressing_finalize.

10 years agoAdd SendDeferred trait and use it to fix #8214.
Ben Blum [Fri, 2 Aug 2013 01:57:15 +0000 (21:57 -0400)]
Add SendDeferred trait and use it to fix #8214.

10 years agostd: Speed up str::is_utf8
blake2-ppc [Fri, 2 Aug 2013 16:34:00 +0000 (18:34 +0200)]
std: Speed up str::is_utf8

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)

10 years agoauto merge of #8221 : brson/rust/single-threaded, r=graydon
bors [Fri, 2 Aug 2013 17:52:50 +0000 (10:52 -0700)]
auto merge of #8221 : brson/rust/single-threaded, r=graydon

This is the last major runtime feature needed for the transition to the new scheduler.

10 years agoauto merge of #8202 : pnkfelix/rust/fsk-issue8056-make-crates-must-dep-on-subcrates...
bors [Fri, 2 Aug 2013 16:13:53 +0000 (09:13 -0700)]
auto merge of #8202 : pnkfelix/rust/fsk-issue8056-make-crates-must-dep-on-subcrates, r=graydon

Reorder TEST_HOST_CRATES in hopes of exposing future instances of this bug.

Fix #8056

10 years agoauto merge of #8195 : bblum/rust/task-cleanup, r=brson
bors [Fri, 2 Aug 2013 14:31:52 +0000 (07:31 -0700)]
auto merge of #8195 : bblum/rust/task-cleanup, r=brson

In the first commit it is obvious why some of the barriers can be changed to ```Relaxed```, but it is not as obvious for the once I changed in ```kill.rs```. The rationale for those is documented as part of the documenting commit.

Also the last commit is a temporary hack to prevent kill signals from being received in taskgroup cleanup code, which could be fixed in a more principled way once the old runtime is gone.

10 years agoauto merge of #8193 : cmr/rust/linux-errno, r=graydon
bors [Fri, 2 Aug 2013 12:49:53 +0000 (05:49 -0700)]
auto merge of #8193 : cmr/rust/linux-errno, r=graydon

10 years agoauto merge of #8188 : huonw/rust/cfg-macro, r=pcwalton
bors [Fri, 2 Aug 2013 10:52:51 +0000 (03:52 -0700)]
auto merge of #8188 : huonw/rust/cfg-macro, r=pcwalton

Example:

    if cfg!(test) {
       calculation_to_run_only_when_testing();
    }

Closes #8130.

10 years agoauto merge of #8175 : brson/rust/nodbg, r=graydon
bors [Fri, 2 Aug 2013 08:13:51 +0000 (01:13 -0700)]
auto merge of #8175 : brson/rust/nodbg, r=graydon

This stuff is ancient, unused, and tied to oldsched

10 years agostd: Implement SingleThreaded spawn mode for newsched
Brian Anderson [Wed, 31 Jul 2013 02:02:21 +0000 (19:02 -0700)]
std: Implement SingleThreaded spawn mode for newsched

10 years agoFix calling destructor on uninitialized dynamic library crash.
Steven Stewart-Gallus [Thu, 1 Aug 2013 21:58:37 +0000 (14:58 -0700)]
Fix calling destructor on uninitialized dynamic library crash.

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.

10 years agoauto merge of #8216 : thestinger/rust/range, r=huonw
bors [Fri, 2 Aug 2013 05:10:45 +0000 (22:10 -0700)]
auto merge of #8216 : thestinger/rust/range, r=huonw

10 years agoreplace `range` with an external iterator
Daniel Micay [Thu, 1 Aug 2013 22:35:46 +0000 (18:35 -0400)]
replace `range` with an external iterator

10 years agoauto merge of #8185 : alexcrichton/rust/issue-8179, r=pcwalton
bors [Fri, 2 Aug 2013 02:46:47 +0000 (19:46 -0700)]
auto merge of #8185 : alexcrichton/rust/issue-8179, r=pcwalton

* All globals marked as `pub` won't have the `internal` linkage type set
* All global references across crates are forced to use the address of the
  global in the other crate via an external reference.

r? @graydon

Closes #8179

10 years agoauto merge of #8116 : toddaaro/rust/tls-tk-pr-pre, r=brson
bors [Fri, 2 Aug 2013 01:01:42 +0000 (18:01 -0700)]
auto merge of #8116 : toddaaro/rust/tls-tk-pr-pre, r=brson

Merged with task killing code this time around.

10 years agoxfailed the myserious failing test
toddaaro [Fri, 2 Aug 2013 00:23:55 +0000 (17:23 -0700)]
xfailed the myserious failing test

10 years agoReplace 'blk' -> 'block' in AstBuilder.
OGINO Masanori [Thu, 1 Aug 2013 15:34:59 +0000 (00:34 +0900)]
Replace 'blk' -> 'block' in AstBuilder.

I didn't rename variables because they are local and are not parts of
the public interfaces.

Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
10 years agoauto merge of #8172 : brson/rust/nomorestack, r=pcwalton
bors [Thu, 1 Aug 2013 23:19:37 +0000 (16:19 -0700)]
auto merge of #8172 : brson/rust/nomorestack, r=pcwalton

The new scheduler does not yet implement split stacks

10 years agoMake crate tests depend on their extern crates. Reorder TEST_HOST_CRATES in hopes...
Felix S. Klock II [Thu, 1 Aug 2013 23:11:24 +0000 (01:11 +0200)]
Make crate tests depend on their extern crates.  Reorder TEST_HOST_CRATES in hopes of exposing future instances of this bug.

10 years agostr: Add method .into_owned(self) -> ~str to Str
Kevin Ballard [Thu, 1 Aug 2013 22:54:58 +0000 (15:54 -0700)]
str: Add method .into_owned(self) -> ~str to Str

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.

10 years agomodified local to include an implementation for try_unsafe_borrow::<Task> so that...
toddaaro [Thu, 1 Aug 2013 22:08:51 +0000 (15:08 -0700)]
modified local to include an implementation for try_unsafe_borrow::<Task> so that the log methods will work

10 years agofixed incorrect handling of returned scheduler option and restructed scheduler functi...
toddaaro [Wed, 31 Jul 2013 20:52:22 +0000 (13:52 -0700)]
fixed incorrect handling of returned scheduler option and restructed scheduler functions slightly

10 years agominor tweaks - unboxed the coroutine so that it is no longer a ~ pointer inside the...
toddaaro [Mon, 29 Jul 2013 20:34:08 +0000 (13:34 -0700)]
minor tweaks - unboxed the coroutine so that it is no longer a ~ pointer inside the task struct, and also added an assert to verify that send is never called inside scheduler context as it is undefined (BROKEN) if that happens

10 years agoFixed a race where a scheduler configured to only run tasks pinned to it would "bounc...
toddaaro [Mon, 29 Jul 2013 19:06:36 +0000 (12:06 -0700)]
Fixed a race where a scheduler configured to only run tasks pinned to it would "bounch" a regular task in and out of the work queue without allowing a different scheduler to run it.