Commit Graph

23939 Commits

Author SHA1 Message Date
bors
be79d7ecdc auto merge of #10416 : cmr/rust/range_size_hint, r=huonw 2013-11-11 04:26:12 -08:00
Corey Richardson
fc01f20c42 Implement size_hint for Range
Closes #8606
2013-11-11 07:22:30 -05:00
Corey Richardson
a46b2b8e7a vec: with_capacity: check for overflow
Fixes #10271
2013-11-11 06:09:28 -05:00
Corey Richardson
2c18983ea5 Clean lint on test build 2013-11-11 05:00:48 -05:00
bors
46100c0622 auto merge of #10408 : alexcrichton/rust/snapshots, r=huonw
Mostly just using the `system` abi where possible.
2013-11-10 21:56:08 -08:00
Alex Crichton
681ea93d52 Enable uv pipe tests on windows
Turns out the pipe names must have special names on windows. Once we have
special names, all the tests pass just fine.

Closes #10386
2013-11-10 20:43:08 -08:00
Alex Crichton
7407bcc1a2 Register new snapshots 2013-11-10 17:51:56 -08:00
bors
63cfc9989d auto merge of #10406 : alexcrichton/rust/issue-10405, r=huonw
The logging macros all use libuv-based I/O, and there was one stray debug
statement in task::spawn which was executing before the I/O context was ready.
Remove it and add a test to make sure that we can continue to debug this sort of
code.

Closes #10405
2013-11-10 16:01:12 -08:00
bors
95b46a1763 auto merge of #10226 : nibrahim/rust/docepub, r=alexcrichton
Added two new rules to create epubs out of the tutorial and reference manual source files. This is useful and doesn't add any new dependencies to the build process.
2013-11-10 14:46:04 -08:00
Alex Crichton
64afa4ea22 Only run dsymutil on OSX in debug builds
When there are no debug symbols generated, then the program just prints an
annoying warning otherwise.

Closes #10198
2013-11-10 13:58:11 -08:00
bors
fe48d8fcd1 auto merge of #10399 : huonw/rust/get-opt-doc, r=alexcrichton 2013-11-10 13:36:11 -08:00
Alex Crichton
b71d629744 Remove a debug! statement before I/O is ready
The logging macros all use libuv-based I/O, and there was one stray debug
statement in task::spawn which was executing before the I/O context was ready.
Remove it and add a test to make sure that we can continue to debug this sort of
code.

Closes #10405
2013-11-10 13:05:36 -08:00
bors
b5e602ac56 auto merge of #10321 : alexcrichton/rust/uv-rewrite, r=brson
The major impetus for this pull request was to remove all usage of `~fn()` in `librustuv`. This construct is going away as a language feature, and additionally it imposes the requirement that all I/O operations have at least one allocation. This allocation has been seen to have a fairly high performance impact in profiles of I/O benchmarks.

I've migrated `librustuv` away from all usage of `~fn()`, and at the same time it no longer allocates on every I/O operation anywhere. The scheduler is now much more tightly integrated with all of the libuv bindings and most of the uv callbacks are specialized functions for a certain procedure. This is a step backwards in terms of making `librustuv` usable anywhere else, but I think that the performance gains are a big win here.

In just a simple benchmark of reading/writing 4k of 0s at a time between a tcp client/server in separate processes on the same system, I have witnessed the throughput increase from ~750MB/s to ~1200MB/s with this change applied.

I'm still in the process of testing this change, although all the major bugs (to my knowledge) have been fleshed out and removed. There are still a few spurious segfaults, and that's what I'm currently investigating. In the meantime, I wanted to put this up for review to get some eyes on it other than mine. I'll update this once I've got all the tests passing reliably again.
2013-11-10 12:26:10 -08:00
Alex Crichton
e38a89d0b0 Fix usage of libuv for windows 2013-11-10 12:23:57 -08:00
Huon Wilson
8e719bdfb5 extra::getopts: update docs for minor renaming. 2013-11-10 23:28:26 +11:00
Alex Crichton
c5fdd69d3e Carefully destroy channels at the right time.
When a channel is destroyed, it may attempt scheduler operations which could
move a task off of it's I/O scheduler. This is obviously a bad interaction, and
some finesse is required to make it work (making destructors run at the right
time).

Closes #10375
2013-11-10 01:37:12 -08:00
Alex Crichton
86a321b65d Another round of test fixes from previous commits 2013-11-10 01:37:12 -08:00
Alex Crichton
3a3eefc5c3 Update to the latest libuv
At this time, also point the libuv submodule to the official repo instead of my
own off to the side.

cc #10246
Closes #10329
2013-11-10 01:37:11 -08:00
Alex Crichton
b652bbc670 Fall back from uv tty instances more aggressively
It appears that uv's support for interacting with a stdio stream as a tty when
it's actually a pipe is pretty problematic. To get around this, promote a check
to see if the stream is a tty to the top of the tty constructor, and bail out
quickly if it's not identified as a tty.

Closes #10237
2013-11-10 01:37:11 -08:00
Alex Crichton
df4c0b8e43 Make the uv bindings resilient to linked failure
In the ideal world, uv I/O could be canceled safely at any time. In reality,
however, we are unable to do this. Right now linked failure is fairly flaky as
implemented in the runtime, making it very difficult to test whether the linked
failure mechanisms inside of the uv bindings are ready for this kind of
interaction.

Right now, all constructors will execute in a task::unkillable block, and all
homing I/O operations will prevent linked failure in the duration of the homing
operation. What this means is that tasks which perform I/O are still susceptible
to linked failure, but the I/O operations themselves will never get interrupted.
Instead, the linked failure will be received at the edge of the I/O operation.
2013-11-10 01:37:11 -08:00
Alex Crichton
5e6bbc6bfa Assorted test fixes and merge conflicts 2013-11-10 01:37:11 -08:00
Alex Crichton
b545751597 Rework the idle callback to have a safer interface
It turns out that the uv implementation would cause use-after-free if the idle
callback was used after the call to `close`, and additionally nothing would ever
really work that well if `start()` were called twice. To change this, the
`start` and `close` methods were removed in favor of specifying the callback at
creation, and allowing destruction to take care of closing the watcher.
2013-11-10 01:37:11 -08:00
Alex Crichton
d08aadcc9a Update all uv tests to pass again 2013-11-10 01:37:11 -08:00
Alex Crichton
0df8b0057c Work around bugs in 32-bit enum FFI
cc #10308
2013-11-10 01:37:11 -08:00
Alex Crichton
1bdaea827e Migrate all streams to synchronous closing 2013-11-10 01:37:11 -08:00
Alex Crichton
f9abd998d6 Add bindings to uv's utime function
This exposes the ability to change the modification and access times on a file.

Closes #10266
2013-11-10 01:37:11 -08:00
Alex Crichton
497d63f0bc Don't overflow in a converting stat times to u64
Closes #10297
2013-11-10 01:37:11 -08:00
Alex Crichton
aa78c3d6f6 Clean up the remaining chunks of uv 2013-11-10 01:37:11 -08:00
Alex Crichton
584b359348 Migrate uv net bindings away from ~fn() 2013-11-10 01:37:11 -08:00
Alex Crichton
5842b606a7 Migrate uv getaddrinfo away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
be896288a3 Migrate uv file bindings away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
c1b5c4db8f Start migrating stream I/O away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
6690bcb101 Fixing rebase conflicts and such
This cleans up the merging of removing ~fn() and removing C++ wrappers to a
compile-able and progress-ready state
2013-11-10 01:37:10 -08:00
Alex Crichton
18ce014e9d Remove usage of ~fn from the scheduler 2013-11-10 01:37:10 -08:00
Alex Crichton
28219fc679 Remove usage of ~fn() from uv async/idle 2013-11-10 01:37:10 -08:00
Alex Crichton
9286d5113d Migrate uv signal handling away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
ceab326e82 Migrate uv process bindings away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
24b4223418 Migrate uv timer bindings away from ~fn() 2013-11-10 01:37:10 -08:00
Alex Crichton
653406fcf7 uv: Remove closure-based home_for_io for raii
Using an raii wrapper means that there's no need for a '_self' variant and we
can greatly reduce the amount of 'self_'-named variables.
2013-11-10 01:37:10 -08:00
Alex Crichton
4bcde6bc06 uv: Provide a helper fn to Result<(), IoError> 2013-11-10 01:37:10 -08:00
Alex Crichton
30c885ea52 uv: Remove lots of uv/C++ wrappers 2013-11-10 01:37:10 -08:00
Young-il Choi
9bb1e256d7 temporarily disable tests on android and tagging issue number #10393 2013-11-10 12:02:23 +09:00
Young-il Choi
5daf6b7849 temporarily disable tests on android and tagging issue number #10380 2013-11-10 12:01:22 +09:00
Young-il Choi
d6f7669c78 temporarily disable tests on android and tagging issue number #10379 2013-11-10 11:57:27 +09:00
Young-il Choi
480894796a temporarily disable tests on android and tagging issue number #10378 2013-11-10 11:57:03 +09:00
Young-il Choi
e3f9f45439 disable tests on android since tcp/ip permission cannot be acquired without help of apk 2013-11-10 08:18:12 +09:00
Young-il Choi
ca55317e90 tagging issue number(#10381) 2013-11-10 08:18:12 +09:00
bors
3851f908d1 auto merge of #10367 : alexcrichton/rust/system-abi, r=nikomatsakis
This adds an other ABI option which allows a custom selection over the target
architecture and OS. The only current candidate for this change is that kernel32
on win32 uses stdcall, but on win64 it uses the cdecl calling convention.
Otherwise everywhere else this is defined as using the Cdecl calling convention.

cc #10049
Closes #8774
2013-11-09 12:26:12 -08:00
Alex Crichton
2fcc70ec9d Add a "system" ABI
This adds an other ABI option which allows a custom selection over the target
architecture and OS. The only current candidate for this change is that kernel32
on win32 uses stdcall, but on win64 it uses the cdecl calling convention.
Otherwise everywhere else this is defined as using the Cdecl calling convention.

cc #10049
Closes #8774
2013-11-09 11:16:09 -08:00
bors
8379890c05 auto merge of #10153 : nikomatsakis/rust/issue-4846-multiple-lifetime-parameters-7, r=pnkfelix
Fully support multiple lifetime parameters on types and elsewhere, removing special treatment for `'self`. I am submitting this a touch early in that I plan to push a new commit with more tests specifically targeting types with multiple lifetime parameters -- but the current code bootstraps and passes `make check`.

Fixes #4846
2013-11-09 08:36:09 -08:00