]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #13160 : FlaPer87/rust/rename-pod, r=thestinger
bors [Fri, 28 Mar 2014 13:26:47 +0000 (06:26 -0700)]
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

10 years agoauto merge of #13154 : tomassedovic/rust/patch-1, r=alexcrichton
bors [Fri, 28 Mar 2014 11:26:48 +0000 (04:26 -0700)]
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?

10 years agoRename Pod into Copy
Flavio Percoco [Wed, 26 Mar 2014 23:01:11 +0000 (00:01 +0100)]
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

10 years agoauto merge of #13149 : brson/rust/rustdoclogo, r=alexcrichton
bors [Fri, 28 Mar 2014 09:16:49 +0000 (02:16 -0700)]
auto merge of #13149 : brson/rust/rustdoclogo, r=alexcrichton

10 years agoauto merge of #13107 : seanmonstar/rust/encoder-errors, r=erickt
bors [Fri, 28 Mar 2014 07:26:52 +0000 (00:26 -0700)]
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

10 years agoauto merge of #13108 : pongad/rust/lintraw, r=huonw
bors [Fri, 28 Mar 2014 06:11:54 +0000 (23:11 -0700)]
auto merge of #13108 : pongad/rust/lintraw, r=huonw

Fixes #13032

10 years agoauto merge of #13174 : brson/rust/dist, r=alexcrichton,huonw
bors [Fri, 28 Mar 2014 04:21:56 +0000 (21:21 -0700)]
auto merge of #13174 : brson/rust/dist, r=alexcrichton,huonw

10 years agomk: Fix syntax error in installation target
Brian Anderson [Fri, 28 Mar 2014 03:21:57 +0000 (20:21 -0700)]
mk: Fix syntax error in installation target

10 years agoauto merge of #13173 : alexcrichton/rust/rustdoc-mods, r=huonw
bors [Fri, 28 Mar 2014 03:01:56 +0000 (20:01 -0700)]
auto merge of #13173 : alexcrichton/rust/rustdoc-mods, r=huonw

... be stripped out"

This reverts commit 7180b5de4452095b032e6c77a77d8c6f81c4f6d3.

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

10 years agoserialize: use Result
Sean McArthur [Tue, 18 Mar 2014 17:58:26 +0000 (10:58 -0700)]
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

10 years agoauto merge of #13142 : alexcrichton/rust/issue-13118, r=brson
bors [Fri, 28 Mar 2014 00:11:58 +0000 (17:11 -0700)]
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.

10 years agoRevert "Modules are either public, or private, so private modules should be stripped...
Alex Crichton [Thu, 27 Mar 2014 23:00:14 +0000 (16:00 -0700)]
Revert "Modules are either public, or private, so private modules should be stripped out"

This reverts commit 7180b5de4452095b032e6c77a77d8c6f81c4f6d3.

10 years agoauto merge of #13050 : alexcrichton/rust/no-send-default, r=huonw
bors [Thu, 27 Mar 2014 21:32:02 +0000 (14:32 -0700)]
auto merge of #13050 : alexcrichton/rust/no-send-default, r=huonw

See #10296 for the rationale, and commits for the implementation.

10 years agomk: Always touch libuv.a
Brian Anderson [Thu, 27 Mar 2014 21:29:07 +0000 (14:29 -0700)]
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.

10 years agoauto merge of #13151 : brson/rust/dist, r=alexcrichton,brson
bors [Thu, 27 Mar 2014 20:11:58 +0000 (13:11 -0700)]
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`.

10 years agodoc: Update the tutorial about bounds for traits
Alex Crichton [Wed, 26 Mar 2014 23:07:44 +0000 (16:07 -0700)]
doc: Update the tutorial about bounds for traits

10 years agoFix fallout of removing default bounds
Alex Crichton [Sun, 9 Mar 2014 02:21:49 +0000 (18:21 -0800)]
Fix fallout of removing default bounds

This is all purely fallout of getting the previous commit to compile.

10 years agorustc: Stop adding the Send bound implicitly
Alex Crichton [Thu, 20 Mar 2014 21:10:52 +0000 (14:10 -0700)]
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

10 years agoauto merge of #13136 : alexcrichton/rust/spawn-deadlock, r=brson
bors [Thu, 27 Mar 2014 16:52:03 +0000 (09:52 -0700)]
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.

10 years agoauto merge of #13001 : cmr/rust/unnamed-lifetime-nocapture, r=nikomatsakis
bors [Thu, 27 Mar 2014 13:37:00 +0000 (06:37 -0700)]
auto merge of #13001 : cmr/rust/unnamed-lifetime-nocapture, r=nikomatsakis

Closes #6751

10 years agotest/run-pass/out-of-stack: prevent tco
Corey Richardson [Thu, 27 Mar 2014 11:54:41 +0000 (07:54 -0400)]
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.

10 years agoauto merge of #13034 : edwardw/rust/match, r=nikomatsakis
bors [Thu, 27 Mar 2014 09:17:02 +0000 (02:17 -0700)]
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.

10 years agoAddress review
Corey Richardson [Mon, 24 Mar 2014 16:38:23 +0000 (12:38 -0400)]
Address review

10 years agorustc: mark references w/anonymous lifetime nocapture
Corey Richardson [Tue, 18 Mar 2014 13:46:43 +0000 (09:46 -0400)]
rustc: mark references w/anonymous lifetime nocapture

Closes #6751

10 years ago_match.rs: prune sub-match tree too aggressively
Edward Wang [Sat, 22 Mar 2014 12:55:46 +0000 (20:55 +0800)]
_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.

10 years agoAdded lint for #[deriving] structs and enums with unsafe pointers. #13032.
Michael Darakananda [Sun, 23 Mar 2014 17:35:52 +0000 (13:35 -0400)]
Added lint for #[deriving] structs and enums with unsafe pointers. #13032.

10 years agomk: Use 'find' invocation that works on mac
Brian Anderson [Thu, 27 Mar 2014 03:53:57 +0000 (20:53 -0700)]
mk: Use 'find' invocation that works on mac

10 years agorustc: Fix tests for sysroot changes
Brian Anderson [Thu, 27 Mar 2014 03:53:01 +0000 (20:53 -0700)]
rustc: Fix tests for sysroot changes

10 years agoauto merge of #13079 : alexcrichton/rust/colons, r=cmr
bors [Thu, 27 Mar 2014 02:32:01 +0000 (19:32 -0700)]
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

10 years agorustc: Fix detection of lib64 directory
Brian Anderson [Thu, 27 Mar 2014 02:21:23 +0000 (19:21 -0700)]
rustc: Fix detection of lib64 directory

Instead of just looking for its presence we need to see if it actually
contains rust stuffs.

10 years agoinstall: Don't allow installation over the install files
Brian Anderson [Thu, 27 Mar 2014 01:51:55 +0000 (18:51 -0700)]
install: Don't allow installation over the install files

10 years agoauto merge of #13145 : alexcrichton/rust/flip-some-defaults, r=brson
bors [Wed, 26 Mar 2014 23:37:03 +0000 (16:37 -0700)]
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.

10 years agoinstall: name the bundled manifest 'manifest.in'. Cleanup
Brian Anderson [Wed, 26 Mar 2014 19:06:35 +0000 (12:06 -0700)]
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.

10 years agosyntax: Tweak parsing bounds on generics paths
Alex Crichton [Sat, 22 Mar 2014 16:20:22 +0000 (09:20 -0700)]
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

10 years agoauto merge of #13152 : huonw/rust/wtf-are-things-in-spans, r=alexcrichton
bors [Wed, 26 Mar 2014 20:36:52 +0000 (13:36 -0700)]
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).

10 years agoauto merge of #13071 : ktt3ja/rust/deterministic-lifetime-suggestion, r=cmr
bors [Wed, 26 Mar 2014 17:26:55 +0000 (10:26 -0700)]
auto merge of #13071 : ktt3ja/rust/deterministic-lifetime-suggestion, r=cmr

Close #13057

10 years agosyntax: Permit visibility on tuple fields
Alex Crichton [Tue, 25 Mar 2014 23:53:52 +0000 (16:53 -0700)]
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

10 years agorustc: Relax restriction on privacy for fields
Alex Crichton [Tue, 25 Mar 2014 22:59:33 +0000 (15:59 -0700)]
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

10 years agobench: Put the spawn bench back on libgreen
Alex Crichton [Tue, 25 Mar 2014 17:47:06 +0000 (10:47 -0700)]
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.

10 years agoauto merge of #13135 : alexcrichton/rust/dox, r=alexcrichton
bors [Wed, 26 Mar 2014 16:11:57 +0000 (09:11 -0700)]
auto merge of #13135 : alexcrichton/rust/dox, r=alexcrichton

I touched up the documentation from @pcwalton found in #12952.

10 years agoDerive TotalEq for std::intrinsics::TypeId
Tomas Sedovic [Wed, 26 Mar 2014 14:43:01 +0000 (15:43 +0100)]
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.

10 years agosyntax: add a missing span rewrite in fold.
Huon Wilson [Wed, 26 Mar 2014 13:47:14 +0000 (00:47 +1100)]
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.

10 years agosyntax: add a some docs/clarification to the fields of ExpnInfo.
Huon Wilson [Wed, 26 Mar 2014 13:40:51 +0000 (00:40 +1100)]
syntax: add a some docs/clarification to the fields of ExpnInfo.

10 years agoauto merge of #13134 : alexcrichton/rust/freebsd-libm, r=thestinger
bors [Wed, 26 Mar 2014 11:16:52 +0000 (04:16 -0700)]
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.

10 years agoauto merge of #13133 : alexcrichton/rust/issue-13130, r=brson
bors [Wed, 26 Mar 2014 10:01:56 +0000 (03:01 -0700)]
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

10 years agoauto merge of #13117 : alexcrichton/rust/no-crate-map, r=brson
bors [Wed, 26 Mar 2014 08:41:57 +0000 (01:41 -0700)]
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)

10 years agoinstall: Support --libdir and --mandir correctly
Brian Anderson [Wed, 26 Mar 2014 04:25:43 +0000 (21:25 -0700)]
install: Support --libdir and --mandir correctly

This adds a hack to rustc to make it find the library directory
regardless of whether it is named lib/lib64/lib32.

10 years agoauto merge of #13039 : Kimundi/rust/iter_by_value_extend, r=alexcrichton
bors [Wed, 26 Mar 2014 06:41:57 +0000 (23:41 -0700)]
auto merge of #13039 : Kimundi/rust/iter_by_value_extend, r=alexcrichton

# Summary
Changed `iter::Extendable` and `iter::FromIterator` to take a `Iterator` by value.
These functions always exhaust the passed `Iterator`, and are often used for transferring the values of a new `Iterator` directly into a data structure, so using them usually require the use of the `&mut` operator:

```
foo.extend(&mut bar.move_iter()); // Transfer content from bar into foo

let mut iter = ...;
foo.extend(&mut iter); // iter is now empty
```
This patch changes both the `FromIterator` and `Extendable` traits to take the iterator by value instead, which makes the common case of using these traits less heavy:

```
foo.extend(bar.move_iter()); // Transfer content from bar into foo

let iter = ...;
foo.extend(iter);
// iter is now inaccessible if it moved
// or unchanged if it was Pod and copied.
```
# Composability
This technically makes the traits less flexible from a type system pov, because they now require ownership.

However, because `Iterator` provides the `ByRef` adapter, there is no loss of functionality:
```
foo.extend(iter.by_ref()); // Same semantic as today, for the few situations where you need it.
```

# Motivation
This change makes it less painful to use iterators for shuffling values around between collections, which makes it more acceptable to always use them for this, enabling more flexibility.

For example, `foo.extend(bar.move_iter())` can generally be the fastest way to append an collections content to another one, without both needing to have the same type. Making this easy to use would allow the removal of special cased methods like `push_all()` on vectors. (See https://github.com/mozilla/rust/issues/12456)

I opened https://github.com/mozilla/rust/issues/13038 as well, to discuss this change in general if people object to it.

# Further work
This didn't change the `collect()` method to take by value `self`, nor any of the other adapters that also exhaust their iterator argument. For consistency this should probably happen in the long term, but for now this is too much trouble, as every use of them would need to be checked for accidentally changed semantic by going `&mut self -> self`. (which allows for the possibility that a `Pod` iterator got copied instead of exhausted without generating a type error by the change)

10 years agoauto merge of #13106 : CLUSTERfoo/rust/docs/labelled_breaks, r=brson
bors [Wed, 26 Mar 2014 04:51:58 +0000 (21:51 -0700)]
auto merge of #13106 : CLUSTERfoo/rust/docs/labelled_breaks, r=brson

* Include tip given by Leo Testard in mailing list about labeled `break`
and `continue`:
https://mail.mozilla.org/pipermail/rust-dev/2014-March/009145.html
* cross-reference named lifetimes in tutorial -> lifetimes guide
* Broke named lifetimes section into two sub-sections.
* Added mention of `'static` lifetime.

10 years agomk: Fix deps for prepare host tools
Brian Anderson [Wed, 26 Mar 2014 04:34:01 +0000 (21:34 -0700)]
mk: Fix deps for prepare host tools

10 years agomk: Make nightlyism a configure option
Brian Anderson [Wed, 26 Mar 2014 04:33:44 +0000 (21:33 -0700)]
mk: Make nightlyism a configure option

10 years agomk: Rename CFG_COMPILER to CFG_COMPILER_HOST_TRIPLE
Brian Anderson [Wed, 26 Mar 2014 02:23:45 +0000 (19:23 -0700)]
mk: Rename CFG_COMPILER to CFG_COMPILER_HOST_TRIPLE

Much clearer

10 years agorustc: Stop relying on CFG_LIBDIR_RELATIVE
Brian Anderson [Wed, 26 Mar 2014 02:17:02 +0000 (19:17 -0700)]
rustc: Stop relying on CFG_LIBDIR_RELATIVE

This is not sufficient for finding the library directory for binary
installs, but it does make the build more complex by requiring
env vars be set to build rustc.

10 years agoconfigure: Make rustlibdir non-configurable
Brian Anderson [Wed, 26 Mar 2014 01:18:57 +0000 (18:18 -0700)]
configure: Make rustlibdir non-configurable

Trying to reduce the complexity of installation

10 years agoRevert "Revert "mk: Run 'make install' through install.sh""
Brian Anderson [Wed, 26 Mar 2014 00:54:26 +0000 (17:54 -0700)]
Revert "Revert "mk: Run 'make install' through install.sh""

This reverts commit d62163188a21e5afc3d0f476eaf7856d91f715b2.

Conflicts:
mk/install.mk

10 years agomk: Remove leading './' from manifest entries
Brian Anderson [Wed, 26 Mar 2014 00:34:01 +0000 (17:34 -0700)]
mk: Remove leading './' from manifest entries

10 years agorustdoc: Display rust logo again. Closes #13148
Brian Anderson [Wed, 26 Mar 2014 03:13:50 +0000 (20:13 -0700)]
rustdoc: Display rust logo again. Closes #13148

10 years agoauto merge of #13141 : brson/rust/fix-make-install, r=cmr
bors [Wed, 26 Mar 2014 00:16:59 +0000 (17:16 -0700)]
auto merge of #13141 : brson/rust/fix-make-install, r=cmr

10 years agomk: Use rwildcard to calculate dependent files
Alex Crichton [Tue, 25 Mar 2014 22:40:52 +0000 (15:40 -0700)]
mk: Use rwildcard to calculate dependent files

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.

Closes #13118

10 years agomk: Fix 'make install'. Closes #13128
Brian Anderson [Tue, 25 Mar 2014 22:26:51 +0000 (15:26 -0700)]
mk: Fix 'make install'. Closes #13128

10 years agoauto merge of #12961 : cmr/rust/rustdoc-impls, r=alexcrichton
bors [Tue, 25 Mar 2014 20:51:52 +0000 (13:51 -0700)]
auto merge of #12961 : cmr/rust/rustdoc-impls, r=alexcrichton

Rendered form available at http://docs.octayn.net/doc/

This moves derived impls to the bottom of the list, separate from the rest,
and collapses default methods that aren't overridden into an expandible
accordion.

10 years agoChanged `iter::Extendable` and `iter::FromIterator` to take a `Iterator` by value
Marvin Löbel [Thu, 20 Mar 2014 13:12:56 +0000 (14:12 +0100)]
Changed `iter::Extendable` and `iter::FromIterator` to take a `Iterator` by value

10 years agorustdoc: render derived impls separately
Corey Richardson [Mon, 17 Mar 2014 00:00:56 +0000 (20:00 -0400)]
rustdoc: render derived impls separately

10 years agorustdoc: add some docs for item types
Corey Richardson [Sun, 16 Mar 2014 23:12:00 +0000 (19:12 -0400)]
rustdoc: add some docs for item types

10 years agorustdoc: html: use raw strings for great justice
Corey Richardson [Sun, 16 Mar 2014 22:29:51 +0000 (18:29 -0400)]
rustdoc: html: use raw strings for great justice

10 years agoauto merge of #13070 : huonw/rust/share-doc, r=alexcrichton
bors [Tue, 25 Mar 2014 17:46:57 +0000 (10:46 -0700)]
auto merge of #13070 : huonw/rust/share-doc, r=alexcrichton

std: expand the `Share` docs to make them more precise.

And give some examples about exactly what's `Share` and what's not.

10 years agostd: Touch various I/O documentation blocks
Alex Crichton [Tue, 25 Mar 2014 17:23:51 +0000 (10:23 -0700)]
std: Touch various I/O documentation blocks

These are mostly touchups from the previous commit.

10 years agolibstd: Document the following modules:
Patrick Walton [Sun, 16 Mar 2014 22:59:04 +0000 (15:59 -0700)]
libstd: Document the following modules:

* native::io
* std::char
* std::fmt
* std::fmt::parse
* std::io
* std::io::extensions
* std::io::net::ip
* std::io::net::udp
* std::io::net::unix
* std::io::pipe
* std::num
* std::num::f32
* std::num::f64
* std::num::strconv
* std::os

10 years agostd: Explicitly link to libm for freebsd
Alex Crichton [Tue, 25 Mar 2014 16:47:22 +0000 (09:47 -0700)]
std: Explicitly link to libm for freebsd

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.

10 years agorustuv: Handle short writes in uv_fs_write
Alex Crichton [Tue, 25 Mar 2014 16:37:36 +0000 (09:37 -0700)]
rustuv: Handle short writes in uv_fs_write

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

10 years agoauto merge of #13122 : sstewartgallus/rust/cleanup-10734-workarounds, r=alexcrichton
bors [Tue, 25 Mar 2014 13:36:55 +0000 (06:36 -0700)]
auto merge of #13122 : sstewartgallus/rust/cleanup-10734-workarounds, r=alexcrichton

Cleanup old issue references. One of these workarounds no longer need to be used anymore and the others are out of date.

10 years agostd: expand the `Share` docs to make them more precise.
Huon Wilson [Sat, 22 Mar 2014 07:12:22 +0000 (18:12 +1100)]
std: expand the `Share` docs to make them more precise.

And give some examples about exactly what's `Share` and what's not.

10 years agoauto merge of #13083 : FlaPer87/rust/issue-13005-borrow-unsafe-static, r=nikomatsakis
bors [Tue, 25 Mar 2014 10:01:48 +0000 (03:01 -0700)]
auto merge of #13083 : FlaPer87/rust/issue-13005-borrow-unsafe-static, r=nikomatsakis

It was possible to borrow unsafe static items in static initializers.
This patch implements a small `Visitor` that walks static initializer's
expressions and checks borrows aliasability.

Fixes #13005

cc @nikomatsakis r?

10 years agoauto merge of #13063 : brson/rust/dist, r=alexcrichton
bors [Tue, 25 Mar 2014 07:01:52 +0000 (00:01 -0700)]
auto merge of #13063 : brson/rust/dist, r=alexcrichton

Several things here:

* Cleanup
* Fix build targets for building .pkg so that it works and works for all hosts
* Adds support for nightly artifacts
* Put docs in a location suitable for upload to s3 during 'make dist'
* Add coverage of unix binary installers to 'distcheck'
* Fix 'distcheck'
* Change 'dist' to build source tarballs, binary tarballs and OS X packages

10 years agoauto merge of #12991 : alexcrichton/rust/sync-chan, r=brson
bors [Tue, 25 Mar 2014 04:56:50 +0000 (21:56 -0700)]
auto merge of #12991 : alexcrichton/rust/sync-chan, r=brson

This commit contains an implementation of synchronous, bounded channels for
Rust. This is an implementation of the proposal made last January [1]. These
channels are built on mutexes, and currently focus on a working implementation
rather than speed. Receivers for sync channels have select() implemented for
them, but there is currently no implementation of select() for sync senders.

Rust will continue to provide both synchronous and asynchronous channels as part
of the standard distribution, there is no intent to remove asynchronous
channels. This flavor of channels is meant to provide an alternative to
asynchronous channels because like green tasks, asynchronous channels are not
appropriate for all situations.

[1] - https://mail.mozilla.org/pipermail/rust-dev/2014-January/007924.html

10 years agocomm: Implement synchronous channels
Alex Crichton [Mon, 17 Mar 2014 21:34:25 +0000 (14:34 -0700)]
comm: Implement synchronous channels

This commit contains an implementation of synchronous, bounded channels for
Rust. This is an implementation of the proposal made last January [1]. These
channels are built on mutexes, and currently focus on a working implementation
rather than speed. Receivers for sync channels have select() implemented for
them, but there is currently no implementation of select() for sync senders.

Rust will continue to provide both synchronous and asynchronous channels as part
of the standard distribution, there is no intent to remove asynchronous
channels. This flavor of channels is meant to provide an alternative to
asynchronous channels because like green tasks, asynchronous channels are not
appropriate for all situations.

[1] - https://mail.mozilla.org/pipermail/rust-dev/2014-January/007924.html

10 years agoauto merge of #12900 : alexcrichton/rust/rewrite-sync, r=brson
bors [Tue, 25 Mar 2014 01:11:51 +0000 (18:11 -0700)]
auto merge of #12900 : alexcrichton/rust/rewrite-sync, r=brson

* Remove clone-ability from all primitives. All shared state will now come
  from the usage of the primitives being shared, not the primitives being
  inherently shareable. This allows for fewer allocations for stack-allocated
  primitives.
* Add `Mutex<T>` and `RWLock<T>` which are stack-allocated primitives for purely
  wrapping a piece of data
* Remove `RWArc<T>` in favor of `Arc<RWLock<T>>`
* Remove `MutexArc<T>` in favor of `Arc<Mutex<T>>`
* Shuffle around where things are located
  * The `arc` module now only contains `Arc`
  * A new `lock` module contains `Mutex`, `RWLock`, and `Barrier`
  * A new `raw` module contains the primitive implementations of `Semaphore`,
    `Mutex`, and `RWLock`
* The Deref/DerefMut trait was implemented where appropriate
* `CowArc` was removed, the functionality is now part of `Arc` and is tagged
  with `#[experimental]`.
* The crate now has #[deny(missing_doc)]
* `Arc` now supports weak pointers

This is not a large-scale rewrite of the functionality contained within the
`sync` crate, but rather a shuffling of who does what an a thinner hierarchy of
ownership to allow for better composability.

10 years agostd: Unignore atomic tests
Brian Anderson [Sat, 22 Mar 2014 07:15:47 +0000 (00:15 -0700)]
std: Unignore atomic tests

10 years agotest: Update all tests with the sync changes
Alex Crichton [Sat, 22 Mar 2014 07:55:50 +0000 (00:55 -0700)]
test: Update all tests with the sync changes

10 years agosync: Wire up all of the previous commits
Alex Crichton [Sat, 22 Mar 2014 07:55:27 +0000 (00:55 -0700)]
sync: Wire up all of the previous commits

This updates the exports and layout of the crate

10 years agosync: Update the arc module
Alex Crichton [Sat, 22 Mar 2014 07:53:58 +0000 (00:53 -0700)]
sync: Update the arc module

This removes the now-outdated MutexArc and RWArc types. These are superseded by
Arc<Mutex<T>> and Arc<RWLock<T>>. The only remaining arc is the one true Arc.
Additionally, the arc now has weak pointers implemented for it to assist in
breaking cycles.

This commit brings the arc api up to parity with the sibling Rc api, making them
nearly interchangeable for inter and intra task communication.

10 years agoCorrect issue workaround references
Steven Stewart-Gallus [Mon, 24 Mar 2014 23:58:12 +0000 (16:58 -0700)]
Correct issue workaround references

10 years agoCleanup fixed issue #10734 workaround
Steven Stewart-Gallus [Mon, 24 Mar 2014 23:10:20 +0000 (16:10 -0700)]
Cleanup fixed issue #10734 workaround

10 years agoPrefer lifetime suggestion over generic error
Kiet Tran [Sat, 22 Mar 2014 08:24:42 +0000 (04:24 -0400)]
Prefer lifetime suggestion over generic error

10 years agoauto merge of #13080 : alexcrichton/rust/possible-osx-deadlock, r=brson
bors [Mon, 24 Mar 2014 21:32:09 +0000 (14:32 -0700)]
auto merge of #13080 : alexcrichton/rust/possible-osx-deadlock, r=brson

The OSX bots have been deadlocking recently in the rustdoc tests. I have only
been able to rarely reproduce the deadlock on my local setup. When reproduced,
it looks like the child process is spinning on the malloc mutex, which I
presume is locked with no other threads to unlock it.

I'm not convinced that this is what's happening, because OSX should protect
against this with pthread_atfork by default. Regardless, running as little code
as possible in the child after fork() is normally a good idea anyway, so this
commit moves all allocation to the parent process to run before the child
executes.

After running 6k iterations of rustdoc tests, this deadlocked twice before, and
after 20k iterations afterwards, it never deadlocked. I draw the conclusion that
this is either sweeping the bug under the rug, or it did indeed fix the
underlying problem.

10 years agomk: Make distcheck depend on dist-docs
Brian Anderson [Mon, 24 Mar 2014 20:13:12 +0000 (13:13 -0700)]
mk: Make distcheck depend on dist-docs

10 years agoRevert "mk: Run 'make install' through install.sh"
Brian Anderson [Mon, 24 Mar 2014 19:04:27 +0000 (12:04 -0700)]
Revert "mk: Run 'make install' through install.sh"

This reverts commit e93709a911637194835268420e67d768ee19b5df.

10 years agomk: Fix prepare.mk
Brian Anderson [Mon, 24 Mar 2014 19:03:47 +0000 (12:03 -0700)]
mk: Fix prepare.mk

The way it was formulated you could only 'prepare' one directory per build.

10 years agomk: Fix a minor UI bug
Brian Anderson [Mon, 24 Mar 2014 17:42:50 +0000 (10:42 -0700)]
mk: Fix a minor UI bug

10 years agomk: Don't rm 'dist' during clean, just its contents
Brian Anderson [Mon, 24 Mar 2014 01:26:35 +0000 (18:26 -0700)]
mk: Don't rm 'dist' during clean, just its contents

This is not for temporaries now

10 years agomk: Remove some debug logging
Brian Anderson [Mon, 24 Mar 2014 01:24:51 +0000 (18:24 -0700)]
mk: Remove some debug logging

10 years agoinstall: Don't try to run binaries on install
Brian Anderson [Sat, 22 Mar 2014 08:44:10 +0000 (01:44 -0700)]
install: Don't try to run binaries on install

I think there are likely to be scenarios where this script is run
to move files to the correct place during cross-compiles.

10 years agoinstall: Improve error handling
Brian Anderson [Sat, 22 Mar 2014 03:12:51 +0000 (20:12 -0700)]
install: Improve error handling

10 years agomk: Cleanup dist.mk yet more
Brian Anderson [Sat, 22 Mar 2014 02:20:44 +0000 (19:20 -0700)]
mk: Cleanup dist.mk yet more

10 years agomk: Fix some dist deps for parallel builds
Brian Anderson [Sat, 22 Mar 2014 01:55:31 +0000 (18:55 -0700)]
mk: Fix some dist deps for parallel builds

10 years agoinstall: Error on uninstall if manifest can't be found
Brian Anderson [Sat, 22 Mar 2014 00:31:18 +0000 (17:31 -0700)]
install: Error on uninstall if manifest can't be found

10 years agomk: Run 'make install' through install.sh
Brian Anderson [Sat, 22 Mar 2014 00:25:02 +0000 (17:25 -0700)]
mk: Run 'make install' through install.sh

10 years agomk: Fix location of man pages in prepare.mk
Brian Anderson [Fri, 21 Mar 2014 22:47:19 +0000 (15:47 -0700)]
mk: Fix location of man pages in prepare.mk

10 years agomk: Wire up everything to dist and distcheck
Brian Anderson [Fri, 21 Mar 2014 22:21:45 +0000 (15:21 -0700)]
mk: Wire up everything to dist and distcheck

Fix some misc bugs

10 years agomk: Fix distcheck
Brian Anderson [Fri, 21 Mar 2014 22:15:45 +0000 (15:15 -0700)]
mk: Fix distcheck

Also, add more distcheck tests