Commit Graph

27527 Commits

Author SHA1 Message Date
bors 42e1003e4a auto merge of #13158 : alexcrichton/rust/issue-13123, r=brson
Some unix platforms will send a SIGPIPE signal instead of returning EPIPE from a
syscall by default. The native runtime doesn't install a SIGPIPE handler,
causing the program to die immediately in this case. This brings the behavior in
line with libgreen by ignoring SIGPIPE and propagating EPIPE upwards to the
application in the form of an IoError.

Closes #13123
2014-03-28 12:46:44 -07:00
Alex Crichton 68c2706780 native: Ignore SIGPIPE by default
Some unix platforms will send a SIGPIPE signal instead of returning EPIPE from a
syscall by default. The native runtime doesn't install a SIGPIPE handler,
causing the program to die immediately in this case. This brings the behavior in
line with libgreen by ignoring SIGPIPE and propagating EPIPE upwards to the
application in the form of an IoError.

Closes #13123
2014-03-28 11:21:48 -07:00
bors fd4f15ea6b auto merge of #13131 : alexcrichton/rust/issue-13124, r=brson
It turns out that on linux, and possibly other platforms, child processes will
continue to accept signals until they have been *reaped*. This means that once
the child has exited, it will succeed to receive signals until waitpid() has
been invoked on it.

This is unfortunate behavior, and differs from what is seen on OSX and windows.
This commit changes the behavior of Process::signal() to be the same across
platforms, and updates the documentation of Process::kill() to note that when
signaling a foreign process it may accept signals until reaped.

Implementation-wise, this invokes waitpid() with WNOHANG before each signal to
the child to ensure that if the child has exited that we will reap it. Other
possibilities include installing a SIGCHLD signal handler, but at this time I
believe that that's too complicated.

Closes #13124
2014-03-28 11:21:47 -07:00
Alex Crichton 0e190b9a4a native: Use WNOHANG before signaling
It turns out that on linux, and possibly other platforms, child processes will
continue to accept signals until they have been *reaped*. This means that once
the child has exited, it will succeed to receive signals until waitpid() has
been invoked on it.

This is unfortunate behavior, and differs from what is seen on OSX and windows.
This commit changes the behavior of Process::signal() to be the same across
platforms, and updates the documentation of Process::kill() to note that when
signaling a foreign process it may accept signals until reaped.

Implementation-wise, this invokes waitpid() with WNOHANG before each signal to
the child to ensure that if the child has exited that we will reap it. Other
possibilities include installing a SIGCHLD signal handler, but at this time I
believe that that's too complicated.

Closes #13124
2014-03-28 11:07:58 -07:00
bors b8601a3d8b auto merge of #13160 : FlaPer87/rust/rename-pod, r=thestinger
So far, we've used the term POD "Plain Old Data" to refer to types that
can be safely copied. However, this term is not consistent with the
other built-in bounds that use verbs instead. This patch renames the `Pod`
kind into `Copy`.

RFC: 0003-opt-in-builtin-traits

r? @nikomatsakis
2014-03-28 06:26:47 -07:00
bors 794ee03390 auto merge of #13154 : tomassedovic/rust/patch-1, r=alexcrichton
HashMap and HashSet require keys to implement TotalEq. This makes it possible to use TypeId as a HashMap key again.

Question for reviewers: assuming we want to support `HashMap<TypeId, whatever>`, would it make sense to add a relevant test? If so, should it go to libcollections or libstd?
2014-03-28 04:26:48 -07:00
Flavio Percoco 81ec1f3c18 Rename Pod into Copy
Summary:
So far, we've used the term POD "Plain Old Data" to refer to types that
can be safely copied. However, this term is not consistent with the
other built-in bounds that use verbs instead. This patch renames the Pod
kind into Copy.

RFC: 0003-opt-in-builtin-traits

Test Plan: make check

Reviewers: cmr

Differential Revision: http://phabricator.octayn.net/D3
2014-03-28 10:34:02 +01:00
bors b6ea7962f7 auto merge of #13149 : brson/rust/rustdoclogo, r=alexcrichton 2014-03-28 02:16:49 -07:00
bors ff64381c8b auto merge of #13107 : seanmonstar/rust/encoder-errors, r=erickt
All of Decoder and Encoder's methods now return a Result.

Encodable.encode() and Decodable.decode() return a Result as well.

fixes #12292
2014-03-28 00:26:52 -07:00
bors 5a68892507 auto merge of #13108 : pongad/rust/lintraw, r=huonw
Fixes #13032
2014-03-27 23:11:54 -07:00
bors 22a04ce286 auto merge of #13174 : brson/rust/dist, r=alexcrichton,huonw 2014-03-27 21:21:56 -07:00
Brian Anderson 476f0e36f0 mk: Fix syntax error in installation target 2014-03-27 20:21:57 -07:00
bors 7e987c3490 auto merge of #13173 : alexcrichton/rust/rustdoc-mods, r=huonw
... be stripped out"

This reverts commit 7180b5de44.

We don't particularly need this, I've never seen it clutter up the docs, it just seemed nice at the time. Sadly it caused a regression for reexported methods.

Closes #13091
2014-03-27 20:01:56 -07:00
Sean McArthur f1739b14a1 serialize: use Result
All of Decoder and Encoder's methods now return a Result.

Encodable.encode() and Decodable.decode() return a Result as well.

fixes #12292
2014-03-27 17:41:55 -07:00
bors 29436d54ee auto merge of #13142 : alexcrichton/rust/issue-13118, r=brson
The previous dependency calculation was based on an arbitrary set of asterisks
at an arbitrary depth, but using the recursive version should be much more
robust in figuring out what's dependent.
2014-03-27 17:11:58 -07:00
Alex Crichton 940bfb2ce0 Revert "Modules are either public, or private, so private modules should be stripped out"
This reverts commit 7180b5de44.
2014-03-27 16:00:14 -07:00
bors 13dafa09f1 auto merge of #13050 : alexcrichton/rust/no-send-default, r=huonw
See #10296 for the rationale, and commits for the implementation.
2014-03-27 14:32:02 -07:00
Brian Anderson 080d2104ff mk: Always touch libuv.a
libuv.a always looks out of date to the makefile, causing make to
always descend into the libuv makefile, even when there's nothing
to build.
2014-03-27 14:29:07 -07:00
bors 8eaada5d39 auto merge of #13151 : brson/rust/dist, r=alexcrichton,brson
A variety of stuff here, mostly aimed at making `make install` work correctly with `--libdir` and `--mandir`. `make install` again goes through `install.sh`.
2014-03-27 13:11:58 -07:00
Alex Crichton 8d0be731f5 doc: Update the tutorial about bounds for traits 2014-03-27 13:08:48 -07:00
Alex Crichton bb9172d7b5 Fix fallout of removing default bounds
This is all purely fallout of getting the previous commit to compile.
2014-03-27 10:14:50 -07:00
Alex Crichton bdd24b2a56 rustc: Stop adding the Send bound implicitly
This commit removes implicitly adding the Send bound to ~Trait objects and
procedure types. It will now be manually required to specify that a procedure
or trait must be send-able.

Closes #10296
2014-03-27 10:14:50 -07:00
bors 3b04fba529 auto merge of #13136 : alexcrichton/rust/spawn-deadlock, r=brson
This bench is meant to exercise libgreen, not libnative. It recently caused the
auto-linux-32-nopt-t bot to fail as no output was produced for an hour.
2014-03-27 09:52:03 -07:00
bors 25e523833e auto merge of #13001 : cmr/rust/unnamed-lifetime-nocapture, r=nikomatsakis
Closes #6751
2014-03-27 06:37:00 -07:00
Corey Richardson 5258e13d0b test/run-pass/out-of-stack: prevent tco
We really do *not* want TCO to kick in. If it does, we'll never blow the
stack, and never trigger the condition the test is checking for. To that end,
do a meaningless alloc that serves only to get a destructor to run. The
addition of nocapture/noalias seems to have let LLVM do more TCO, which
hurt this testcase.
2014-03-27 08:10:47 -04:00
bors e560db7dab auto merge of #13034 : edwardw/rust/match, r=nikomatsakis
The `_match.rs` takes advantage of passes prior to `trans` and
aggressively prunes the sub-match tree based on exact equality. When it
comes to literal or range, the strategy may lead to wrong result if
there's guard function or multiple patterns inside tuple.

Closes #12582.
Closes #13027.
2014-03-27 02:17:02 -07:00
Corey Richardson b8ed13686a Address review 2014-03-27 02:51:54 -04:00
Corey Richardson 7febdb7b15 rustc: mark references w/anonymous lifetime nocapture
Closes #6751
2014-03-27 02:48:08 -04:00
Edward Wang 4112941202 _match.rs: prune sub-match tree too aggressively
The `_match.rs` takes advantage of passes prior to `trans` and
aggressively prunes the sub-match tree based on exact equality. When it
comes to literal or range, the strategy may lead to wrong result if
there's guard function or multiple patterns inside tuple.

Closes #12582.
Closes #13027.
2014-03-27 14:41:10 +08:00
Michael Darakananda 5744556782 Added lint for #[deriving] structs and enums with unsafe pointers. #13032. 2014-03-27 01:15:14 -04:00
Brian Anderson 0f4f786b62 mk: Use 'find' invocation that works on mac 2014-03-26 21:28:56 -07:00
Brian Anderson 6f7ef1e293 rustc: Fix tests for sysroot changes 2014-03-26 20:53:01 -07:00
bors c329a17461 auto merge of #13079 : alexcrichton/rust/colons, r=cmr
The previous syntax was `Foo:Bound<trait-parameters>`, but this is a little
ambiguous because it was being parsed as `Foo: (Bound<trait-parameters)` rather
than `Foo: (Bound) <trait-parameters>`

This commit changes the syntax to `Foo<trait-parameters>: Bound` in order to be
clear where the trait parameters are going.

Closes #9265
2014-03-26 19:32:01 -07:00
Brian Anderson 545f012527 rustc: Fix detection of lib64 directory
Instead of just looking for its presence we need to see if it actually
contains rust stuffs.
2014-03-26 19:21:23 -07:00
Brian Anderson c060e2e515 install: Don't allow installation over the install files 2014-03-26 18:52:23 -07:00
bors c83994e0f4 auto merge of #13145 : alexcrichton/rust/flip-some-defaults, r=brson
This change prepares `rustc` to accept private fields by default. These changes will have to go through a snapshot before the rest of the changes can happen.
2014-03-26 16:37:03 -07:00
Brian Anderson 92d0ec2ec7 install: name the bundled manifest 'manifest.in'. Cleanup
The installed manifest is a different file, so they should have
different names. This should prevent various wierd conflicts in the future.
2014-03-26 14:59:08 -07:00
Alex Crichton 8118406ecf syntax: Tweak parsing bounds on generics paths
The previous syntax was `Foo:Bound<trait-parameters>`, but this is a little
ambiguous because it was being parsed as `Foo: (Bound<trait-parameters)` rather
than `Foo: (Bound) <trait-parameters>`

This commit changes the syntax to `Foo<trait-parameters>: Bound` in order to be
clear where the trait parameters are going.

Closes #9265
2014-03-26 14:51:41 -07:00
bors 533a526327 auto merge of #13152 : huonw/rust/wtf-are-things-in-spans, r=alexcrichton
Add some docs to ExpnInfo. Add a single overlooked `new_span` call to the folder (I'm pretty sure nothing reads this span, though, so it's probably pointless).
2014-03-26 13:36:52 -07:00
bors 2c71cdf64b auto merge of #13071 : ktt3ja/rust/deterministic-lifetime-suggestion, r=cmr
Close #13057
2014-03-26 10:26:55 -07:00
Alex Crichton 7de48419ee syntax: Permit visibility on tuple fields
This change is in preparation for #8122. Nothing is currently done with these
visibility qualifiers, they are just parsed and accepted by the compiler.

RFC: 0004-private-fields
2014-03-26 10:20:15 -07:00
Alex Crichton 104aaa44e8 rustc: Relax restriction on privacy for fields
This is a necessary change in preparation for switching the defaults as part
of #8122.

RFC: 0004-private-fields
2014-03-26 10:20:12 -07:00
Alex Crichton e12fda1c6e bench: Put the spawn bench back on libgreen
This bench is meant to exercise libgreen, not libnative. It recently caused the
auto-linux-32-nopt-t bot to fail as no output was produced for an hour.
2014-03-26 09:18:49 -07:00
bors 5da14c08a9 auto merge of #13135 : alexcrichton/rust/dox, r=alexcrichton
I touched up the documentation from @pcwalton found in #12952.
2014-03-26 09:11:57 -07:00
Tomas Sedovic 4d6c47bcce Derive TotalEq for std::intrinsics::TypeId
HashMap and HashSet require keys to implement TotalEq. This makes it possible to use TypeId as a HashMap key again.
2014-03-26 15:43:01 +01:00
Huon Wilson 6419848e66 syntax: add a missing span rewrite in fold.
This was leaving Decls without the new spans; this is a minor change,
since literally nothing reads in the code base reads the span of a Decl
itself, always just its contents.
2014-03-27 01:19:07 +11:00
Huon Wilson 85ff90c86c syntax: add a some docs/clarification to the fields of ExpnInfo. 2014-03-27 01:19:07 +11:00
bors 0908ffa660 auto merge of #13134 : alexcrichton/rust/freebsd-libm, r=thestinger
Apparently we had forgotten to do this for freebsd, causing possible problems
on FreeBSD 10. The discussion in #12324 has some more details about how it's
missing.
2014-03-26 04:16:52 -07:00
bors 82c8cb2abf auto merge of #13133 : alexcrichton/rust/issue-13130, r=brson
The libuv fs wrappers are very thin wrappers around the syscalls they correspond
to, and a notable worrisome case is the write syscall. This syscall is not
guaranteed to write the entire buffer provided, so we may have to continue
calling uv_fs_write if a short write occurs.

Closes #13130
2014-03-26 03:01:56 -07:00
bors de85948ac0 auto merge of #13117 : alexcrichton/rust/no-crate-map, r=brson
This can be done now that logging has been moved out and libnative is the default (not libgreen)
2014-03-26 01:41:57 -07:00