Alex Crichton [Sat, 9 Nov 2013 05:59:50 +0000 (21:59 -0800)]
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).
Alex Crichton [Thu, 7 Nov 2013 23:24:30 +0000 (15:24 -0800)]
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.
Alex Crichton [Thu, 7 Nov 2013 23:13:06 +0000 (15:13 -0800)]
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.
Alex Crichton [Wed, 6 Nov 2013 19:38:53 +0000 (11:38 -0800)]
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.
bors [Sat, 9 Nov 2013 20:26:12 +0000 (12:26 -0800)]
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.
Alex Crichton [Fri, 8 Nov 2013 19:06:57 +0000 (11:06 -0800)]
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.
bors [Sat, 9 Nov 2013 16:36:09 +0000 (08:36 -0800)]
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`.
bors [Sat, 9 Nov 2013 10:11:15 +0000 (02:11 -0800)]
auto merge of #10368 : tautologico/rust/default_pkgid, r=catamorphism
This Fixes #10265 and paves the way for fixing #9543. It works by adding a 'package_id' attribute by default for library crates that don't specify it. This is necessary to use the 'extern mod foo = "bar"' form instead of 'extern mod foo(name="bar") (as per #9543), because the former adds a required package_id when trying to link with the bar crate. I added a simple test to ensure that the default package_id value is being generated, and also added an explicit package_id in the link attribute in all rust libs to avoid getting warnings about default package_id values when building rust.
bors [Sat, 9 Nov 2013 08:51:16 +0000 (00:51 -0800)]
auto merge of #10359 : tomassedovic/rust/typeid-iterbytes, r=pcwalton
I'm not sure this is something you're interested in, but I was playing around the Any trait a bit and I wanted to try it as a key in a HashMap. To do that, TypeId needs to implement IterBytes.
Niko Matsakis [Tue, 29 Oct 2013 10:12:50 +0000 (06:12 -0400)]
Improve error reporting for region inference failures to make use of
all the information it has at its disposal. Unfortunately this also
reveals that we need to improve the reporting heuristics further,
as sometimes the errors it chooses to emit seem somewhat mystifying
and are not related to the actual problem.
Niko Matsakis [Tue, 29 Oct 2013 10:11:22 +0000 (06:11 -0400)]
Move comparing of impl methods against trait from collect to check.
This code fits better in check because it is checking that the impl
matches the interface. This allows us to avoid the awkward constructions
that lazilly collect traits and so forth. It also permits us to make
use of the results of variance inference.
Niko Matsakis [Tue, 29 Oct 2013 10:08:34 +0000 (06:08 -0400)]
Introduce new variance inference pass that replaces (and generalizes) old
region-parameterization/variance inference. We now compute variance for
type parameters but do not make use of it (most of the way towards #3598).
Unfortunately, this means the error is disconnected from the `deriving`
itself but there's no current way to pass that information through to
rustc except via the spans, at the moment.
Unfortunately, this means the error is disconnected from the `deriving`
itself but there's no current way to pass that information through to
rustc except via the spans, at the moment.
bors [Fri, 8 Nov 2013 08:11:07 +0000 (00:11 -0800)]
auto merge of #10303 : niftynif/rust/master, r=catamorphism
r? @catamorphism
First contribution; contains struct definitions and some useful traits. Can possibly be improved by removing the dependence on the Clone trait. This is intended to be the beginning of a long-term project.
bors [Fri, 8 Nov 2013 05:41:07 +0000 (21:41 -0800)]
auto merge of #10281 : klutzy/rust/rt-timezone, r=alexcrichton
Previously #9418 fixed utf-8 assertion issue by wcsftime,
but the function didn't work as expected: it follows the locale
set by setlocale(), not the system code page.
This patch fixes it by manual multibyte-to-unicode conversion.
bors [Fri, 8 Nov 2013 03:16:11 +0000 (19:16 -0800)]
auto merge of #10333 : huonw/rust/ascii, r=alexcrichton
This renames to_str_ascii to as_str_ascii and makes it non-copying,
which is possible now that strings no longer have a hidden extra
byte/null terminator.
bors [Thu, 7 Nov 2013 23:46:13 +0000 (15:46 -0800)]
auto merge of #10335 : ksh8281/rust/update_for_ndk_r9b, r=brson
update for ndk r9b (#10323)
````
Android NDK, Revision 9b (October 2013)
Important changes:
Updated include/android/*h and math.h for all Android API levels up to 18,
including the addition of levels 13, 15, 16 and 17.
For information on added APIs,
see commit messages for Changes 68012 and 68014. (Issues 47150, 58528, and 38423)
````
Huon Wilson [Thu, 7 Nov 2013 07:59:40 +0000 (18:59 +1100)]
std::ascii: Provide a copyless [Ascii] -> str method.
This renames to_str_ascii to as_str_ascii and makes it non-copying,
which is possible now that strings no longer have a hidden extra
byte/null terminator.
kud1ing [Fri, 1 Nov 2013 18:39:35 +0000 (19:39 +0100)]
Fixes for compilation to iOS:
- remove /usr/include from the include path since the iOS SDK provides the correct version
- `_NSGetEnviron()` is private and not available on iOS
- `.align` without an argument is not allowed with the Apple tools. 2^2 should be the default alignment
- ignore error messages for XCode < 5
- pass include path to libuv
bors [Wed, 6 Nov 2013 07:36:06 +0000 (23:36 -0800)]
auto merge of #10306 : alexcrichton/rust/issue-9970-better, r=huonw
There were a few ambiguous error messages which look like they could have
cropped up from either the rust compiler for the format string parser. To
differentiate, the prefix 'invalid format string' is now added in front of all
format string errors.