]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoFix two regressions introduced by #11072.
Chris Morgan [Thu, 19 Dec 2013 22:33:47 +0000 (09:33 +1100)]
Fix two regressions introduced by #11072.

There, concrete evidence that I shouldn't try doing such things at 1:30am.

10 years agoauto merge of #11072 : chris-morgan/rust/ctags-tweaks, r=cmr
bors [Thu, 19 Dec 2013 20:01:59 +0000 (12:01 -0800)]
auto merge of #11072 : chris-morgan/rust/ctags-tweaks, r=cmr

Anchoring the keyword as the first non-whitespace on a line may mean
that the occasional genuine-but-unconventionally-formatted tag is
missed, but it avoids a large number of false positives.

I changed the type descriptive texts about a bit too. That part's purely
cosmetic.

I also changed the ignored file list to use a filename matching the make
rule, `TAGS.vi` instead of `TAGS.vim`.

10 years agoauto merge of #11070 : ezyang/rust/better-errors, r=alexcrichton
bors [Thu, 19 Dec 2013 17:51:40 +0000 (09:51 -0800)]
auto merge of #11070 : ezyang/rust/better-errors, r=alexcrichton

On the advice of @huonw, I've just replaced item_span outright.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
10 years agoauto merge of #11041 : cmr/rust/pkgid_changes, r=cmr,metajack
bors [Thu, 19 Dec 2013 15:51:36 +0000 (07:51 -0800)]
auto merge of #11041 : cmr/rust/pkgid_changes, r=cmr,metajack

10 years agoAdd some things to inspect crate-id's
Corey Richardson [Thu, 19 Dec 2013 15:18:37 +0000 (10:18 -0500)]
Add some things to inspect crate-id's

10 years agoRename pkgid to crate_id
Corey Richardson [Tue, 17 Dec 2013 21:40:33 +0000 (16:40 -0500)]
Rename pkgid to crate_id

Closes #11035

10 years agoRemove many false positives from the ctags results
Chris Morgan [Thu, 19 Dec 2013 14:31:38 +0000 (01:31 +1100)]
Remove many false positives from the ctags results

Anchoring the keyword as the first non-whitespace on a line may mean
that the occasional genuine-but-unconventionally-formatted tag is
missed, but it avoids a large number of false positives.

I changed the type descriptive texts about a bit too. That part's purely
cosmetic.

I also changed the ignored file list to use a filename matching the make
rule, `TAGS.vi` instead of `TAGS.vim`.

10 years agoauto merge of #11061 : huonw/rust/opt-unsafe-vec, r=alexcrichton
bors [Thu, 19 Dec 2013 12:26:34 +0000 (04:26 -0800)]
auto merge of #11061 : huonw/rust/opt-unsafe-vec, r=alexcrichton

Before:

```
test vec::bench::random_inserts                     ... bench:     15025 ns/iter (+/- 409)
test vec::bench::random_removes                     ... bench:     16063 ns/iter (+/- 276)
```

After:

```
test vec::bench::random_inserts                     ... bench:      5257 ns/iter (+/- 321)
test vec::bench::random_removes                     ... bench:      4980 ns/iter (+/- 94)
```

10 years agostd::vec: use some unsafe code to optimise `remove`.
Huon Wilson [Thu, 19 Dec 2013 02:56:53 +0000 (13:56 +1100)]
std::vec: use some unsafe code to optimise `remove`.

Also, add `.remove_opt` and replace `.unshift` with `.remove(0)`. The
code size reduction seem to compensate for not having the optimised
special cases.

This makes the included benchmark more than 3 times faster.

10 years agoGeneralize item_span into node_span, which works on more types.
Edward Z. Yang [Thu, 19 Dec 2013 06:41:59 +0000 (14:41 +0800)]
Generalize item_span into node_span, which works on more types.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
10 years agoauto merge of #11065 : huonw/rust/slice-chars-example, r=cmr
bors [Thu, 19 Dec 2013 10:36:34 +0000 (02:36 -0800)]
auto merge of #11065 : huonw/rust/slice-chars-example, r=cmr

10 years agoauto merge of #11038 : alexcrichton/rust/fix-osx-leak, r=cmr
bors [Thu, 19 Dec 2013 08:16:35 +0000 (00:16 -0800)]
auto merge of #11038 : alexcrichton/rust/fix-osx-leak, r=cmr

I haven't landed this fix upstream just yet, but it's opened as
joyent/libuv#1048. For now, I've locally merged it into my fork, and I've
upgraded our repo to point to the new revision.

Closes #11027

10 years agoUpgrade libuv to fix a leak on OSX
Alex Crichton [Tue, 17 Dec 2013 21:12:36 +0000 (13:12 -0800)]
Upgrade libuv to fix a leak on OSX

I haven't landed this fix upstream just yet, but it's opened as
joyent/libuv#1048. For now, I've locally merged it into my fork, and I've
upgraded our repo to point to the new revision.

Closes #11027

10 years agoauto merge of #11050 : alexcrichton/rust/snapshots, r=brson
bors [Thu, 19 Dec 2013 06:41:36 +0000 (22:41 -0800)]
auto merge of #11050 : alexcrichton/rust/snapshots, r=brson

Time for a visit from the snapshot fairy!

10 years agostd::str: fix .slice_chars example. Fixes #11014.
Huon Wilson [Thu, 19 Dec 2013 06:36:44 +0000 (17:36 +1100)]
std::str: fix .slice_chars example. Fixes #11014.

10 years agoauto merge of #10977 : brson/rust/androidtest, r=brson
bors [Thu, 19 Dec 2013 04:06:33 +0000 (20:06 -0800)]
auto merge of #10977 : brson/rust/androidtest, r=brson

#10975

For a while I thought the android test bot was succeeding but it wasn't really testing anything at all.

10 years agostd::vec: replace .insert with a small amount of unsafe code.
Huon Wilson [Thu, 19 Dec 2013 02:23:37 +0000 (13:23 +1100)]
std::vec: replace .insert with a small amount of unsafe code.

This makes the included benchmark more than 3 times faster. Also,
`.unshift(x)` is now faster as `.insert(0, x)` which can reuse the
allocation if necessary.

10 years agoauto merge of #10927 : g3xzh/rust/sum_bugfix, r=huonw
bors [Thu, 19 Dec 2013 02:41:35 +0000 (18:41 -0800)]
auto merge of #10927 : g3xzh/rust/sum_bugfix, r=huonw

`[1e20, 1.0, -1e20].sum()` returns `0.0`. This happens because during
the summation, `1.0` is too small relative to `1e20`, making it
negligible.

I have tried Kahan summation but it hasn't fixed the problem.
Therefore, I've used Python's `fsum()` implementation.
For more details, read:
www.cs.cmu.edu/~quake-papers/robust-arithmetic.ps
https://github.com/mozilla/rust/issues/10851

Python's fsum (msum)
http://code.activestate.com/recipes/393090/

@huonw, your feedback is more than welcome.
It looks unpolished; Do you have suggestions how to make it more beautiful and elegant?

Thanks in advance,

10 years agoMake Android tests fail if no device is available
Brian Anderson [Sun, 15 Dec 2013 06:42:01 +0000 (22:42 -0800)]
Make Android tests fail if no device is available

10 years agoauto merge of #11029 : huonw/rust/rm-vec-as-buf, r=cmr
bors [Thu, 19 Dec 2013 01:11:42 +0000 (17:11 -0800)]
auto merge of #11029 : huonw/rust/rm-vec-as-buf, r=cmr

For `str.as_mut_buf`, un-closure-ification is achieved by outright removal (see commit message). The others are replaced by `.as_ptr`, `.as_mut_ptr` and `.len`

10 years agoFix `sum()` accuracy
g3xzh [Wed, 11 Dec 2013 23:57:13 +0000 (01:57 +0200)]
Fix `sum()` accuracy

`[1e20, 1.0, -1e20].sum()` returns `0.0`. This happens because during
the summation, `1.0` is too small relative to `1e20`, making it
negligible.

I have tried Kahan summation but it hasn't fixed the problem.
Therefore, I've used Python's `fsum()` implementation with some
help from Jason Fager and Huon Wilson.
For more details, read:
www.cs.cmu.edu/~quake-papers/robust-arithmetic.ps

Moreover, benchmark and unit tests were added.

Note: `Status.sum` is still not fully fixed. It doesn't handle
NaNs, infinities and overflow correctly. See issue 11059:
https://github.com/mozilla/rust/issues/11059

10 years agostd::str: remove .as_mut_buf & rewrite/simplify `.push_char`.
Huon Wilson [Tue, 17 Dec 2013 15:46:26 +0000 (02:46 +1100)]
std::str: remove .as_mut_buf & rewrite/simplify `.push_char`.

`.as_mut_buf` was used exactly once, in `.push_char` which could be
written in a simpler way, using the `&mut ~[u8]` that it already
retrieved. In the rare situation when someone really needs
`.as_mut_buf`-like functionality (getting a `*mut u8`), they can go via
`str::raw::as_owned_vec`.

10 years agostd::str: replace .as_imm_buf with .as_ptr.
Huon Wilson [Tue, 17 Dec 2013 15:37:30 +0000 (02:37 +1100)]
std::str: replace .as_imm_buf with .as_ptr.

10 years agostd::vec: remove .as_muf_buf, replaced by .as_mut_ptr & .len.
Huon Wilson [Tue, 17 Dec 2013 15:13:20 +0000 (02:13 +1100)]
std::vec: remove .as_muf_buf, replaced by .as_mut_ptr & .len.

10 years agoauto merge of #11032 : cmr/rust/rustdoc_test, r=alexcrichton
bors [Wed, 18 Dec 2013 23:16:39 +0000 (15:16 -0800)]
auto merge of #11032 : cmr/rust/rustdoc_test, r=alexcrichton

This is just a smoke test which verifies that the expected files are
generated.

10 years agostd::vec: remove .as_imm_buf, replaced by .as_ptr & .len.
Huon Wilson [Tue, 17 Dec 2013 14:49:31 +0000 (01:49 +1100)]
std::vec: remove .as_imm_buf, replaced by .as_ptr & .len.

There's no need for the restrictions of a closure with the above methods.

10 years agorustdoc: thread through the context for rendering
Corey Richardson [Wed, 18 Dec 2013 17:26:19 +0000 (12:26 -0500)]
rustdoc: thread through the context for rendering

This partially reverts 8b5a317.

10 years agoAdd a rustdoc test
Corey Richardson [Tue, 17 Dec 2013 17:05:36 +0000 (12:05 -0500)]
Add a rustdoc test

This is just a smoke test which verifies that the expected files are
generated. Also makes the rmake tests have the right deps.

10 years agoauto merge of #11013 : klutzy/rust/win-no-pthread, r=alexcrichton
bors [Wed, 18 Dec 2013 20:16:35 +0000 (12:16 -0800)]
auto merge of #11013 : klutzy/rust/win-no-pthread, r=alexcrichton

llvm supports both win32 native threads and pthread,
but configure tries to find pthread first.
This manually disables pthread to use native api.

This removes libpthreads-2.dll dependency on librustc.

10 years agoauto merge of #11012 : alexcrichton/rust/needstest, r=alexcrichton
bors [Wed, 18 Dec 2013 18:36:51 +0000 (10:36 -0800)]
auto merge of #11012 : alexcrichton/rust/needstest, r=alexcrichton

Closes #5806
Closes #8259
Closes #8578
Closes #8851
Closes #10412

10 years agoRegister new snapshots
Alex Crichton [Wed, 18 Dec 2013 17:29:50 +0000 (09:29 -0800)]
Register new snapshots

Time for a visit from the snapshot fairy!

10 years agoAdding tests for closed issues
Alex Crichton [Tue, 17 Dec 2013 01:04:02 +0000 (17:04 -0800)]
Adding tests for closed issues

Closes #5806
Closes #5950
Closes #7178
Closes #8259
Closes #8578
Closes #8851
Closes #9129
Closes #10412

10 years agoauto merge of #11033 : michaelwoerister/rust/byvalself, r=pcwalton
bors [Wed, 18 Dec 2013 16:36:36 +0000 (08:36 -0800)]
auto merge of #11033 : michaelwoerister/rust/byvalself, r=pcwalton

As the title says. The trans changes will lead to an auxiliary alloca being created that allows debug info to track the `self` argument. This alloca is only created in debug builds however. Otherwise very little had to be done after I managed to navigate to some degree the jungle that is self-argument handling `:P`

Closes #10549

10 years agoauto merge of #11024 : huonw/rust/return-from-closures, r=alexcrichton
bors [Wed, 18 Dec 2013 14:26:33 +0000 (06:26 -0800)]
auto merge of #11024 : huonw/rust/return-from-closures, r=alexcrichton

With the old `for` gone, this behaviour is no longer conflicting with
that use of `return` in closures, and this allows shortcircuiting in a
closure.

10 years agoauto merge of #10915 : alexcrichton/rust/fixes, r=ILyoan
bors [Wed, 18 Dec 2013 13:01:47 +0000 (05:01 -0800)]
auto merge of #10915 : alexcrichton/rust/fixes, r=ILyoan

Just a little cleanup.

10 years agorustc: Allow `return` to return from a closure.
Huon Wilson [Tue, 17 Dec 2013 13:06:20 +0000 (00:06 +1100)]
rustc: Allow `return` to return from a closure.

With the old `for` gone, this behaviour is no longer conflicting with
that use of `return` in closures, and this allows shortcircuiting in a
closure.

10 years agoauto merge of #11025 : ezyang/rust/reword-second-borrow, r=cmr
bors [Wed, 18 Dec 2013 11:36:33 +0000 (03:36 -0800)]
auto merge of #11025 : ezyang/rust/reword-second-borrow, r=cmr

When a borrow occurs twice illegally, Rust will label the other borrow
as the "second borrow".  This is quite confusing, as the "second borrow"
usually happened before the flagged barrow (e.g. as far as dataflow
is concerned, the first borrow is OK, the second borrow is illegal.)
This patch renames "second borrow" to "previous borrow", to make the
spatial relationship between the two borrows clearer.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
10 years agoauto merge of #11018 : sfackler/rust/variant-strip, r=alexcrichton
bors [Wed, 18 Dec 2013 07:51:34 +0000 (23:51 -0800)]
auto merge of #11018 : sfackler/rust/variant-strip, r=alexcrichton

Previously, if every variant was private, it would display as a
variantless enum instead of having the "some variants stripped" comment.

10 years agoauto merge of #11019 : alexcrichton/rust/issue-10545, r=pcwalton
bors [Wed, 18 Dec 2013 05:31:47 +0000 (21:31 -0800)]
auto merge of #11019 : alexcrichton/rust/issue-10545, r=pcwalton

This code in resolve accidentally forced all types with an impl to become
public. This fixes it by default inheriting the privacy of what was previously
there and then becoming `true` if nothing else exits.

Closes #10545

10 years agomklldeps.py: Write to file instead of print
klutzy [Tue, 17 Dec 2013 05:35:22 +0000 (14:35 +0900)]
mklldeps.py: Write to file instead of print

It seems that msys automatically converts `\n` to `\r\n` on pipe
redirection, which causes `make tidy` failure.

10 years agollvm: Disable pthread on mingw
klutzy [Mon, 16 Dec 2013 18:39:44 +0000 (03:39 +0900)]
llvm: Disable pthread on mingw

llvm supports both win32 native threads and pthread,
but configure tries to find pthread first.
This manually disables pthread to use native api.

This removes libpthreads-2.dll dependency on librustc.

10 years agoauto merge of #11009 : ktt3ja/rust/issue-11006, r=alexcrichton
bors [Tue, 17 Dec 2013 23:51:35 +0000 (15:51 -0800)]
auto merge of #11009 : ktt3ja/rust/issue-11006, r=alexcrichton

Fix #11006.

10 years agoauto merge of #10967 : chris-morgan/rust/clean-and-tidy-some-traits, r=alexcrichton
bors [Tue, 17 Dec 2013 20:56:39 +0000 (12:56 -0800)]
auto merge of #10967 : chris-morgan/rust/clean-and-tidy-some-traits, r=alexcrichton

### Remove {As,Into,To}{Option,Either,Result} traits.

Expanded, that is:

- `AsOption`
- `IntoOption`
- `ToOption`
- `AsEither`
- `IntoEither`
- `ToEither`
- `AsResult`
- `IntoResult`
- `ToResult`

These were defined for each other but never *used* anywhere. They are
all trivial and so removal will have negligible effect upon anyone.
`Either` has fallen out of favour (and its implementation of these
traits of dubious semantics), `Option<T>` → `Result<T, ()>` was never
really useful and `Result<T, E>` → `Option<T>` should now be done with
`Result.ok()` (mirrored with `Result.err()` for even more usefulness).

In summary, there's really no point in any of these remaining.

### Rename To{Str,Bytes}Consume traits to Into*.

That is:

- `ToStrConsume` → `IntoStr`;
- `ToBytesConsume` → `IntoBytes`.

10 years agoauto merge of #10979 : alexcrichton/rust/less-bc, r=cmr
bors [Tue, 17 Dec 2013 19:36:42 +0000 (11:36 -0800)]
auto merge of #10979 : alexcrichton/rust/less-bc, r=cmr

By performing this logic very late in the build process, it ended up leading to
bugs like those found in #10973 where certain stages of the build process
expected a particular output format which didn't end up being the case. In order
to fix this, the build output generation is moved very early in the build
process to the absolute first thing in phase 2.

Closes #10973

10 years agoauto merge of #10863 : cadencemarseille/rust/patch-handle-ENOENT, r=alexcrichton
bors [Tue, 17 Dec 2013 18:21:44 +0000 (10:21 -0800)]
auto merge of #10863 : cadencemarseille/rust/patch-handle-ENOENT, r=alexcrichton

Translate ENOENT to IoErrorKind::FileNotFound.

10 years agoDon't allow impls to force public types
Alex Crichton [Tue, 17 Dec 2013 07:32:37 +0000 (23:32 -0800)]
Don't allow impls to force public types

This code in resolve accidentally forced all types with an impl to become
public. This fixes it by default inheriting the privacy of what was previously
there and then becoming `true` if nothing else exits.

Closes #10545

10 years agodebuginfo: Updated test cases to also test by-value self arguments.
Michael Woerister [Tue, 17 Dec 2013 15:54:22 +0000 (16:54 +0100)]
debuginfo: Updated test cases to also test by-value self arguments.

10 years agodebuginfo: Properly support by-value self arguments
Michael Woerister [Tue, 17 Dec 2013 15:52:16 +0000 (16:52 +0100)]
debuginfo: Properly support by-value self arguments

10 years agoauto merge of #11030 : cmr/rust/rustdoc_on_fire, r=metajack
bors [Tue, 17 Dec 2013 17:01:58 +0000 (09:01 -0800)]
auto merge of #11030 : cmr/rust/rustdoc_on_fire, r=metajack

By returning the items to process and storing them in a queue, we were losing
the context that was setup for that item during the recursion. This is an easy
fix, rather than hoisting out the state that it needs.

10 years agoFix rustdoc HTML rendering
Corey Richardson [Tue, 17 Dec 2013 16:19:14 +0000 (11:19 -0500)]
Fix rustdoc HTML rendering

By returning the items to process and storing them in a queue, we were losing
the context that was setup for that item during the recursion. This is an easy
fix, rather than hoisting out the state that it needs.

10 years agoauto merge of #10972 : metajack/rust/pkgid-with-name, r=alexcrichton
bors [Tue, 17 Dec 2013 15:41:40 +0000 (07:41 -0800)]
auto merge of #10972 : metajack/rust/pkgid-with-name, r=alexcrichton

This change extends the pkgid attribute to allow of explicit crate names, instead of always inferring them based on the path. This means that if your GitHub repo is called `rust-foo`, you can have your pkgid set your library name to `foo`. You'd do this with a pkgid attribute like `github.com/somewhere/rust-foo#foo:1.0`.

This is half of the fix for #10922.

10 years agoUpdate docs to new syntax.
Jack Moffitt [Sun, 15 Dec 2013 02:58:20 +0000 (19:58 -0700)]
Update docs to new syntax.

10 years agoChange pkgid parser to allow overriding the inferred crate name.
Jack Moffitt [Sun, 15 Dec 2013 02:58:07 +0000 (19:58 -0700)]
Change pkgid parser to allow overriding the inferred crate name.

Previously the a pkgid of `foo/rust-bar#1.0` implied a crate name of
`rust-bar` and didn't allow this to be overridden. Now you can override the
inferred crate name with `foo/rust-bar#bar:1.0`.

10 years agoauto merge of #11005 : sanxiyn/rust/mut, r=alexcrichton
bors [Tue, 17 Dec 2013 14:26:40 +0000 (06:26 -0800)]
auto merge of #11005 : sanxiyn/rust/mut, r=alexcrichton

There is no `~mut T` and `[mut T]` any more.

10 years agoauto merge of #10998 : thestinger/rust/iter, r=alexcrichton
bors [Tue, 17 Dec 2013 13:11:41 +0000 (05:11 -0800)]
auto merge of #10998 : thestinger/rust/iter, r=alexcrichton

10 years agos/Second borrow/Previous borrow/ in error messages.
Edward Z. Yang [Tue, 17 Dec 2013 12:55:33 +0000 (20:55 +0800)]
s/Second borrow/Previous borrow/ in error messages.

When a borrow occurs twice illegally, Rust will label the other borrow
as the "second borrow".  This is quite confusing, as the "second borrow"
usually happened before the flagged borrow (e.g. as far as dataflow
is concerned, the first borrow is OK, the second borrow is illegal.)
This patch renames "second borrow" to "previous borrow", to make the
spatial relationship between the two borrows clearer.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
10 years agoHandle ENOENT
Cadence Marseille [Sun, 8 Dec 2013 22:12:41 +0000 (17:12 -0500)]
Handle ENOENT

Translate ENOENT to IoErrorKind::FileNotFound.

10 years agoauto merge of #10996 : huonw/rust/more-vec-raw, r=cmr
bors [Tue, 17 Dec 2013 11:51:40 +0000 (03:51 -0800)]
auto merge of #10996 : huonw/rust/more-vec-raw, r=cmr

The removal of the aliasing &mut[] and &[] from `shift_opt` also comes with its simplification.

The above also allows the use of `copy_nonoverlapping_memory` in `[].copy_memory` (I did an audit of each use of `.copy_memory` and `std::vec::bytes::copy_memory`, and I believe none of them are called with arguments can ever alias). This changes requires that `unsafe` code using `copy_memory` **needs** to respect the aliasing rules of `&mut[]`.

10 years agoauto merge of #10990 : ktt3ja/rust/method-stability, r=huonw
bors [Tue, 17 Dec 2013 10:31:55 +0000 (02:31 -0800)]
auto merge of #10990 : ktt3ja/rust/method-stability, r=huonw

If it's a trait method, this checks the stability attribute of the
method inside the trait definition. Otherwise, it checks the method
implementation itself.

Close #8961.

10 years agoauto merge of #10830 : alexcrichton/rust/spsc-queue, r=brson
bors [Tue, 17 Dec 2013 09:16:43 +0000 (01:16 -0800)]
auto merge of #10830 : alexcrichton/rust/spsc-queue, r=brson

This pull request completely rewrites std::comm and all associated users. Some major bullet points

* Everything now works natively
* oneshots have been removed
* shared ports have been removed
* try_recv no longer blocks (recv_opt blocks)
* constructors are now Chan::new and SharedChan::new
* failure is propagated on send
* stream channels are 3x faster

I have acquired the following measurements on this patch. I compared against Go, but remember that Go's channels are fundamentally different than ours in that sends are by-default blocking. This means that it's not really a totally fair comparison, but it's good to see ballpark numbers for anyway

```
          oneshot         stream          shared1
std         2.111           3.073          1.730
my          6.639           1.037          1.238
native      5.748           1.017          1.250
go8         1.774           3.575          2.948
go8-inf     slow            0.837          1.376
go8-128     4.832           1.430          1.504
go1         1.528           1.439          1.251
go2         1.753           3.845          3.166
```

I had three benchmarks:

* oneshot - N times, create a "oneshot channel", send on it, then receive on it (no task spawning)
* stream - N times, send from one task to another task, wait for both to complete
* shared1 - create N threads, each of which sends M times, and a port receives N*M times.

The rows are as follows:

* `std` - the current libstd implementation (before this pull request)
* `my` - this pull request's implementation (in M:N mode)
* `native` - this pull request's implementation (in 1:1 mode)
* `goN` - go's implementation with GOMAXPROCS=N. The only relevant value is 8 (I had 8 cores on this machine)
* `goN-X` - go's implementation where the channels in question were created with buffers of size `X` to behave more similarly to rust's channels.

10 years agoauto merge of #10924 : pcwalton/rust/pod, r=pcwalton
bors [Tue, 17 Dec 2013 06:56:45 +0000 (22:56 -0800)]
auto merge of #10924 : pcwalton/rust/pod, r=pcwalton

This will be used for the new `Cell`.

r? @nikomatsakis

10 years agoTest fallout from std::comm rewrite
Alex Crichton [Mon, 16 Dec 2013 02:17:43 +0000 (18:17 -0800)]
Test fallout from std::comm rewrite

10 years agodoc: Update the documentation to describe the `Pod` trait.
Patrick Walton [Sun, 15 Dec 2013 23:19:18 +0000 (15:19 -0800)]
doc: Update the documentation to describe the `Pod` trait.

10 years agotest: Add a test that POD types can be implicitly copied.
Patrick Walton [Thu, 12 Dec 2013 01:39:43 +0000 (17:39 -0800)]
test: Add a test that POD types can be implicitly copied.

10 years agolibstd: Implement the new `Cell`.
Patrick Walton [Wed, 11 Dec 2013 22:54:27 +0000 (14:54 -0800)]
libstd: Implement the new `Cell`.

10 years agolibrustc: Implement a `Pod` kind for types that can be `memcpy`'d.
Patrick Walton [Wed, 11 Dec 2013 20:40:51 +0000 (12:40 -0800)]
librustc: Implement a `Pod` kind for types that can be `memcpy`'d.

This will be used for the new `Cell`.

10 years agoFix rustdoc output of enums with private variants
Steven Fackler [Tue, 17 Dec 2013 05:30:02 +0000 (21:30 -0800)]
Fix rustdoc output of enums with private variants

Previously, if every variant was private, it would display as a
variantless enum instead of having the "some variants stripped" comment.

10 years agoauto merge of #10964 : cartazio/rust/gcc-detector, r=alexcrichton
bors [Tue, 17 Dec 2013 03:16:43 +0000 (19:16 -0800)]
auto merge of #10964 : cartazio/rust/gcc-detector, r=alexcrichton

 @alexcrichton and others: heres a proof of concept patch for configure that (for now is OS X only) checks at the very end of the configure script if ``cc``, ``gcc``, and ``g++`` possibly point to the same compiler or not.

The way its currently done is i call ```cc  --version```, ``gcc --version`` and ``g++ --version`` and check if theres any matchings for the word ``clang``, ``gcc`` or ``g++``.  So it doesn't rule out miss matched gcc versions or the like, but thats a bit more implausible I think.

10 years agoFallout of rewriting std::comm
Alex Crichton [Fri, 6 Dec 2013 02:19:06 +0000 (18:19 -0800)]
Fallout of rewriting std::comm

10 years agoRewrite std::comm
Alex Crichton [Fri, 6 Dec 2013 01:56:17 +0000 (17:56 -0800)]
Rewrite std::comm

* Streams are now ~3x faster than before (fewer allocations and more optimized)
    * Based on a single-producer single-consumer lock-free queue that doesn't
      always have to allocate on every send.
    * Blocking via mutexes/cond vars outside the runtime
* Streams work in/out of the runtime seamlessly
* Select now works in/out of the runtime seamlessly
* Streams will now fail!() on send() if the other end has hung up
    * try_send() will not fail
* PortOne/ChanOne removed
* SharedPort removed
* MegaPipe removed
* Generic select removed (only one kind of port now)
* API redesign
    * try_recv == never block
    * recv_opt == block, don't fail
    * iter() == Iterator<T> for Port<T>
    * removed peek
    * Type::new
* Removed rt::comm

10 years agoprovide an error at at configure time if gcc, and g++ point to a mixture of clang...
Carter Tazio Schonwald [Sat, 14 Dec 2013 07:59:40 +0000 (02:59 -0500)]
provide an error at  at configure time if gcc, and g++ point to a mixture of clang and gcc. Fixes issue #10959

Signed-off-by: Carter Tazio Schonwald <carter.schonwald@gmail.com>
10 years agoCheck even more live Path nodes in dead-code pass
Kiet Tran [Mon, 16 Dec 2013 23:01:36 +0000 (18:01 -0500)]
Check even more live Path nodes in dead-code pass

10 years agostd::vec: make init_elem nicer by doing fewer moves.
Huon Wilson [Mon, 16 Dec 2013 21:33:50 +0000 (08:33 +1100)]
std::vec: make init_elem nicer by doing fewer moves.

10 years agostd::vec: convert .copy_memory to use copy_nonoverlapping_memory.
Huon Wilson [Mon, 16 Dec 2013 13:31:59 +0000 (00:31 +1100)]
std::vec: convert .copy_memory to use copy_nonoverlapping_memory.

It is required that &mut[]s are disjoint from all other &(mut)[]s, so
this assumption is ok.

10 years agostd::vec::bytes: remove the reference to overlapping src and dest in
Huon Wilson [Mon, 16 Dec 2013 13:06:13 +0000 (00:06 +1100)]
std::vec::bytes: remove the reference to overlapping src and dest in
docs for copy_memory.

&mut [u8] and &[u8] really shouldn't be overlapping at all (part of the
uniqueness/aliasing guarantee of &mut), so no point in encouraging it.

10 years agostd::vec::raw: convert copy_memory to a method.
Huon Wilson [Mon, 16 Dec 2013 12:35:02 +0000 (23:35 +1100)]
std::vec::raw: convert copy_memory to a method.

10 years agostd::vec::raw: convert init_elem to a method.
Huon Wilson [Mon, 16 Dec 2013 12:30:56 +0000 (23:30 +1100)]
std::vec::raw: convert init_elem to a method.

10 years agoDetect stability attributes on methods.
Kiet Tran [Mon, 16 Dec 2013 02:52:48 +0000 (21:52 -0500)]
Detect stability attributes on methods.

If it's a trait method, this checks the stability attribute of the
method inside the trait definition. Otherwise, it checks the method
implementation itself.

10 years agoauto merge of #11002 : pnkfelix/rust/fsk-improve-doc-for-ptr-offset, r=alexcrichton
bors [Mon, 16 Dec 2013 21:16:40 +0000 (13:16 -0800)]
auto merge of #11002 : pnkfelix/rust/fsk-improve-doc-for-ptr-offset, r=alexcrichton

Spell out the units used for the `offset` argument, so that people do not try to scale to units of bytes themselves.

10 years agoRemove obsolete mutability from ast::Ty
Seo Sanghyeon [Mon, 16 Dec 2013 18:01:40 +0000 (03:01 +0900)]
Remove obsolete mutability from ast::Ty

10 years agoauto merge of #11000 : cmr/rust/auto_encode, r=alexcrichton
bors [Mon, 16 Dec 2013 17:06:38 +0000 (09:06 -0800)]
auto merge of #11000 : cmr/rust/auto_encode, r=alexcrichton

Closes #6122

10 years agoSpell out the units used for the `offset` argument, so that people do
Felix S. Klock II [Mon, 16 Dec 2013 16:07:04 +0000 (17:07 +0100)]
Spell out the units used for the `offset` argument, so that people do
not try to scale to units of bytes themselves.

10 years agoUpdate and un-xfail auto-encode test
Corey Richardson [Mon, 16 Dec 2013 14:14:37 +0000 (09:14 -0500)]
Update and un-xfail auto-encode test

Closes #6122

10 years agovec: avoid some unsafe code in MoveIterator's dtor
Daniel Micay [Mon, 16 Dec 2013 13:58:41 +0000 (08:58 -0500)]
vec: avoid some unsafe code in MoveIterator's dtor

10 years agoauto merge of #10966 : michaelwoerister/rust/prelude2, r=cmr
bors [Mon, 16 Dec 2013 13:51:32 +0000 (05:51 -0800)]
auto merge of #10966 : michaelwoerister/rust/prelude2, r=cmr

This PR improves the stepping experience in GDB. It contains some fine tuning of line information and makes *rustc* produce nearly the same IR/DWARF as Clang. The focus of the changes is function prologue handling which has caused some problems in the past (https://github.com/mozilla/rust/issues/9641).

It seems that GDB does not properly handle function prologues when the function uses segmented stacks, i.e. it does not recognize that the `__morestack` check is part of the prologue. When setting a breakpoint like `break foo` it will set the break point before the arguments of `foo()` have been loaded and still contain bogus values. For function with the #[no_split_stack] attribute this problem has never occurred for me so I'm pretty sure that segmented stacks are the cause of the problem. @jdm mentioned that segmented stack won't be completely abandoned after all. I'd be grateful if you could tell me about what the future might bring in this regard (@brson, @cmr).

Anyway, this PR should alleviate this problem at least in the case when setting breakpoints using line numbers and also make it less confusing when setting them via function names because then GDB will break *before* the first statement where one could conceivably argue that arguments need not be initialized yet.

Also, a koala: :koala:

Cheers,
Michael

10 years agostd::vec: remove aliasing &mut [] and &[] from shift_opt.
Huon Wilson [Mon, 16 Dec 2013 12:53:57 +0000 (23:53 +1100)]
std::vec: remove aliasing &mut [] and &[] from shift_opt.

Also, dramatically simplify it with some tasteful raw pointers, rather
than treating everything as a nail with `transmute`.

10 years agoauto merge of #10995 : thestinger/rust/fast_move_iter, r=huonw
bors [Mon, 16 Dec 2013 11:01:58 +0000 (03:01 -0800)]
auto merge of #10995 : thestinger/rust/fast_move_iter, r=huonw

Closes #10976

Taken from https://github.com/thestinger/rust-core/commit/863fbaaa125f1bb290e28cbf22236406cf0aebcf, so it will be easily updated to the better vector representation too.

10 years agovec: make the move iterator fast for all types
Daniel Micay [Mon, 16 Dec 2013 10:26:25 +0000 (05:26 -0500)]
vec: make the move iterator fast for all types

Closes #10976

10 years agodebuginfo: Add comment on is_local_to_unit parameter.
Michael Woerister [Sat, 14 Dec 2013 16:12:59 +0000 (17:12 +0100)]
debuginfo: Add comment on is_local_to_unit parameter.

10 years agodebuginfo: Added some documentation of source location management.
Michael Woerister [Sat, 14 Dec 2013 15:55:02 +0000 (16:55 +0100)]
debuginfo: Added some documentation of source location management.

10 years agodebuginfo: Add test cases for function prologue handling.
Michael Woerister [Fri, 13 Dec 2013 16:47:03 +0000 (17:47 +0100)]
debuginfo: Add test cases for function prologue handling.

10 years agodebuginfo: Set correct source position for function calls.
Michael Woerister [Fri, 13 Dec 2013 16:46:10 +0000 (17:46 +0100)]
debuginfo: Set correct source position for function calls.

10 years agodebuginfo: Set the is_local_to_unit attribute of functions correctly
Michael Woerister [Fri, 13 Dec 2013 14:16:05 +0000 (15:16 +0100)]
debuginfo: Set the is_local_to_unit attribute of functions correctly

10 years agodebuginfo: Use same behavior as Clang for calculating scope_line parameter when creat...
Michael Woerister [Fri, 13 Dec 2013 13:34:44 +0000 (14:34 +0100)]
debuginfo: Use same behavior as Clang for calculating scope_line parameter when creating function DIEs.

10 years agodebuginfo: Get rid of redundant argument copying with debuginfo activated
Michael Woerister [Fri, 13 Dec 2013 12:19:11 +0000 (13:19 +0100)]
debuginfo: Get rid of redundant argument copying with debuginfo activated

10 years agodebuginfo: Create separate lexical block for function bodies.
Michael Woerister [Fri, 13 Dec 2013 11:40:06 +0000 (12:40 +0100)]
debuginfo: Create separate lexical block for function bodies.

10 years agodebuginfo: Clear source positions where they'd confuse LLVM otherwise.
Michael Woerister [Fri, 13 Dec 2013 11:27:22 +0000 (12:27 +0100)]
debuginfo: Clear source positions where they'd confuse LLVM otherwise.

10 years agodebuginfo: Clear debug source locations at beginning of functions.
Michael Woerister [Fri, 13 Dec 2013 11:04:42 +0000 (12:04 +0100)]
debuginfo: Clear debug source locations at beginning of functions.

10 years agodebuginfo: Always set column information to zero for source locations.
Michael Woerister [Fri, 13 Dec 2013 10:43:41 +0000 (11:43 +0100)]
debuginfo: Always set column information to zero for source locations.

10 years agoauto merge of #10994 : ktt3ja/rust/issue-10956, r=alexcrichton
bors [Mon, 16 Dec 2013 09:16:29 +0000 (01:16 -0800)]
auto merge of #10994 : ktt3ja/rust/issue-10956, r=alexcrichton

Types used inside live struct or enum are now marked live.

Fix #10956 and #10993.