Commit Graph

35005 Commits

Author SHA1 Message Date
Jorge Aparicio
eede5d2bce libcore: use unboxed closures in the fields of FilterMap 2014-12-13 17:03:44 -05:00
Jorge Aparicio
80a04b1aed librustc_trans: fix fallout 2014-12-13 17:03:44 -05:00
Jorge Aparicio
e66ba15764 libunicode: fix fallout 2014-12-13 17:03:44 -05:00
Jorge Aparicio
801ae1333c libcore: use unboxed closures in the fields of Filter 2014-12-13 17:03:44 -05:00
Jorge Aparicio
44b419b820 librustc_trans: fix fallout 2014-12-13 17:03:44 -05:00
Jorge Aparicio
fd06ef24bb librustc: fix fallout 2014-12-13 17:03:44 -05:00
Jorge Aparicio
5e7469cfe1 libsyntax: fix fallout 2014-12-13 17:03:44 -05:00
Jorge Aparicio
d22acb77b2 libstd: fix fallout 2014-12-13 17:03:44 -05:00
Jorge Aparicio
0fcd730373 librustrt: fix fallout 2014-12-13 17:03:44 -05:00
Jorge Aparicio
f91d87e6a0 libcollections: fix fallout 2014-12-13 17:03:44 -05:00
Jorge Aparicio
1646d10edc libcore: use unboxed closures in the fields of Map 2014-12-13 17:03:44 -05:00
Jorge Aparicio
19524f1ed1 libcore: use unboxed closures in Result methods 2014-12-13 17:03:44 -05:00
Jorge Aparicio
135c4ab5fe Fix compile fail tests 2014-12-13 17:03:44 -05:00
Jorge Aparicio
60b0dd533b librustc_trans: fix fallout 2014-12-13 17:03:44 -05:00
Jorge Aparicio
56ecb51ba6 libcore: use unboxed closures in Option methods 2014-12-13 17:03:44 -05:00
bors
567b90ff09 auto merge of #19582 : nikomatsakis/rust/crateification, r=alexcrichton
r? @alexcrichton
2014-12-13 20:02:15 +00:00
bors
2bfb64e525 auto merge of #19627 : steveklabnik/rust/testing_guide, r=cmr 2014-12-13 17:27:15 +00:00
Steve Klabnik
d4ea71dbc1 Revamped testing guide 2014-12-13 12:19:43 -05:00
bors
ce05ff5d4b auto merge of #19695 : arthurtw/rust/master, r=steveklabnik 2014-12-13 15:22:16 +00:00
bors
1eccb54bd6 auto merge of #19685 : jbranchaud/rust/add-btreemap-iter-doctests, r=Gankro 2014-12-13 11:02:17 +00:00
Niko Matsakis
2854d1bfc2 Separate borrowck into its own crate and remove dead code as well. 2014-12-13 06:01:19 -05:00
bors
de64f85c6e auto merge of #19671 : tbu-/rust/pr_doc_removetraitrefs, r=Gankro
This specifically means:
- `Deque`
- `Map`
- `Set`
2014-12-13 08:22:16 +00:00
bors
2d90b91b5d auto merge of #19683 : nikomatsakis/rust/generalized-where-clauses, r=nrc
This patch does not itself enable generalized where clauses, but it lays the groundwork. Rather than storing a list of bounds per type parameter, the trait selection and other logic is now driven by a unified list of predicates. All predicate handling is now driven through a common interface. This also fixes a number of bugs where region predicates were being dropped on the floor. As a drive-by, this patch also fixes some bugs in the opt-out-copy feature flag.

That said, this patch does not change the parser or AST in any way, so we still *generate* the list of predicates by walking a list of bounds (and we still *store* the bounds on the `TypeParameterDef` and so on). Those will get patched in a follow-up.

The commits in this case are standalone; the first few are simple refactorings.

r? @nick29581 
cc @aturon
2014-12-13 03:07:17 +00:00
Niko Matsakis
124e1e18cc Improve comments and address nits. 2014-12-12 20:25:21 -05:00
Niko Matsakis
5f43899db4 Implement the astencode rules for predicates. These don't actually get
used by trans, but it's easy to do.
2014-12-12 20:25:21 -05:00
Niko Matsakis
97cf91aa30 Fix the opt-out-copy behavior so that values with dtor etc are considered affine 2014-12-12 20:25:21 -05:00
Niko Matsakis
07eebf6910 Remove diagnostic errors that were yielding warnings. 2014-12-12 20:25:21 -05:00
Niko Matsakis
9f492fefef Switch to using predicates to drive checking. Correct various tests --
in most cases, just the error message changed, but in some cases we
are reporting new errors that OUGHT to have been reported before but
we're overlooked (mostly involving the `'static` bound on `Send`).
2014-12-12 20:25:21 -05:00
Niko Matsakis
2be6c4f1ca Write code for registering region obligations (but don't use it yet). 2014-12-12 20:24:34 -05:00
Niko Matsakis
9409bd9ff8 Introduce predicates but don't use them. 2014-12-12 20:24:34 -05:00
Niko Matsakis
70be49d2c7 Move the list of region obligations into the fulfillment context. 2014-12-12 20:24:34 -05:00
Niko Matsakis
9bdd7f0040 Thread a id to Obligation 2014-12-12 20:24:34 -05:00
Niko Matsakis
4efaddf7c9 Start restructuring to support generalized where clauses etc. 2014-12-12 20:24:34 -05:00
bors
8c66927242 auto merge of #19664 : tbu-/rust/pr_oibit2_fix, r=Gankro
These probably happened during the merge of the commit that made `Copy` opt-in.

Also, convert the last occurence of `/**` to `///` in `src/libstd/num/strconv.rs`
2014-12-13 00:27:15 +00:00
bors
ffc111889e auto merge of #19569 : murphm8/rust/ring_buf_insert, r=Gankro
This is a first pass at insert on RingBuf. I tried to keep it as simple as possible. I'm not sure of the performance implications of doing one copy vs. copying multiple times but moving a smaller amount of memory. I chose to stick with one copy, even if the amount of memory I have to move is larger.

I believe this is part of #18424 

@Gankro mentioned this was missing.
2014-12-12 21:07:19 +00:00
bors
9146a919b6 auto merge of #19391 : nick29581/rust/assoc-eq, r=nikomatsakis
r? @nikomatsakis 

cc @aturon (I think you were interested in this for some library stuff)

closes #18432
2014-12-12 18:57:15 +00:00
bors
a5921241a3 auto merge of #18028 : gereeter/rust/slimmer-btree-node, r=Gankro
...ated buffer.

Before:

    test btree::map::bench::find_rand_100                      ... bench:        29 ns/iter (+/- 2)
    test btree::map::bench::find_rand_10_000                   ... bench:        83 ns/iter (+/- 6)
    test btree::map::bench::find_seq_100                       ... bench:        30 ns/iter (+/- 1)
    test btree::map::bench::find_seq_10_000                    ... bench:        50 ns/iter (+/- 3)
    test btree::map::bench::insert_rand_100                    ... bench:       186 ns/iter (+/- 30)
    test btree::map::bench::insert_rand_10_000                 ... bench:       377 ns/iter (+/- 8)
    test btree::map::bench::insert_seq_100                     ... bench:       299 ns/iter (+/- 10)
    test btree::map::bench::insert_seq_10_000                  ... bench:       368 ns/iter (+/- 12)
    test btree::map::bench::iter_1000                          ... bench:     20956 ns/iter (+/- 479)
    test btree::map::bench::iter_100000                        ... bench:   2060899 ns/iter (+/- 44325)
    test btree::map::bench::iter_20                            ... bench:       560 ns/iter (+/- 63)

After:

    test btree::map::bench::find_rand_100                      ... bench:        28 ns/iter (+/- 2)
    test btree::map::bench::find_rand_10_000                   ... bench:        74 ns/iter (+/- 3)
    test btree::map::bench::find_seq_100                       ... bench:        31 ns/iter (+/- 0)
    test btree::map::bench::find_seq_10_000                    ... bench:        46 ns/iter (+/- 0)
    test btree::map::bench::insert_rand_100                    ... bench:       141 ns/iter (+/- 1)
    test btree::map::bench::insert_rand_10_000                 ... bench:       273 ns/iter (+/- 12)
    test btree::map::bench::insert_seq_100                     ... bench:       255 ns/iter (+/- 17)
    test btree::map::bench::insert_seq_10_000                  ... bench:       340 ns/iter (+/- 3)
    test btree::map::bench::iter_1000                          ... bench:     21193 ns/iter (+/- 1958)
    test btree::map::bench::iter_100000                        ... bench:   2203599 ns/iter (+/- 100491)
    test btree::map::bench::iter_20                            ... bench:       614 ns/iter (+/- 110)

This code could probably be a fair bit cleaner, but it works.

Part of #18009.
2014-12-12 15:22:06 +00:00
bors
2ea38750e9 auto merge of #19617 : nikomatsakis/rust/issue-19261-2, r=nrc
**First commit.** Patch up debruijn indices. Fixes #19537. 

**Second commit.** Stop reborrowing so much. Fixes #19147. Fixes #19261.

r? @nick29581
2014-12-12 13:21:58 +00:00
Jonathan S
130fb08210 Slimmify BTree by replacing its internal Node type, which previously…held three separately allocated Vecs, with a manually allocated buffer. Additionally, restructure the node and stack interfaces to be safer and require fewer bounds checks.
Before:
test btree::map::bench::find_rand_100                      ... bench:        35 ns/iter (+/- 2)
test btree::map::bench::find_rand_10_000                   ... bench:        88 ns/iter (+/- 3)
test btree::map::bench::find_seq_100                       ... bench:        36 ns/iter (+/- 1)
test btree::map::bench::find_seq_10_000                    ... bench:        62 ns/iter (+/- 0)
test btree::map::bench::insert_rand_100                    ... bench:       157 ns/iter (+/- 8)
test btree::map::bench::insert_rand_10_000                 ... bench:       413 ns/iter (+/- 8)
test btree::map::bench::insert_seq_100                     ... bench:       272 ns/iter (+/- 10)
test btree::map::bench::insert_seq_10_000                  ... bench:       369 ns/iter (+/- 19)
test btree::map::bench::iter_1000                          ... bench:     19049 ns/iter (+/- 740)
test btree::map::bench::iter_100000                        ... bench:   1916737 ns/iter (+/- 102250)
test btree::map::bench::iter_20                            ... bench:       424 ns/iter (+/- 40)

After:
test btree::map::bench::find_rand_100                      ... bench:         9 ns/iter (+/- 1)
test btree::map::bench::find_rand_10_000                   ... bench:         8 ns/iter (+/- 0)
test btree::map::bench::find_seq_100                       ... bench:         7 ns/iter (+/- 0)
test btree::map::bench::find_seq_10_000                    ... bench:         8 ns/iter (+/- 0)
test btree::map::bench::insert_rand_100                    ... bench:       136 ns/iter (+/- 5)
test btree::map::bench::insert_rand_10_000                 ... bench:       380 ns/iter (+/- 34)
test btree::map::bench::insert_seq_100                     ... bench:       255 ns/iter (+/- 8)
test btree::map::bench::insert_seq_10_000                  ... bench:       364 ns/iter (+/- 10)
test btree::map::bench::iter_1000                          ... bench:     19112 ns/iter (+/- 837)
test btree::map::bench::iter_100000                        ... bench:   1911961 ns/iter (+/- 33069)
test btree::map::bench::iter_20                            ... bench:       453 ns/iter (+/- 37)
2014-12-12 06:58:18 -06:00
bors
d2e2bd1b44 auto merge of #19568 : barosl/rust/enum-struct-variants-ice, r=alexcrichton
This pull request tries to fix #19340, which states two ICE cases related to enum struct variants.

It is my first attempt to fix the compiler. I found this solution by trial and error, so the method used to fix the issue looks very hacky. Please review it, and direct me to find a better solution.

I'm also to add test cases. Where should I put them? Maybe `src/test/run-pass/issue-19340.rs`?
2014-12-12 09:12:08 +00:00
Nick Cameron
ce4318ad86 Reviewer comments 2014-12-12 19:29:17 +13:00
Nick Cameron
ae8ba88424 Mostly non-behaviour-changing changes (style, etc.) 2014-12-12 19:11:59 +13:00
Nick Cameron
397dda8aa0 Add support for equality constraints on associated types 2014-12-12 19:11:59 +13:00
Matt Murphy
40f28c70d6 Implement insert for RingBuf 2014-12-11 21:14:59 -06:00
bors
da83ad8e2c auto merge of #19514 : jbranchaud/rust/add-btree-set-bitor, r=Gankro
I am trying to add an implementation of `bitor` for `BTreeSet`. I think I am most of the way there, but I am going to need some guidance to take it all the way.

When I run `make check`, I get:

```
error: cannot move out of dereference of `&`-pointer
self.union(_rhs).map(|&i| i).collect::<BTreeSet<T>>()
                      ^~
```

I'd appreciate any nudges in the right direction. If I can figure this one out, I am sure I will be able to implement `bitand`, `bitxor`, and `sub` as well.

/cc @Gankro 

---

**Update**

I have added implementations for `BitOr`, `BitAnd`, `BitXor`, and `Sub` for `BTreeSet`.
2014-12-12 02:56:53 +00:00
jbranchaud
cd008c4127 Add an implementation of the BitOps for BTreeSets.
Add initial attempt at implementing BitOr for BTreeSet.

Update the implementation of the bitor operator for BTreeSets.

`make check` ran fine through this.

Add implementations for BitAnd, BitXor, and Sub as well.

Remove the FIXME comment and add unstable flags.

Add doctests for the bitop functions.
2014-12-11 19:42:06 -06:00
bors
193390d0e4 auto merge of #19672 : alexcrichton/rust/snapshots, r=brson
These snapshots were generated on the 10.7 bot which should be the first step in fixing #19643
2014-12-11 22:56:54 +00:00
Alex Crichton
52edb2ecc9 Register new snapshots 2014-12-11 11:30:38 -08:00
Barosl Lee
086c9493c8 Fix ICE when a struct variant enum contains multiple fields
Fixes the second case of #19340.
2014-12-12 03:38:11 +09:00
Barosl Lee
418d1bfc9a Fix ICE when a struct variant enum is imported from an external crate
Fixes the first case of #19340.
2014-12-12 03:38:11 +09:00