]> git.lizzy.rs Git - rust.git/log
rust.git
10 years agoauto merge of #8534 : huonw/rust/tls-key-macro, r=alexcrichton
bors [Fri, 16 Aug 2013 15:05:10 +0000 (08:05 -0700)]
auto merge of #8534 : huonw/rust/tls-key-macro, r=alexcrichton

This allows the internal implementation details of the TLS keys to be
changed without requiring the update of all the users. (Or, applying
changes that *have* to be applied for the keys to work correctly, e.g.
forcing LLVM to not merge these constants.)

10 years agoauto merge of #8532 : kballard/rust/cstr-cleanup, r=erickt
bors [Fri, 16 Aug 2013 13:02:14 +0000 (06:02 -0700)]
auto merge of #8532 : kballard/rust/cstr-cleanup, r=erickt

Implement interior null checking in `.to_c_str()`, among other changes.

10 years agoauto merge of #8530 : brson/rust/rt-backtrace, r=alexcrichton
bors [Fri, 16 Aug 2013 10:59:14 +0000 (03:59 -0700)]
auto merge of #8530 : brson/rust/rt-backtrace, r=alexcrichton

The new scheduler didn't preserve this behavior.

10 years agoauto merge of #8526 : blake2-ppc/rust/either-result, r=catamorphism
bors [Fri, 16 Aug 2013 08:56:16 +0000 (01:56 -0700)]
auto merge of #8526 : blake2-ppc/rust/either-result, r=catamorphism

Retry of PR #8471

Replace the remaining functions marked for issue #8228 with similar functions that are iterator-based.

Change `either::{lefts, rights}` to be iterator-filtering instead of returning a vector.

Replace `map_vec`, `map_vec2`, `iter_vec2` in std::result with three functions:

* `result::collect` gathers `Iterator<Result<V, U>>` to `Result<~[V], U>`
* `result::fold` folds `Iterator<Result<T, E>>` to `Result<V, E>`
* `result::fold_` folds `Iterator<Result<T, E>>` to `Result<(), E>`

10 years agoauto merge of #8518 : catamorphism/rust/issue-8498-workaround, r=brson
bors [Fri, 16 Aug 2013 06:56:14 +0000 (23:56 -0700)]
auto merge of #8518 : catamorphism/rust/issue-8498-workaround, r=brson

r? @brson

10 years agosyntax: add a local_data_key macro that creates a key for access to the TLS.
Huon Wilson [Thu, 15 Aug 2013 13:16:59 +0000 (23:16 +1000)]
syntax: add a local_data_key macro that creates a key for access to the TLS.

This allows the internal implementation details of the TLS keys to be
changed without requiring the update of all the users. (Or, applying
changes that have to be applied for the keys to work correctly, e.g.
forcing LLVM to not merge these constants.)

10 years agoauto merge of #7917 : catamorphism/rust/resolve-and-testcases, r=catamorphism
bors [Fri, 16 Aug 2013 03:56:12 +0000 (20:56 -0700)]
auto merge of #7917 : catamorphism/rust/resolve-and-testcases, r=catamorphism

10 years agotestsuite: xfailed test cases
Tim Chevalier [Fri, 19 Jul 2013 20:25:48 +0000 (13:25 -0700)]
testsuite: xfailed test cases

10 years agoauto merge of #8503 : thestinger/rust/iterator, r=alexcrichton
bors [Fri, 16 Aug 2013 01:23:14 +0000 (18:23 -0700)]
auto merge of #8503 : thestinger/rust/iterator, r=alexcrichton

10 years agorm obsolete test
Daniel Micay [Fri, 16 Aug 2013 01:12:54 +0000 (21:12 -0400)]
rm obsolete test

10 years agovec: rm redundant is_empty implementations
Daniel Micay [Wed, 14 Aug 2013 02:06:10 +0000 (22:06 -0400)]
vec: rm redundant is_empty implementations

10 years agoiterator: cleanup
Daniel Micay [Wed, 14 Aug 2013 01:41:50 +0000 (21:41 -0400)]
iterator: cleanup

10 years agovec: rm obsolete zip and zip_slice
Daniel Micay [Wed, 14 Aug 2013 01:29:16 +0000 (21:29 -0400)]
vec: rm obsolete zip and zip_slice

These are obsoleted by the generic iterator `zip` adaptor. Unlike
these, it does not clone the elements or allocate a new vector by
default.

10 years agotuple: remove obsolete ExtendedTupleOps
Daniel Micay [Wed, 14 Aug 2013 01:00:58 +0000 (21:00 -0400)]
tuple: remove obsolete ExtendedTupleOps

replaced by iterators (generic composable `map` and `zip` adaptors)

10 years agoupdate the iterator tutorial
Daniel Micay [Tue, 13 Aug 2013 04:37:50 +0000 (00:37 -0400)]
update the iterator tutorial

10 years agokinds: update documentation
Daniel Micay [Wed, 14 Aug 2013 00:46:50 +0000 (20:46 -0400)]
kinds: update documentation

10 years agoptr: inline the Clone implementation
Daniel Micay [Wed, 14 Aug 2013 00:37:05 +0000 (20:37 -0400)]
ptr: inline the Clone implementation

10 years agoauto merge of #8485 : alexcrichton/rust/add-tests, r=catamorphism
bors [Thu, 15 Aug 2013 22:41:11 +0000 (15:41 -0700)]
auto merge of #8485 : alexcrichton/rust/add-tests, r=catamorphism

Closes #3907
Closes #5493
Closes #4464
Closes #4759
Closes #5666
Closes #5884
Closes #5926
Closes #6318
Closes #6557
Closes #6898
Closes #6919
Closes #7222

10 years agoAdd even more tests
Alex Crichton [Thu, 15 Aug 2013 21:22:36 +0000 (14:22 -0700)]
Add even more tests

Closes #8248
Closes #8249
Closes #8398
Closes #8401

10 years agoFix a typo in the ifmt dox
Alex Crichton [Wed, 14 Aug 2013 04:33:09 +0000 (21:33 -0700)]
Fix a typo in the ifmt dox

10 years agoauto merge of #8515 : kballard/rust/saturating-checked, r=thestinger
bors [Thu, 15 Aug 2013 20:50:10 +0000 (13:50 -0700)]
auto merge of #8515 : kballard/rust/saturating-checked, r=thestinger

r? @thestinger

10 years agoauto merge of #8499 : nickdesaulniers/rust/issue7169, r=graydon
bors [Thu, 15 Aug 2013 16:26:08 +0000 (09:26 -0700)]
auto merge of #8499 : nickdesaulniers/rust/issue7169, r=graydon

review? @brson
tests are green

10 years agoauto merge of #8491 : robertknight/rust/7722-reservoir_sampling, r=graydon
bors [Thu, 15 Aug 2013 13:56:06 +0000 (06:56 -0700)]
auto merge of #8491 : robertknight/rust/7722-reservoir_sampling, r=graydon

Fixes #7722

I had a couple of queries:
- Should this return an array or an iterator?
- Should this be a method on iterators or on the rng? I implemented it in RngUtils as it seemed to belong with shuffle().

10 years agoauto merge of #8527 : pnkfelix/rust/fsk-visitor-vpar-defaults-step1, r=nikomatsakis
bors [Thu, 15 Aug 2013 11:56:06 +0000 (04:56 -0700)]
auto merge of #8527 : pnkfelix/rust/fsk-visitor-vpar-defaults-step1, r=nikomatsakis

Rewriting visit.rs to operate on a borrowed `&mut V` where `<V:Visitor>`

r? @nikomatsakis
r? @pcwalton

This is the first in a planned series of incremental pull requests.  (There will probably be five pull requests including this one, though they can be combined or split as necessary.)

Part of #7081.  (But definitely does *not* complete it, not on its own, and not even after all five parts land; there are still a few loose ends to tie up or trim afterwards.)

The bulk of this change for this particular PR is pnkfelix@3d83010, which has the changes necessary to visit.rs to support everything else that comes later.  The other commits are illustrating the standard mechanical transformation that I am applying.

One important point for nearly *all* of these pull requests: I was deliberately *not* trying to be intelligent in the transformation.

 * My goal was to minimize code churn, and make the transformation as mechanical as possible.
 * For example, I kept the separation between the Visitor struct (corresponding to the earlier vtable of functions that were potentially closed over local state) and the explicitly passed (and clones) visitor Env.  I am certain that this is almost always unnecessary, and a later task will be to go through an meld the Env's into the Visitors as appropriate.  (My original goal had been to make such melding part of this task; that's why I turned them into a (Env, vtable) tuple way back when.  But I digress.)
 * Also, my main goal here was to get rid of the record of `@fn`'s as described by the oldvisit.rs API.  (This series gets rid of all but one such case; I'm still investigating that.)  There is *still* plenty of `@`-boxing left to be removed, I'm sure, and even still some `@fn`'s too; removing all of those is not the goal here; its just to get rid of the encoded protocol of `@fn`'s in the (old)visit API.

To see where things will be going in the future (i.e., to get a sneak-preview of future pull-requests in the series), see:

 * https://github.com/pnkfelix/rust/commits/fsk-visitor-vpar-defaults-step1 (that's this one)
 * https://github.com/pnkfelix/rust/commits/fsk-visitor-vpar-defaults-step2
 * https://github.com/pnkfelix/rust/commits/fsk-visitor-vpar-defaults-step3
 * https://github.com/pnkfelix/rust/commits/fsk-visitor-vpar-defaults-step4
 * https://github.com/pnkfelix/rust/commits/fsk-visitor-vpar-defaults-step5
    * Note that between step 4 and step 5 there is just a single commit, but its a doozy because its the only case where my mechanical transformation did not apply, and thus more serious rewriting was necessary.  See commit pnkfelix@da902b2ff3b1e0bee9fc63cf00c449cceea8abf7

10 years agoauto merge of #8490 : huonw/rust/fromiterator-extendable, r=catamorphism
bors [Thu, 15 Aug 2013 09:56:08 +0000 (02:56 -0700)]
auto merge of #8490 : huonw/rust/fromiterator-extendable, r=catamorphism

If they are on the trait then it is extremely annoying to use them as
generic parameters to a function, e.g. with the iterator param on the trait
itself, if one was to pass an Extendable<int> to a function that filled it
either from a Range or a Map<VecIterator>, one needs to write something
like:

    fn foo<E: Extendable<int, Range<int>> +
              Extendable<int, Map<&'self int, int, VecIterator<int>>>
          (e: &mut E, ...) { ... }

since using a generic, i.e. `foo<E: Extendable<int, I>, I: Iterator<int>>`
means that `foo` takes 2 type parameters, and the caller has to specify them
(which doesn't work anyway, as they'll mismatch with the iterators used in
`foo` itself).

This patch changes it to:

    fn foo<E: Extendable<int>>(e: &mut E, ...) { ... }

10 years agoRemove inappropriate .to_c_str() in C_cstr()
Kevin Ballard [Thu, 15 Aug 2013 06:40:28 +0000 (23:40 -0700)]
Remove inappropriate .to_c_str() in C_cstr()

LLVMConstStringInContext() doesn't need a null-terminated string. It
takes a length instead. Using .to_c_str() here triggers an ICE whenever
the string literal embeds a null, as in "\x00".

10 years agoMake CString.iter() public
Kevin Ballard [Thu, 15 Aug 2013 02:31:13 +0000 (19:31 -0700)]
Make CString.iter() public

10 years agoAdd ToCStr method .with_c_str()
Kevin Ballard [Thu, 15 Aug 2013 02:21:59 +0000 (19:21 -0700)]
Add ToCStr method .with_c_str()

.with_c_str() is a replacement for the old .as_c_str(), to avoid
unnecessary boilerplate.

Replace all usages of .to_c_str().with_ref() with .with_c_str().

10 years agoCheck for interior nulls in .to_c_str()
Kevin Ballard [Thu, 15 Aug 2013 02:19:29 +0000 (19:19 -0700)]
Check for interior nulls in .to_c_str()

Previous dicussions about CString suggested that interior nulls should
throw an error. This was never implemented. Add this now, using a
condition (named null_byte) to allow for recovery.

Add method .to_c_str_unchecked() that skips this check.

10 years agoauto merge of #8483 : luqmana/rust/rexprs, r=catamorphism
bors [Thu, 15 Aug 2013 07:29:11 +0000 (00:29 -0700)]
auto merge of #8483 : luqmana/rust/rexprs, r=catamorphism

Fixes #8152.

10 years agoauto merge of #8481 : cmr/rust/bench/std/at_vec, r=graydon
bors [Thu, 15 Aug 2013 05:29:06 +0000 (22:29 -0700)]
auto merge of #8481 : cmr/rust/bench/std/at_vec, r=graydon

10 years agorustc: Change ICE message to reflect that ::rt::backtrace doesn't exist
Brian Anderson [Thu, 15 Aug 2013 05:27:03 +0000 (22:27 -0700)]
rustc: Change ICE message to reflect that ::rt::backtrace doesn't exist

10 years agoauto merge of #8525 : graydon/rust/2013-08-14-register-snapshots, r=brson
bors [Thu, 15 Aug 2013 03:29:10 +0000 (20:29 -0700)]
auto merge of #8525 : graydon/rust/2013-08-14-register-snapshots, r=brson

r? someone

10 years agoClarify docs on CString.unwrap()
Kevin Ballard [Thu, 15 Aug 2013 02:18:24 +0000 (19:18 -0700)]
Clarify docs on CString.unwrap()

CString.unwrap() drops ownership of the buffer on the floor. Put this in
the docs.

10 years agoSwitch main borrowck to <V:Visitor> trait API.
Felix S. Klock II [Mon, 12 Aug 2013 22:30:27 +0000 (00:30 +0200)]
Switch main borrowck to <V:Visitor> trait API.

fix borrowck/mod.rs to deal with fn_kind enum fallout.

10 years agoSwitch borrowck::gather_loans to <V:Visitor> visit API.
Felix S. Klock II [Mon, 12 Aug 2013 17:29:19 +0000 (19:29 +0200)]
Switch borrowck::gather_loans to <V:Visitor> visit API.

Placate make tidy.  Remove unnecessary references to oldvisit.

10 years agoSwitch metadata::encoder to <V:Visitor> trait.
Felix S. Klock II [Mon, 12 Aug 2013 12:05:43 +0000 (14:05 +0200)]
Switch metadata::encoder to <V:Visitor> trait.

placate make tidy.  Remove dead code.

10 years agoSwitch to new <V:Visitor> visitor (rather than @Visitor).
Felix S. Klock II [Thu, 8 Aug 2013 12:23:25 +0000 (14:23 +0200)]
Switch to new <V:Visitor> visitor (rather than @Visitor).

Alpha-renamed top-level visit_* functions to walk_*.
(Motivation: Distinguish visit action and recursive traversal.)

Abstract over `&mut self` rather than over `@mut self`.

This required some acrobatics, notably the

  `impl<E> Visitor<E> for @mut Visitor<E>`

and corresponding introduction of `@mut Visitor` and some local `let
mut` bindings.

Remove oldvisit reference.

Added default implementations for all of the Visitor trait methods.

Note that both `visit_expr_post` and `visit_ty` are no-op's by
default, just like they are in `oldvisit::default_visitor`.

Refactoring: extract logic to ease swapping visit for oldvisit (hopefully).

10 years agoregister new snapshots
Graydon Hoare [Thu, 15 Aug 2013 01:45:51 +0000 (18:45 -0700)]
register new snapshots

10 years agoauto merge of #8480 : cmr/rust/tutorial, r=metajack
bors [Thu, 15 Aug 2013 01:29:09 +0000 (18:29 -0700)]
auto merge of #8480 : cmr/rust/tutorial, r=metajack

10 years agoMerge pull request #8479 from catamorphism/derived-errors
Graydon Hoare [Thu, 15 Aug 2013 01:23:55 +0000 (18:23 -0700)]
Merge pull request #8479 from catamorphism/derived-errors

rustc: Eliminate a derived error in check::_match

10 years agostd: Replace map_vec, map_vec2, iter_vec2 in std::result
blake2-ppc [Mon, 12 Aug 2013 18:24:05 +0000 (20:24 +0200)]
std: Replace map_vec, map_vec2, iter_vec2 in std::result

Replace these with three functions based on iterators: collect, fold,
and fold_. The mapping part is replaced by iterator .map(), so the part
that these functions do is to accumulate the final Result<,> value.

* `result::collect` gathers `Iterator<Result<V, U>>` to `Result<~[V], U>`
* `result::fold` folds `Iterator<Result<T, E>>` to `Result<V, E>`
* `result::fold_` folds `Iterator<Result<T, E>>` to `Result<(), E>`

10 years agoUpdate either::partition
blake2-ppc [Mon, 12 Aug 2013 16:39:19 +0000 (18:39 +0200)]
Update either::partition

Remove the only use of either::partition since it was better
accomplished with vector methods.

Update either::partition so that it sizes the vectors correctly before
it starts.

10 years agostd: Change either::{lefts, rights} to return an iterator
blake2-ppc [Mon, 12 Aug 2013 16:39:39 +0000 (18:39 +0200)]
std: Change either::{lefts, rights} to return an iterator

10 years agotestsuite: Add xfailed test for #8498
Tim Chevalier [Tue, 13 Aug 2013 22:57:37 +0000 (15:57 -0700)]
testsuite: Add xfailed test for #8498

10 years agostd: Change ProcessOptions struct to have an option of a ~ vector
Tim Chevalier [Tue, 13 Aug 2013 22:56:17 +0000 (15:56 -0700)]
std: Change ProcessOptions struct to have an option of a ~ vector

This is a workaround for #8498

10 years agorustc: Eliminate a derived error in check::_match
Tim Chevalier [Mon, 12 Aug 2013 23:44:07 +0000 (16:44 -0700)]
rustc: Eliminate a derived error in check::_match

10 years agoauto merge of #8469 : gifnksm/rust/tutorial-ja, r=graydon
bors [Wed, 14 Aug 2013 20:05:22 +0000 (13:05 -0700)]
auto merge of #8469 : gifnksm/rust/tutorial-ja, r=graydon

This PR adds an Japanese translated version of `doc/tutorial.md`.
Other tutorials have not yet translated.

10 years agoRewrite Saturating in terms of CheckedAdd/CheckedSub
Kevin Ballard [Wed, 14 Aug 2013 20:02:20 +0000 (13:02 -0700)]
Rewrite Saturating in terms of CheckedAdd/CheckedSub

10 years agoauto merge of #8462 : thestinger/rust/loop-cleanup, r=cmr
bors [Wed, 14 Aug 2013 17:35:12 +0000 (10:35 -0700)]
auto merge of #8462 : thestinger/rust/loop-cleanup, r=cmr

I missed some of this in e7bb33aed889aebae1b141cdcc2aeeebab1724ee. Hopefully it's all gone now :).

10 years agoauto merge of #8452 : Kimundi/rust/stuff02, r=bstrie
bors [Wed, 14 Aug 2013 15:35:15 +0000 (08:35 -0700)]
auto merge of #8452 : Kimundi/rust/stuff02, r=bstrie

- Methodyfied the string ascii extionsion functions - They got added recently, I wrapped them in a trait.
- Added `into_owned()` method for vectors - similar to `Str`'s `into_owned()` function, allows to convert to a owned vector without making a copy if the source is a owned vector.
- Added `or_some` method to option - similar to `unwrap_or_default`, but keeps the values wrapped in an `Option`. Useful for `Option` chains, eg Iterator impls.
- Added `DoubleEndedIterator` impl to `Option` - Just for compatibility with generic Iterator functions.
- Renamed nil.rs to unit.rs - the type got renamed ages ago, it's time the source file is as well.

10 years agostd: Move the iterator param on FromIterator and Extendable to the method.
Huon Wilson [Tue, 13 Aug 2013 13:08:14 +0000 (23:08 +1000)]
std: Move the iterator param on FromIterator and Extendable to the method.

If they are on the trait then it is extremely annoying to use them as
generic parameters to a function, e.g. with the iterator param on the trait
itself, if one was to pass an Extendable<int> to a function that filled it
either from a Range or a Map<VecIterator>, one needs to write something
like:

    fn foo<E: Extendable<int, Range<int>> +
              Extendable<int, Map<&'self int, int, VecIterator<int>>>
          (e: &mut E, ...) { ... }

since using a generic, i.e. `foo<E: Extendable<int, I>, I: Iterator<int>>`
means that `foo` takes 2 type parameters, and the caller has to specify them
(which doesn't work anyway, as they'll mismatch with the iterators used in
`foo` itself).

This patch changes it to:

    fn foo<E: Extendable<int>>(e: &mut E, ...) { ... }

10 years agorustc: allow @ as-patterns to move when the sub-pattern contains no bindings.
Huon Wilson [Wed, 14 Aug 2013 09:04:41 +0000 (19:04 +1000)]
rustc: allow @ as-patterns to move when the sub-pattern contains no bindings.

A pattern like `foo @ Foo(Bar(*), _)` should be legal, even if `foo` moves,
since the subpatterns are purely structural.

Fixes #3761.

10 years agoauto merge of #8453 : dmanescu/rust/8451, r=cmr
bors [Wed, 14 Aug 2013 13:44:18 +0000 (06:44 -0700)]
auto merge of #8453 : dmanescu/rust/8451, r=cmr

I'm not sure that the supplied tests are suitable.

10 years agoMethodyfied the string ascii extionsion functions
Marvin Löbel [Sun, 11 Aug 2013 02:21:31 +0000 (04:21 +0200)]
Methodyfied the string ascii extionsion functions
Added into_owned() method for vectors
Added DoubleEnded Iterator impl to Option
Renamed nil.rs to unit.rs

10 years agoauto merge of #8440 : sfackler/rust/env-fix, r=pcwalton
bors [Wed, 14 Aug 2013 11:41:20 +0000 (04:41 -0700)]
auto merge of #8440 : sfackler/rust/env-fix, r=pcwalton

The type of the result of option_env! was not fully specified in the
None case, leading to type check failures in the case where the variable
was not defined (e.g. option_env!("FOO").is_none()).

Also cleaned up some compilation warnings.

10 years agoauto merge of #8439 : huonw/rust/hashset-clone, r=cmr
bors [Wed, 14 Aug 2013 09:38:19 +0000 (02:38 -0700)]
auto merge of #8439 : huonw/rust/hashset-clone, r=cmr

Closes #5581.

10 years agoauto merge of #8477 : catamorphism/rust/issue-4096, r=msullivan
bors [Wed, 14 Aug 2013 06:59:18 +0000 (23:59 -0700)]
auto merge of #8477 : catamorphism/rust/issue-4096, r=msullivan

r? @msullivan ...e parameters

In this case, it's likely to be that the user forgot the `self` type, so
say so.

Closes #4096

10 years agoAdd a bunch of tests for closed issues
Alex Crichton [Tue, 13 Aug 2013 03:18:47 +0000 (20:18 -0700)]
Add a bunch of tests for closed issues

Closes #3907
Closes #5493
Closes #4464
Closes #4759
Closes #5666
Closes #5884
Closes #5926
Closes #6318
Closes #6557
Closes #6898
Closes #6919
Closes #7222

10 years agoauto merge of #8497 : nikomatsakis/rust/improvements-to-object-coercion, r=pcwalton
bors [Wed, 14 Aug 2013 04:29:20 +0000 (21:29 -0700)]
auto merge of #8497 : nikomatsakis/rust/improvements-to-object-coercion, r=pcwalton

While looking over the code for object coercion, I realized that it wasn't quite handling freezing and reborrowing correctly. Tweak the code, adding tests for the relevant cases.

r? @pcwalton

10 years agoauto merge of #8446 : alexcrichton/rust/ifmt++, r=graydon
bors [Wed, 14 Aug 2013 02:23:21 +0000 (19:23 -0700)]
auto merge of #8446 : alexcrichton/rust/ifmt++, r=graydon

This includes a number of improvements to `ifmt!`

* Implements formatting arguments -- `{:0.5x}` works now
* Formatting now works on all integer widths, not just `int` and `uint`
* Added a large doc block to `std::fmt` which should help explain what `ifmt!` is all about
* Added floating point formatters, although they have the same pitfalls from before (they're just proof-of-concept now)

Closed a couple of issues along the way, yay! Once this gets into a snapshot, I'll start looking into removing all of `fmt`

10 years agoAdd `f` formats to `ifmt!`
Alex Crichton [Sun, 11 Aug 2013 01:46:44 +0000 (18:46 -0700)]
Add `f` formats to `ifmt!`

Currently the work just the same as the old `extfmt` versions

10 years agoAdd test for repeat expr in statics.
Luqman Aden [Tue, 13 Aug 2013 01:15:19 +0000 (21:15 -0400)]
Add test for repeat expr in statics.

10 years agoRemove unused automatic cfg bindings Fixes #7169
Nick Desaulniers [Wed, 14 Aug 2013 00:06:27 +0000 (17:06 -0700)]
Remove unused automatic cfg bindings Fixes #7169

10 years agoauto merge of #8329 : michaelwoerister/rust/lexical_scopes_alt, r=graydon
bors [Tue, 13 Aug 2013 23:53:14 +0000 (16:53 -0700)]
auto merge of #8329 : michaelwoerister/rust/lexical_scopes_alt, r=graydon

This pull request re-implements handling of visibility scopes and source code positions in debug info. It should now be very stable and properly handle

+ variable shadowing
+ expanded code (macros and the new for-loop de-sugaring, for example)
+ variables in the middle of nested scopes
+ bindings declared in the head of match statement arms.

all of which did not work at all or did not work reliably before. Those interested in a more detailed description of the problems at hand, I kindly refer to http://michaelwoerister.github.io/2013/08/03/visibility-scopes.html

Why doesn't the `populate_scope_map()` function use `syntax::visit`?
Because it would not improve this particular AST walker (see: https://github.com/michaelwoerister/rust/commit/69dc7908490b8b492e9730cb1c34fa83c2ef30eb#commitcomment-3781426)

Cheers,
Michael

10 years agoauto merge of #8475 : kmcallister/rust/stack_segment, r=brson,brson
bors [Tue, 13 Aug 2013 21:57:24 +0000 (14:57 -0700)]
auto merge of #8475 : kmcallister/rust/stack_segment, r=brson,brson

Servo needs to tell SpiderMonkey about the stack bounds.

r? @brson

10 years agoMerge pull request #8432 from chris-morgan/remove-assert-eq-macro-fail-binary
Graydon Hoare [Tue, 13 Aug 2013 21:51:36 +0000 (14:51 -0700)]
Merge pull request #8432 from chris-morgan/remove-assert-eq-macro-fail-binary

Remove in-tree test binary.

10 years agoReborrow even when passing &Object to &Object, so as to permit freezing
Niko Matsakis [Tue, 13 Aug 2013 19:46:08 +0000 (15:46 -0400)]
Reborrow even when passing &Object to &Object, so as to permit freezing

10 years agoFix freezing of @mut Objects when passing as argument
Niko Matsakis [Tue, 13 Aug 2013 18:59:33 +0000 (14:59 -0400)]
Fix freezing of @mut Objects when passing as argument

10 years agoMake rt::stack public
Keegan McAllister [Tue, 13 Aug 2013 16:10:05 +0000 (09:10 -0700)]
Make rt::stack public

Fixes #8478.

10 years agoauto merge of #8423 : alexcrichton/rust/less-priv-again, r=bstrie
bors [Tue, 13 Aug 2013 14:26:23 +0000 (07:26 -0700)]
auto merge of #8423 : alexcrichton/rust/less-priv-again, r=bstrie

Closes #5495

10 years agoAdd RngUtils::sample() method for reservoir sampling from iterators
Robert Knight [Tue, 13 Aug 2013 11:44:16 +0000 (12:44 +0100)]
Add RngUtils::sample() method for reservoir sampling from iterators

10 years agoauto merge of #8411 : bblum/rust/assorted-fixes, r=brson
bors [Tue, 13 Aug 2013 11:59:20 +0000 (04:59 -0700)]
auto merge of #8411 : bblum/rust/assorted-fixes, r=brson

Each commit is pretty much what it says on the tin. r anybody.

10 years agoauto merge of #7866 : sstewartgallus/rust/clean, r=cmr
bors [Tue, 13 Aug 2013 09:14:24 +0000 (02:14 -0700)]
auto merge of #7866 : sstewartgallus/rust/clean, r=cmr

Mostly I did simple transformations from imperative style loops to
more functional iterator based transformations.

10 years agodebuginfo: Add some tests for visibiliy scopes within closures.
Michael Woerister [Tue, 6 Aug 2013 22:14:08 +0000 (00:14 +0200)]
debuginfo: Add some tests for visibiliy scopes within closures.

10 years agodebuginfo: Add support for argument shadowing.
Michael Woerister [Tue, 6 Aug 2013 22:13:31 +0000 (00:13 +0200)]
debuginfo: Add support for argument shadowing.

10 years agodebuginfo: Implemented proper handling of lexical scopes and variable shadowing.
Michael Woerister [Mon, 5 Aug 2013 09:12:40 +0000 (11:12 +0200)]
debuginfo: Implemented proper handling of lexical scopes and variable shadowing.

10 years agolibrustc: Allow vector repeat exprs in statics.
Luqman Aden [Tue, 13 Aug 2013 01:10:29 +0000 (21:10 -0400)]
librustc: Allow vector repeat exprs in statics.

10 years agoauto merge of #8487 : brson/rust/local-opts, r=brson
bors [Tue, 13 Aug 2013 06:56:26 +0000 (23:56 -0700)]
auto merge of #8487 : brson/rust/local-opts, r=brson

I did this once but acciddentally undid it in a later patch.

10 years agoForbid pub/priv where it has no effect
Alex Crichton [Fri, 9 Aug 2013 08:25:24 +0000 (01:25 -0700)]
Forbid pub/priv where it has no effect

Closes #5495

10 years agoExplain what ifmt! is all about
Alex Crichton [Sun, 11 Aug 2013 01:21:34 +0000 (18:21 -0700)]
Explain what ifmt! is all about

10 years agoCorrect the padding on integer types for formatting
Alex Crichton [Sat, 10 Aug 2013 23:50:42 +0000 (16:50 -0700)]
Correct the padding on integer types for formatting

10 years agoDefine integer formats for all widths
Alex Crichton [Sat, 10 Aug 2013 20:38:32 +0000 (13:38 -0700)]
Define integer formats for all widths

Closes #1653

10 years agoImplement formatting arguments for strings and integers
Alex Crichton [Sat, 10 Aug 2013 07:28:47 +0000 (00:28 -0700)]
Implement formatting arguments for strings and integers

Closes #1651

10 years agostd: Re-optimize tls access on local allocation path
Brian Anderson [Tue, 13 Aug 2013 02:09:46 +0000 (19:09 -0700)]
std: Re-optimize tls access on local allocation path

I did this once but acciddentally undid it in a later patch.

10 years agoauto merge of #8476 : thestinger/rust/snapshot, r=brson
bors [Tue, 13 Aug 2013 03:29:22 +0000 (20:29 -0700)]
auto merge of #8476 : thestinger/rust/snapshot, r=brson

10 years agostd::at_vec: add benchmarks
Corey Richardson [Tue, 13 Aug 2013 01:37:39 +0000 (21:37 -0400)]
std::at_vec: add benchmarks

10 years agoauto merge of #8450 : alexcrichton/rust/nopt-changes, r=graydon
bors [Tue, 13 Aug 2013 00:59:19 +0000 (17:59 -0700)]
auto merge of #8450 : alexcrichton/rust/nopt-changes, r=graydon

Since the new runtime landed, the *-nopt builders have increased cycle time by roughly an hour. I have a feeling that this is because the entire runtime is in rust and it's not being optimized at all. In that past with an optimized C++ runtime it looks like things ran faster.

This adds the ability to disable optimizations in tests only, not for the entire compiler. This means that the entire compiler and associated libraries will be built with optimizations, but the tests themselves would be built and run without optimizations.

This isn't quite as good of a guarantee as disabling optimizations everywhere, but hopefully it'll improve cycle time for the *-nopt builds to move the queue along faster.

10 years agoRemove unnecessary return
Corey Richardson [Tue, 13 Aug 2013 00:52:37 +0000 (20:52 -0400)]
Remove unnecessary return

10 years agoauto merge of #8419 : cmr/rust/fix-rtdebug, r=brson
bors [Mon, 12 Aug 2013 22:28:49 +0000 (15:28 -0700)]
auto merge of #8419 : cmr/rust/fix-rtdebug, r=brson

It now actually does logging, and is compiled out when `--cfg rtdebug` is not
given to the libstd build, which it isn't by default. This makes the rt
benchmarks 18-50% faster.

10 years agorustc: Give a hint when a static method call has fewer than expected type parameters
Tim Chevalier [Mon, 12 Aug 2013 21:39:27 +0000 (14:39 -0700)]
rustc: Give a hint when a static method call has fewer than expected type parameters

In this case, it's likely to be that the user forgot the `self` type, so
say so.

Closes #4096

10 years agofix build with the new snapshot compiler
Daniel Micay [Mon, 12 Aug 2013 21:25:14 +0000 (17:25 -0400)]
fix build with the new snapshot compiler

10 years agoregister snapshots
Daniel Micay [Mon, 12 Aug 2013 21:19:09 +0000 (17:19 -0400)]
register snapshots

10 years agort::task: Make current_stack_segment public
Keegan McAllister [Mon, 12 Aug 2013 20:54:38 +0000 (13:54 -0700)]
rt::task: Make current_stack_segment public

Servo needs to tell SpiderMonkey about the stack bounds.

10 years agoClean up transitionary glue in task/spawn.rs. Don't hold kill-little-lock for O(n...
Ben Blum [Mon, 12 Aug 2013 18:54:09 +0000 (14:54 -0400)]
Clean up transitionary glue in task/spawn.rs. Don't hold kill-little-lock for O(n) time, cf #3100, and optimize out several unneeded clone()s.

10 years agoauto merge of #8400 : blake2-ppc/rust/seq-ord, r=cmr
bors [Mon, 12 Aug 2013 18:53:18 +0000 (11:53 -0700)]
auto merge of #8400 : blake2-ppc/rust/seq-ord, r=cmr

Use Eq + Ord for lexicographical ordering of sequences.

For each of <, <=, >= or > as R, use::

    [x, ..xs] R [y, ..ys]  =  if x != y { x R y } else { xs R ys }

Previous code using `a < b` and then `!(b < a)` for short-circuiting
fails on cases such as  [1.0, 2.0] < [0.0/0.0, 3.0], where the first
element was effectively considered equal.

Containers like &[T] did also implement only one comparison operator `<`,
and derived the comparison results from this. This isn't correct either for
Ord.

Implement functions in `std::iterator::order::{lt,le,gt,ge,equal,cmp}` that all
iterable containers can use for lexical order.

We also visit tuple ordering, having the same problem and same solution
(but differing implementation).

10 years agoFix select() in light of the deschedule...and then race. Close #8347.
Ben Blum [Fri, 9 Aug 2013 02:26:23 +0000 (22:26 -0400)]
Fix select() in light of the deschedule...and then race. Close #8347.

10 years agoMake cell with_ref/with_mut_ref use finally. Close #7975.
Ben Blum [Thu, 8 Aug 2013 23:34:08 +0000 (19:34 -0400)]
Make cell with_ref/with_mut_ref use finally. Close #7975.

10 years agoReorganise Select traits to not expose internal runtime types. Close #5160. Pending...
Ben Blum [Thu, 8 Aug 2013 22:34:10 +0000 (18:34 -0400)]
Reorganise Select traits to not expose internal runtime types. Close #5160. Pending #8215.

10 years agoDon't use unkillable in UnsafeArc dtor when there's no unwrapper. Close #8382.
Ben Blum [Thu, 8 Aug 2013 00:26:15 +0000 (20:26 -0400)]
Don't use unkillable in UnsafeArc dtor when there's no unwrapper. Close #8382.