Commit Graph

56617 Commits

Author SHA1 Message Date
Jeffrey Seyfried
d76bf3ed80 Strip unconfigured nodes in the InvocationCollector fold. 2016-09-07 22:41:35 +00:00
Jeffrey Seyfried
3af0c6572e Refactor code out of the folder implementation for StripUnconfigured. 2016-09-07 22:12:30 +00:00
Jeffrey Seyfried
2c88b4b790 Load macros from extern crates in the InvocationCollector fold. 2016-09-05 04:53:35 +00:00
Jeffrey Seyfried
d986bbe674 Implement stackless expansion. 2016-09-05 04:53:34 +00:00
Jeffrey Seyfried
c07ff8d26a Add module ext::placeholders with placeholder() and PlaceholderExpander. 2016-09-05 04:53:33 +00:00
Jeffrey Seyfried
7a3ae576fa Refactor expand_invoc(.., fld) -> self.expand_invoc(..). 2016-09-05 04:53:33 +00:00
Jeffrey Seyfried
79fa9eb643 Refactor SyntaxEnv. 2016-09-05 04:53:32 +00:00
Jeffrey Seyfried
4ed2c0ea7c Refactor expand_* into expander.fold_*. 2016-09-05 04:53:30 +00:00
Jeffrey Seyfried
503a10b34a Clean up module processing. 2016-09-05 04:53:25 +00:00
Jeffrey Seyfried
2a83574c6a Refactor out expand_item (with better semantics than before). 2016-09-05 04:53:23 +00:00
Jeffrey Seyfried
8be8cf8540 Refactor away expand_item. 2016-09-05 04:53:22 +00:00
Jeffrey Seyfried
fca80c983d Generalize Invocation to include modifiers/decorators. 2016-09-05 04:53:21 +00:00
Jeffrey Seyfried
3cba93f993 Refactor with_exts_frame from a macro to a function. 2016-09-05 04:53:21 +00:00
Jeffrey Seyfried
de2e67836e Add Invocation and Expansion, remove MacroGenerable. 2016-09-05 04:53:20 +00:00
Jeffrey Seyfried
9b3bc7a9e9 Remove syntax::config::strip_unconfigured, add syntax::config::features. 2016-09-05 04:53:16 +00:00
Jeffrey Seyfried
234d68b7d3 Improve expand_type. 2016-09-05 04:52:50 +00:00
Jeffrey Seyfried
e1e5c14bad In Parser and ExtCtxt, replace fields filename and mod_path_stack
with a single field `directory: PathBuf`.
2016-09-05 04:52:48 +00:00
bors
86995dc8c5 Auto merge of #36240 - leeopop:master, r=jseyfried
Allow CompilerControllers to access rustc_plugin::registry::Registry

fixes #36064

I chose to put ructc_plugin::registry::Registry structure
into CompilerState structure, instead of Session structure.
This will preserve dependencies among librustc, libructc_driver, and libructc_plugin.

@jseyfried @sanxiyn
2016-09-04 18:36:42 -07:00
bors
91f057de35 Auto merge of #36203 - petrochenkov:uvsdot, r=nrc
Replace `_, _` with `..` in patterns

This is how https://github.com/rust-lang/rust/issues/33627 looks in action.

Looks especially nice in leftmost/rightmost positions `(first, ..)`/`(.., last)`.
I haven't touched libsyntax intentionally because the feature is still unstable.
2016-09-04 14:03:01 -07:00
bors
9cc430d2cf Auto merge of #36144 - japaric:rustbuild-musl, r=alexcrichton
rustbuild: fix building std for musl targets

closes #36143

r? @alexcrichton
2016-09-04 10:22:26 -07:00
bors
987b47549e Auto merge of #36255 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests

- Successful merges: #36070, #36132, #36200, #36212, #36225, #36231, #36234
- Failed merges:
2016-09-04 06:06:37 -07:00
Manish Goregaokar
55893f0da7 Rollup merge of #36234 - durka:disable-codegen-config, r=alexcrichton
rustbuild: add config.toml option to disable codegen tests

Fixes #36232.

I think it worked? Here's a build log where I tried to bootstrap, it crashed, then I added the setting to config.toml and it continued: https://gist.github.com/durka/cbf97cf04b8e065f1a2cfda4c1b6bf95

r? @alexcrichton
2016-09-04 21:01:00 +08:00
Manish Goregaokar
8ee0b6b6c1 Rollup merge of #36231 - durka:patch-29, r=alexcrichton
indicate where to copy config.toml.example

r? @alexcrichton
2016-09-04 21:01:00 +08:00
Manish Goregaokar
eac0ebe35a Rollup merge of #36225 - johnthagen:fix-nightly-docs, r=steveklabnik
Update nightly docs supported Windows versions to match Getting Started page

https://doc.rust-lang.org/book/getting-started.html#tier-1 shows that Windows 7+ is officially supported (implying, for example Windows 10), but the nightly page only listed 7, 8, and Server 2008 R2).
2016-09-04 21:01:00 +08:00
Manish Goregaokar
43440a4a6e Rollup merge of #36212 - razielgn:updated-e0493-to-new-format, r=jonathandturner
Updated e0493 to new format (+ bonus).

Part of #35233.
Fixes #35999.

r? @jonathandturner

I'm not satisfied with the bonus part, there has to be an easier way to reach into the `Drop`'s span implementation. I'm all ears. :)
2016-09-04 21:00:59 +08:00
Manish Goregaokar
8d64649982 Rollup merge of #36132 - nrc:save-std, r=@eddyb
Add --Zsave-analysis-api

This is a save-analysis variation which can be used with libraries distributed without their source (e.g., libstd). It will allow IDEs and other tools to get info about types and create URLs to docs and source, without the unnecessary clutter of internal-only save-analysis info. I'm sure we'll iterate somewhat on the design, but this is a first draft.
2016-09-04 18:02:53 +08:00
Manish Goregaokar
4b889154e1 Rollup merge of #36070 - gavinb:master, r=jonathandturner
Update error format for E0458, E0459

Fixes #35933, #35932
Part of #35233

r? @jonathandturner
2016-09-04 18:02:53 +08:00
bors
e77d86c142 Auto merge of #36132 - nrc:save-std, r=@eddyb
Add --Zsave-analysis-api

This is a save-analysis variation which can be used with libraries distributed without their source (e.g., libstd). It will allow IDEs and other tools to get info about types and create URLs to docs and source, without the unnecessary clutter of internal-only save-analysis info. I'm sure we'll iterate somewhat on the design, but this is a first draft.
2016-09-04 02:40:31 -07:00
Vadim Petrochenkov
e05e74ac83 Replace _, _ with .. 2016-09-04 12:30:33 +03:00
Vadim Petrochenkov
6f7e51e49b Replace _, _, _ with .. 2016-09-04 12:27:01 +03:00
bors
b7d19899de Auto merge of #36034 - ahmedcharles:orbit, r=eddyb
Remove --{enable|disable}-orbit from configure.

Fixes #35956.

r? @eddyb

There are only two buildbots left, though they are both failing. Is there something to be done there other than wait?
2016-09-03 23:24:32 -07:00
Keunhong Lee
ca5dfd0c97 Allow CompilerControllers to access rustc_plugin::registry::Registry structure. 2016-09-04 03:22:56 +00:00
bors
1ca1de6b26 Auto merge of #36124 - eddyb:fast-array-init, r=alexcrichton
Fix optimization regressions for operations on [x; n]-initialized arrays.

Fixes #35662 by using `!=` instead of `<` as the stop condition for `[x; n]` initialization loops.
Also included is cc2009f02d, a hack to run the GVN pass twice, another time after InstCombine.
This hack results in removal of redundant `memset` and `memcpy` calls (from loops over arrays).

cc @nrc Can we get performance numbers on this? Not sure if it regresses anything else.
2016-09-03 17:41:08 -07:00
bors
70598e04f9 Auto merge of #36119 - arielb1:ctp-again, r=eddyb
fix broken type parameter indexing logic in wfcheck

r? @eddyb

Fixes #36075
2016-09-03 14:31:42 -07:00
bors
49e9bfdbf2 Auto merge of #36104 - KiChjang:issue-35847, r=brson
Fix illegal instruction caused by overflow in channel cloning

Fixes #35847.

r? @alexcrichton
2016-09-03 11:24:01 -07:00
bors
d748fa6ecc Auto merge of #36016 - petrochenkov:union, r=nikomatsakis
Implement untagged unions (RFC 1444)

cc https://github.com/rust-lang/rust/issues/32836

Notes:
- The RFC doesn't talk about `#[packed]` unions, this implementation supports them, packing changes union's alignment to 1 and removes trailing padding.
- The RFC doesn't talk about dynamically sized unions, this implementation doesn't support them and rejects them during wf-checking (similarly, dynamically sized enums are not supported as well).
- The lint for drop fields in unions can't work precisely before monomorphization, so it works pessimistically - non-`Copy` generic fields are reported, types not implementing `Drop` directly, but having non-trivial drop code are reported.

    ```
    struct S(String); // Doesn't implement `Drop`
    union U<T> {
        a: S, // Reported
        b: T, // Reported
    }
    ```

- https://github.com/rust-lang/rust/pull/35764 was indeed helpful and landed timely, I didn't have to implement internal drop flags for unions.
- Unions are not permitted in constant patterns, because matching on union fields is unsafe, I didn't want unsafety checker to dig into all constants to uncover this possible unsafety.
- The RFC doesn't talk about `#[derive]`, generally trait impls cannot be derived for unions, but some of them can. I implemented only `#[derive(Copy)]` so far. In theory shallow `#[derive(Clone)]` can be derived as well if all union fields are `Copy`, I left it for later though, it requires changing how `Clone` impls are generated.
- Moving union fields is implemented as per https://github.com/rust-lang/rust/issues/32836#issuecomment-242511491.
- Testing strategy: union specific behavior is tested, sometimes very basically (e.g. debuginfo), behavior common for all ADTs (e.g. something like coherence
checks) is not generally tested.

r? @eddyb
2016-09-03 07:48:06 -07:00
bors
01b35d82e5 Auto merge of #36072 - arthurprs:binary_heap_opt, r=Aatch
Optimize BinaryHeap bounds checking

I was experimenting with d-ary binary heaps during the weekend (dead end) and I found that we could get some good improvements by removing bounds checking. Specially due to the panic-safe additional code, llvm can't really optimize them out.

```
 name                         d_ary_heap:: ns/iter  std___heap:: ns/iter  diff ns/iter  diff %
 bench_build_insert           148,610               236,960                     88,350  59.45%
 bench_from_vec               243,846               299,719                     55,873  22.91%
 bench_insert_2000_empty      4,512                 7,517                        3,005  66.60%
 bench_insert_2000_prefilled  28,665                32,605                       3,940  13.74%
 bench_pop_2000               111,515               128,005                     16,490  14.79%
 bench_pop_all                2,759,945             3,317,626                  557,681  20.21%
 peek_mut                     23,186                23,635                         449   1.94%
 pop_modify_push              41,573                43,822                       2,249   5.41%

test d_ary_heap::bench_build_insert          ... bench:     148,610 ns/iter (+/- 10,687)
test d_ary_heap::bench_from_vec              ... bench:     243,846 ns/iter (+/- 16,500)
test d_ary_heap::bench_insert_2000_empty     ... bench:       4,512 ns/iter (+/- 136)
test d_ary_heap::bench_insert_2000_prefilled ... bench:      28,665 ns/iter (+/- 1,347)
test d_ary_heap::bench_pop_2000              ... bench:     111,515 ns/iter (+/- 104,677)
test d_ary_heap::bench_pop_all               ... bench:   2,759,945 ns/iter (+/- 173,838)
test d_ary_heap::peek_mut                    ... bench:      23,186 ns/iter (+/- 106,254)
test d_ary_heap::pop_modify_push             ... bench:      41,573 ns/iter (+/- 3,313)
test std___heap::bench_build_insert          ... bench:     236,960 ns/iter (+/- 16,955)
test std___heap::bench_from_vec              ... bench:     299,719 ns/iter (+/- 6,354)
test std___heap::bench_insert_2000_empty     ... bench:       7,517 ns/iter (+/- 372)
test std___heap::bench_insert_2000_prefilled ... bench:      32,605 ns/iter (+/- 2,433)
test std___heap::bench_pop_2000              ... bench:     128,005 ns/iter (+/- 11,787)
test std___heap::bench_pop_all               ... bench:   3,317,626 ns/iter (+/- 238,968)
test std___heap::peek_mut                    ... bench:      23,635 ns/iter (+/- 1,420)
test std___heap::pop_modify_push             ... bench:      43,822 ns/iter (+/- 3,788)
```

Test code: https://github.com/arthurprs/heap-experiments
2016-09-03 04:40:38 -07:00
Vadim Petrochenkov
436cfe5653 Fix type encoding/decoding for unions
Fix union debuginfo test on lldb
2016-09-03 13:39:35 +03:00
Vadim Petrochenkov
93067ca089 Address comments and add requested tests 2016-09-03 13:39:35 +03:00
Vadim Petrochenkov
e67c2282af Fix rebase, fix some tests 2016-09-03 13:39:35 +03:00
Vadim Petrochenkov
5f975e969b Support unions in borrow checker
Add some more tests
2016-09-03 13:39:35 +03:00
Vadim Petrochenkov
59ccb7b6db Support deriving some traits for unions 2016-09-03 13:39:35 +03:00
Vadim Petrochenkov
079c390d50 Generate debuginfo for unions 2016-09-03 13:39:35 +03:00
Vadim Petrochenkov
d9b332bd69 Translate union constants
Fix alignment for packed unions
Add some missing privacy test
Get rid of `unimplemented_unions` macro
2016-09-03 13:39:35 +03:00
Vadim Petrochenkov
2dc2fc5fc5 Fix rebase 2016-09-03 13:39:35 +03:00
Vadim Petrochenkov
0cb19389b0 Fix buggy field access translation 2016-09-03 13:39:34 +03:00
Vadim Petrochenkov
bea0b15935 Implement drop translation and add lint for unions with drop fields
Fix some typeck bugs blocking drop tests
2016-09-03 13:39:34 +03:00
Vadim Petrochenkov
e88d4ca0e1 Make accesses to union fields unsafe 2016-09-03 13:39:34 +03:00
Vadim Petrochenkov
f3b41c18a8 Check fields in union patters/expressions
Make parsing of union items backward compatible
Add some tests
2016-09-03 13:39:34 +03:00
Vadim Petrochenkov
957971b63a Implement layout calculation and add more trans stubs 2016-09-03 13:39:34 +03:00