]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agore-add accidentally removed line
Tim Neumann [Tue, 6 Sep 2016 16:53:43 +0000 (18:53 +0200)]
re-add accidentally removed line

7 years agoAuto merge of #36276 - jseyfried:fix_unused, r=nrc
bors [Tue, 6 Sep 2016 08:44:13 +0000 (01:44 -0700)]
Auto merge of #36276 - jseyfried:fix_unused, r=nrc

resolve: Fix unused import false positive with `item_like_imports`

Fixes #36249.
r? @nrc

7 years agoAuto merge of #36078 - ollie27:rustdoc_search_assocconst, r=alexcrichton
bors [Tue, 6 Sep 2016 05:32:36 +0000 (22:32 -0700)]
Auto merge of #36078 - ollie27:rustdoc_search_assocconst, r=alexcrichton

rustdoc: Fix associated consts in search results

Associated consts can appear in none trait impls so need to be treated
like methods when generating the search index.

Fixes #36031

7 years agoAdd struct `AmbiguityError`.
Jeffrey Seyfried [Tue, 6 Sep 2016 03:47:11 +0000 (03:47 +0000)]
Add struct `AmbiguityError`.

7 years agoAdd field `used: Cell<bool>` to variant `NameBindingKind::Import`.
Jeffrey Seyfried [Mon, 5 Sep 2016 05:27:58 +0000 (05:27 +0000)]
Add field `used: Cell<bool>` to variant `NameBindingKind::Import`.

7 years agoAdd regression test.
Jeffrey Seyfried [Mon, 5 Sep 2016 05:10:50 +0000 (05:10 +0000)]
Add regression test.

7 years agoAvoid false positive unused import warnings.
Jeffrey Seyfried [Mon, 5 Sep 2016 04:55:12 +0000 (04:55 +0000)]
Avoid false positive unused import warnings.

7 years agoAuto merge of #36274 - Manishearth:rollup, r=Manishearth
bors [Tue, 6 Sep 2016 00:55:45 +0000 (17:55 -0700)]
Auto merge of #36274 - Manishearth:rollup, r=Manishearth

Rollup of 6 pull requests

- Successful merges: #35845, #35983, #36065, #36102, #36242, #36245
- Failed merges:

7 years agoAuto merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez
bors [Mon, 5 Sep 2016 21:41:16 +0000 (14:41 -0700)]
Auto merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez

Indicate where `core::result::IntoIter` is created.

None

7 years agoAuto merge of #36281 - pnkfelix:fix-issue-36036, r=eddyb
bors [Mon, 5 Sep 2016 18:28:36 +0000 (11:28 -0700)]
Auto merge of #36281 - pnkfelix:fix-issue-36036, r=eddyb

Fix issue #36036.

Fix #36036.

We were treating an associated type as unsized even when the concrete instantiation was actually sized. Fix is to normalize before checking if it is sized.

7 years agoAuto merge of #36200 - mattico:fix-llvm-linkage, r=arielb1
bors [Mon, 5 Sep 2016 15:13:32 +0000 (08:13 -0700)]
Auto merge of #36200 - mattico:fix-llvm-linkage, r=arielb1

Fix incorrect LLVM Linkage enum

Followup of #33994 to actually work.

The `Linkage` enum in librustc_llvm got out of sync with the version in LLVM and it caused two variants of the `#[linkage=""]` attribute to break.

This adds the functions `LLVMRustGetLinkage` and `LLVMRustSetLinkage` which convert between the Rust Linkage enum and the LLVM one, which should stop this from breaking every time LLVM changes it.

Possible remaining concerns:

1. There could be a codegen test to make sure that the attributes are applied correctly (I don't know how to do this).
2. ~~The test does not exercise the `appending` linkage. I can't figure out how to make a global static raw pointer to an array. This might not even be possible? If not we should probably remove appending linkage as its unusable in rust.~~ Appending linkage is not 'emittable' anyway.
3. The test only runs on Linux.

Fixes #33992

r? @alexcrichton

7 years agoAuto merge of #35787 - canndrew:bang_type_refactor_check, r=eddyb
bors [Mon, 5 Sep 2016 11:29:47 +0000 (04:29 -0700)]
Auto merge of #35787 - canndrew:bang_type_refactor_check, r=eddyb

Typecheck refactor for `!`

Ping @nikomatsakis @eddyb. This is the PR for the typeck refactor for `!`. Is this what you guys had in mind? Is there anything else that needs doing on it?

7 years agoFix issue #36036.
Felix S. Klock II [Mon, 5 Sep 2016 10:56:29 +0000 (12:56 +0200)]
Fix issue #36036.

We were treating an associated type as unsized even when the concrete
instantiation was actually sized. Fix is to normalize before checking
if it is sized.

7 years agoRollup merge of #36245 - alexcrichton:add-back-accident, r=arielb1
Manish Goregaokar [Mon, 5 Sep 2016 03:02:04 +0000 (11:02 +0800)]
Rollup merge of #36245 - alexcrichton:add-back-accident, r=arielb1

Add back feature accidentally removed

This feature was accidentally removed in
https://github.com/rust-lang/rust/pull/35957.

7 years agoRollup merge of #36242 - semarie:local-rebuild, r=alexcrichton
Manish Goregaokar [Mon, 5 Sep 2016 03:02:04 +0000 (11:02 +0800)]
Rollup merge of #36242 - semarie:local-rebuild, r=alexcrichton

Use libraries from local-rust-root directory in configure when using …

…--enable-local-rebuild

When using --enable-local-rebuild configure options, the configure
script will test rustc version. But when running it, it will not use the
libraries in the local-rust-root directory.

So use `LD_LIBRARY_PATH` environment variable to correct it.

Under OpenBSD, we use `--enable-local-rebuild` for rebuilding rustc-1.11.0 using rustc-1.11.0. But as it is in use in -current (the developpment branch of OpenBSD), system libraries could easily have ABI/API changes. The (unofficial) bootstrap (rustc-1.11.0 used for building rustc-1.11.0) include several system libraries to permit it to run. The build system use libraries in stage0/lib directory. But the configure script doesn't.

Due to my special use of `--enable-local-rebuild`, I dunno if this PR is suitable for inclusion. But it corrects a difference between build and configure use of the binary.

r? @alexcrichton

7 years agoRollup merge of #36065 - acrrd:new_format_E0496, r=GuillaumeGomez
Manish Goregaokar [Mon, 5 Sep 2016 03:02:03 +0000 (11:02 +0800)]
Rollup merge of #36065 - acrrd:new_format_E0496, r=GuillaumeGomez

Update E0496 to new format

Fixes #36000.
Part of #35233.

r? @GuillaumeGomez

7 years agoRollup merge of #35983 - GuillaumeGomez:e0060_bonus, r=jonathandturner
Manish Goregaokar [Mon, 5 Sep 2016 03:02:03 +0000 (11:02 +0800)]
Rollup merge of #35983 - GuillaumeGomez:e0060_bonus, r=jonathandturner

E0060 and E0061 improvement

Fixes #35290.

r? @jonathandturner

7 years agoRollup merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez
Manish Goregaokar [Mon, 5 Sep 2016 03:02:03 +0000 (11:02 +0800)]
Rollup merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez

Indicate where `core::result::IntoIter` is created.

None

7 years agoAuto merge of #36242 - semarie:local-rebuild, r=alexcrichton
bors [Mon, 5 Sep 2016 06:50:04 +0000 (23:50 -0700)]
Auto merge of #36242 - semarie:local-rebuild, r=alexcrichton

Use libraries from local-rust-root directory in configure when using …

…--enable-local-rebuild

When using --enable-local-rebuild configure options, the configure
script will test rustc version. But when running it, it will not use the
libraries in the local-rust-root directory.

So use `LD_LIBRARY_PATH` environment variable to correct it.

Under OpenBSD, we use `--enable-local-rebuild` for rebuilding rustc-1.11.0 using rustc-1.11.0. But as it is in use in -current (the developpment branch of OpenBSD), system libraries could easily have ABI/API changes. The (unofficial) bootstrap (rustc-1.11.0 used for building rustc-1.11.0) include several system libraries to permit it to run. The build system use libraries in stage0/lib directory. But the configure script doesn't.

Due to my special use of `--enable-local-rebuild`, I dunno if this PR is suitable for inclusion. But it corrects a difference between build and configure use of the binary.

r? @alexcrichton

7 years agoRemove expr_ty method completely
Andrew Cann [Sun, 28 Aug 2016 11:37:57 +0000 (19:37 +0800)]
Remove expr_ty method completely

7 years agoUndo unnecessary bookkeeping from last commit
Andrew Cann [Sun, 28 Aug 2016 09:29:54 +0000 (17:29 +0800)]
Undo unnecessary bookkeeping from last commit

7 years agoRemove use of expr_ty from coercions code
Andrew Cann [Sun, 28 Aug 2016 08:17:52 +0000 (16:17 +0800)]
Remove use of expr_ty from coercions code

7 years agoMove write_ty to the bottom of check_pat
Andrew Cann [Sat, 27 Aug 2016 12:38:06 +0000 (20:38 +0800)]
Move write_ty to the bottom of check_pat

7 years agoFactor write_ty out of more pattern-checking functions
Andrew Cann [Sat, 27 Aug 2016 12:34:37 +0000 (20:34 +0800)]
Factor write_ty out of more pattern-checking functions

7 years agoFactor write_ty out of pattern-matching functions
Andrew Cann [Sat, 27 Aug 2016 12:06:47 +0000 (20:06 +0800)]
Factor write_ty out of pattern-matching functions

7 years agocheck_block_with_expected returns the checked type
Andrew Cann [Fri, 19 Aug 2016 06:41:25 +0000 (14:41 +0800)]
check_block_with_expected returns the checked type

7 years agoMove check_expr match block into its own method
Andrew Cann [Fri, 19 Aug 2016 06:17:00 +0000 (14:17 +0800)]
Move check_expr match block into its own method

7 years agoTidy. Rename variables.
Andrew Cann [Fri, 19 Aug 2016 06:12:37 +0000 (14:12 +0800)]
Tidy. Rename variables.

7 years agoTidy
Andrew Cann [Thu, 18 Aug 2016 16:24:32 +0000 (00:24 +0800)]
Tidy

7 years agoAdd AdjustNeverToAny in check_expr
Andrew Cann [Thu, 18 Aug 2016 16:13:15 +0000 (00:13 +0800)]
Add AdjustNeverToAny in check_expr

7 years agoFactor write_ty out of function checking functions
Andrew Cann [Thu, 18 Aug 2016 15:52:05 +0000 (23:52 +0800)]
Factor write_ty out of function checking functions

7 years agoFactor write_ty out of check_expr_closure
Andrew Cann [Thu, 18 Aug 2016 15:30:11 +0000 (23:30 +0800)]
Factor write_ty out of check_expr_closure

7 years agoFactor write_ty out of check_struct_expr
Andrew Cann [Thu, 18 Aug 2016 14:51:01 +0000 (22:51 +0800)]
Factor write_ty out of check_struct_expr

7 years agoFactor write_ty out of field/indexing methods
Andrew Cann [Thu, 18 Aug 2016 14:07:57 +0000 (22:07 +0800)]
Factor write_ty out of field/indexing methods

7 years agoFactor write_ty out of more checking functions
Andrew Cann [Thu, 18 Aug 2016 13:09:21 +0000 (21:09 +0800)]
Factor write_ty out of more checking functions

7 years agoFactor write_ty out of check_binop*
Andrew Cann [Thu, 18 Aug 2016 09:16:42 +0000 (17:16 +0800)]
Factor write_ty out of check_binop*

7 years agoRemove redundant error checking around ExprMethodCall
Andrew Cann [Thu, 18 Aug 2016 06:21:13 +0000 (14:21 +0800)]
Remove redundant error checking around ExprMethodCall

7 years agoRemove most uses of expr_ty
Andrew Cann [Tue, 9 Aug 2016 16:13:20 +0000 (00:13 +0800)]
Remove most uses of expr_ty

7 years agoMake write_ty and friends return adjusted type
Andrew Cann [Tue, 9 Aug 2016 12:57:41 +0000 (20:57 +0800)]
Make write_ty and friends return adjusted type

7 years agoAuto merge of #36240 - leeopop:master, r=jseyfried
bors [Mon, 5 Sep 2016 01:36:42 +0000 (18:36 -0700)]
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

7 years agoFix incorrect LLVM Linkage enum
Matt Ickstadt [Thu, 1 Sep 2016 18:52:33 +0000 (13:52 -0500)]
Fix incorrect LLVM Linkage enum

The `Linkage` enum in librustc_llvm got out of sync with the version in LLVM and it caused two variants of the #[linkage=""] attribute to break.

This adds the functions `LLVMRustGetLinkage` and `LLVMRustSetLinkage` which convert between the Rust Linkage enum and the LLVM one, which should stop this from breaking every time LLVM changes it.

Fixes #33992

7 years agoAuto merge of #36203 - petrochenkov:uvsdot, r=nrc
bors [Sun, 4 Sep 2016 21:03:01 +0000 (14:03 -0700)]
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.

7 years agoAuto merge of #36144 - japaric:rustbuild-musl, r=alexcrichton
bors [Sun, 4 Sep 2016 17:22:26 +0000 (10:22 -0700)]
Auto merge of #36144 - japaric:rustbuild-musl, r=alexcrichton

rustbuild: fix building std for musl targets

closes #36143

r? @alexcrichton

7 years agoAuto merge of #36255 - Manishearth:rollup, r=Manishearth
bors [Sun, 4 Sep 2016 13:06:37 +0000 (06:06 -0700)]
Auto merge of #36255 - Manishearth:rollup, r=Manishearth

Rollup of 7 pull requests

- Successful merges: #36070, #36132, #36200, #36212, #36225, #36231, #36234
- Failed merges:

7 years agoRollup merge of #36234 - durka:disable-codegen-config, r=alexcrichton
Manish Goregaokar [Sun, 4 Sep 2016 02:22:36 +0000 (07:52 +0530)]
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

7 years agoRollup merge of #36231 - durka:patch-29, r=alexcrichton
Manish Goregaokar [Sun, 4 Sep 2016 02:22:36 +0000 (07:52 +0530)]
Rollup merge of #36231 - durka:patch-29, r=alexcrichton

indicate where to copy config.toml.example

r? @alexcrichton

7 years agoRollup merge of #36225 - johnthagen:fix-nightly-docs, r=steveklabnik
Manish Goregaokar [Sun, 4 Sep 2016 02:22:36 +0000 (07:52 +0530)]
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).

7 years agoRollup merge of #36212 - razielgn:updated-e0493-to-new-format, r=jonathandturner
Manish Goregaokar [Sun, 4 Sep 2016 02:22:36 +0000 (07:52 +0530)]
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. :)

7 years agoRollup merge of #36132 - nrc:save-std, r=@eddyb
Manish Goregaokar [Sun, 4 Sep 2016 02:22:35 +0000 (07:52 +0530)]
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.

7 years agoRollup merge of #36070 - gavinb:master, r=jonathandturner
Manish Goregaokar [Sun, 4 Sep 2016 02:22:35 +0000 (07:52 +0530)]
Rollup merge of #36070 - gavinb:master, r=jonathandturner

Update error format for E0458, E0459

Fixes #35933, #35932
Part of #35233

r? @jonathandturner

7 years agoAuto merge of #36132 - nrc:save-std, r=@eddyb
bors [Sun, 4 Sep 2016 09:40:31 +0000 (02:40 -0700)]
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.

7 years agoReplace `_, _` with `..`
Vadim Petrochenkov [Fri, 26 Aug 2016 16:23:42 +0000 (19:23 +0300)]
Replace `_, _` with `..`

7 years agoReplace `_, _, _` with `..`
Vadim Petrochenkov [Fri, 26 Aug 2016 16:23:42 +0000 (19:23 +0300)]
Replace `_, _, _` with `..`

7 years agoAuto merge of #36034 - ahmedcharles:orbit, r=eddyb
bors [Sun, 4 Sep 2016 06:24:32 +0000 (23:24 -0700)]
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?

7 years agoAllow CompilerControllers to access rustc_plugin::registry::Registry structure.
Keunhong Lee [Sun, 4 Sep 2016 03:22:56 +0000 (03:22 +0000)]
Allow CompilerControllers to access rustc_plugin::registry::Registry structure.

7 years agoAuto merge of #36124 - eddyb:fast-array-init, r=alexcrichton
bors [Sun, 4 Sep 2016 00:41:08 +0000 (17:41 -0700)]
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 https://github.com/eddyb/llvm/commit/cc2009f02d3b9a3c05be939978212e832310b3d6, 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.

7 years agoE0060 and E0061 improvement
Guillaume Gomez [Thu, 25 Aug 2016 11:06:38 +0000 (13:06 +0200)]
E0060 and E0061 improvement

7 years agoAuto merge of #36119 - arielb1:ctp-again, r=eddyb
bors [Sat, 3 Sep 2016 21:31:42 +0000 (14:31 -0700)]
Auto merge of #36119 - arielb1:ctp-again, r=eddyb

fix broken type parameter indexing logic in wfcheck

r? @eddyb

Fixes #36075

7 years agoIndicate where `core::result::IntoIter` is created.
Corey Farwell [Sat, 20 Aug 2016 01:43:21 +0000 (21:43 -0400)]
Indicate where `core::result::IntoIter` is created.

7 years agoAuto merge of #36104 - KiChjang:issue-35847, r=brson
bors [Sat, 3 Sep 2016 18:24:01 +0000 (11:24 -0700)]
Auto merge of #36104 - KiChjang:issue-35847, r=brson

Fix illegal instruction caused by overflow in channel cloning

Fixes #35847.

r? @alexcrichton

7 years agoAdd back feature accidentally removed
Alex Crichton [Sat, 3 Sep 2016 17:23:40 +0000 (10:23 -0700)]
Add back feature accidentally removed

This feature was accidentally removed in
https://github.com/rust-lang/rust/pull/35957.

7 years agoAuto merge of #36016 - petrochenkov:union, r=nikomatsakis
bors [Sat, 3 Sep 2016 14:48:06 +0000 (07:48 -0700)]
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

7 years agoUse libraries from local-rust-root directory in configure when using --enable-local...
Sébastien Marie [Sat, 3 Sep 2016 12:06:38 +0000 (14:06 +0200)]
Use libraries from local-rust-root directory in configure when using --enable-local-rebuild

When using --enable-local-rebuild configure options, the configure
script will test rustc version. But when running it, it will not use the
libraries in the local-rust-root directory.

So use `LD_LIBRARY_PATH` environment variable to correct it.

7 years agoAuto merge of #36072 - arthurprs:binary_heap_opt, r=Aatch
bors [Sat, 3 Sep 2016 11:40:38 +0000 (04:40 -0700)]
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

7 years agoFix type encoding/decoding for unions
Vadim Petrochenkov [Fri, 26 Aug 2016 16:23:42 +0000 (19:23 +0300)]
Fix type encoding/decoding for unions

Fix union debuginfo test on lldb

7 years agoAddress comments and add requested tests
Vadim Petrochenkov [Fri, 26 Aug 2016 16:23:42 +0000 (19:23 +0300)]
Address comments and add requested tests

7 years agoFix rebase, fix some tests
Vadim Petrochenkov [Fri, 26 Aug 2016 16:23:42 +0000 (19:23 +0300)]
Fix rebase, fix some tests

7 years agoSupport unions in borrow checker
Vadim Petrochenkov [Fri, 26 Aug 2016 13:54:58 +0000 (16:54 +0300)]
Support unions in borrow checker

Add some more tests

7 years agoSupport deriving some traits for unions
Vadim Petrochenkov [Wed, 24 Aug 2016 18:10:19 +0000 (21:10 +0300)]
Support deriving some traits for unions

7 years agoGenerate debuginfo for unions
Vadim Petrochenkov [Mon, 22 Aug 2016 18:11:22 +0000 (21:11 +0300)]
Generate debuginfo for unions

7 years agoTranslate union constants
Vadim Petrochenkov [Mon, 22 Aug 2016 16:56:14 +0000 (19:56 +0300)]
Translate union constants

Fix alignment for packed unions
Add some missing privacy test
Get rid of `unimplemented_unions` macro

7 years agoFix rebase
Vadim Petrochenkov [Mon, 22 Aug 2016 12:17:05 +0000 (15:17 +0300)]
Fix rebase

7 years agoFix buggy field access translation
Vadim Petrochenkov [Fri, 19 Aug 2016 16:20:30 +0000 (19:20 +0300)]
Fix buggy field access translation

7 years agoImplement drop translation and add lint for unions with drop fields
Vadim Petrochenkov [Fri, 19 Aug 2016 16:20:30 +0000 (19:20 +0300)]
Implement drop translation and add lint for unions with drop fields

Fix some typeck bugs blocking drop tests

7 years agoMake accesses to union fields unsafe
Vadim Petrochenkov [Thu, 18 Aug 2016 17:12:28 +0000 (20:12 +0300)]
Make accesses to union fields unsafe

7 years agoCheck fields in union patters/expressions
Vadim Petrochenkov [Thu, 18 Aug 2016 15:31:47 +0000 (18:31 +0300)]
Check fields in union patters/expressions

Make parsing of union items backward compatible
Add some tests

7 years agoImplement layout calculation and add more trans stubs
Vadim Petrochenkov [Thu, 18 Aug 2016 12:44:00 +0000 (15:44 +0300)]
Implement layout calculation and add more trans stubs

7 years agoFix rebase + address comments
Vadim Petrochenkov [Thu, 18 Aug 2016 12:43:24 +0000 (15:43 +0300)]
Fix rebase + address comments

7 years agoImplement encoding/decoding unions in metadata
Vadim Petrochenkov [Mon, 15 Aug 2016 13:10:58 +0000 (16:10 +0300)]
Implement encoding/decoding unions in metadata

Add well-formedness check
Implement some more missing code

7 years agoSupport unions in rustdoc
Vadim Petrochenkov [Wed, 10 Aug 2016 18:00:17 +0000 (21:00 +0300)]
Support unions in rustdoc

7 years agoSome better support for unions through the compiler
Vadim Petrochenkov [Wed, 10 Aug 2016 18:00:17 +0000 (21:00 +0300)]
Some better support for unions through the compiler

7 years agoLower unions from AST to HIR and from HIR to types
Vadim Petrochenkov [Mon, 8 Aug 2016 22:18:47 +0000 (01:18 +0300)]
Lower unions from AST to HIR and from HIR to types

Parse union items and add a feature for them

7 years agoAdd union types
Vadim Petrochenkov [Sat, 6 Aug 2016 22:09:00 +0000 (01:09 +0300)]
Add union types

7 years agoAdd unions to definition map
Vadim Petrochenkov [Sat, 6 Aug 2016 18:56:02 +0000 (21:56 +0300)]
Add unions to definition map

7 years agoAdd unions to HIR
Vadim Petrochenkov [Sat, 6 Aug 2016 18:36:28 +0000 (21:36 +0300)]
Add unions to HIR

7 years agoAdd unions to AST
Vadim Petrochenkov [Sat, 16 Jul 2016 21:15:15 +0000 (00:15 +0300)]
Add unions to AST

7 years agoAuto merge of #35957 - alexcrichton:macros-1.1, r=nrc
bors [Sat, 3 Sep 2016 07:11:18 +0000 (00:11 -0700)]
Auto merge of #35957 - alexcrichton:macros-1.1, r=nrc

rustc: Implement custom derive (macros 1.1)

This commit is an implementation of [RFC 1681] which adds support to the
compiler for first-class user-define custom `#[derive]` modes with a far more
stable API than plugins have today.

[RFC 1681]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md

The main features added by this commit are:

* A new `rustc-macro` crate-type. This crate type represents one which will
  provide custom `derive` implementations and perhaps eventually flower into the
  implementation of macros 2.0 as well.

* A new `rustc_macro` crate in the standard distribution. This crate will
  provide the runtime interface between macro crates and the compiler. The API
  here is particularly conservative right now but has quite a bit of room to
  expand into any manner of APIs required by macro authors.

* The ability to load new derive modes through the `#[macro_use]` annotations on
  other crates.

All support added here is gated behind the `rustc_macro` feature gate, both for
the library support (the `rustc_macro` crate) as well as the language features.

There are a few minor differences from the implementation outlined in the RFC,
such as the `rustc_macro` crate being available as a dylib and all symbols are
`dlsym`'d directly instead of having a shim compiled. These should only affect
the implementation, however, not the public interface.

This commit also ended up touching a lot of code related to `#[derive]`, making
a few notable changes:

* Recognized derive attributes are no longer desugared to `derive_Foo`. Wasn't
  sure how to keep this behavior and *not* expose it to custom derive.

* Derive attributes no longer have access to unstable features by default, they
  have to opt in on a granular level.

* The `derive(Copy,Clone)` optimization is now done through another "obscure
  attribute" which is just intended to ferry along in the compiler that such an
  optimization is possible. The `derive(PartialEq,Eq)` optimization was also
  updated to do something similar.

---

One part of this PR which needs to be improved before stabilizing are the errors
and exact interfaces here. The error messages are relatively poor quality and
there are surprising spects of this such as `#[derive(PartialEq, Eq, MyTrait)]`
not working by default. The custom attributes added by the compiler end up
becoming unstable again when going through a custom impl.

Hopefully though this is enough to start allowing experimentation on crates.io!

7 years agorustbuild: add config.toml option to disable codegen tests
Alex Burka [Sat, 3 Sep 2016 01:29:12 +0000 (01:29 +0000)]
rustbuild: add config.toml option to disable codegen tests

7 years agochange wording
Alex Burka [Sat, 3 Sep 2016 06:02:03 +0000 (02:02 -0400)]
change wording

7 years agoAuto merge of #35856 - phimuemue:master, r=brson
bors [Sat, 3 Sep 2016 04:02:41 +0000 (21:02 -0700)]
Auto merge of #35856 - phimuemue:master, r=brson

Introduce max_by/min_by on iterators

See https://github.com/rust-lang/rfcs/issues/1722 for reference.

It seems that there is `min`, `max` (simple computation of min/max), `min_by_key`, `max_by_key` (min/max by comparing mapped values) but no `min_by` and `max_by` (min/max according to comparison function). However, e.g. on vectors or slices there is `sort`, `sort_by_key` and `sort_by`.

7 years agoAuto merge of #36227 - jonathandturner:rollup, r=jonathandturner
bors [Sat, 3 Sep 2016 00:44:38 +0000 (17:44 -0700)]
Auto merge of #36227 - jonathandturner:rollup, r=jonathandturner

Rollup of 12 pull requests

- Successful merges: #35754, #35793, #36099, #36160, #36171, #36178, #36180, #36190, #36198, #36205, #36210, #36223
- Failed merges:

7 years agoindicate where to copy config.toml.example
Alex Burka [Fri, 2 Sep 2016 23:54:02 +0000 (19:54 -0400)]
indicate where to copy config.toml.example

7 years agoRollup merge of #36223 - abhiQmar:e0558-formatting, r=jonathandturner
Jonathan Turner [Fri, 2 Sep 2016 22:28:52 +0000 (15:28 -0700)]
Rollup merge of #36223 - abhiQmar:e0558-formatting, r=jonathandturner

Update compiler error E0558 to use new error format

Fixes #36196 part of #35233

r? @jonathandturner

7 years agoRollup merge of #36210 - EugeneGonzalez:E0529, r=jonathandturner
Jonathan Turner [Fri, 2 Sep 2016 22:28:52 +0000 (15:28 -0700)]
Rollup merge of #36210 - EugeneGonzalez:E0529, r=jonathandturner

Fixed E0529's label and unit test

Fixes #36195 part of #35233.

This is ready for review, but will likely fail Travis due to #36138. I changed the wording of the label, so feedback on that would be appreciated.

r? @jonathandturner

7 years agoRollup merge of #36205 - EugeneGonzalez:E0528, r=jonathandturner
Jonathan Turner [Fri, 2 Sep 2016 22:28:52 +0000 (15:28 -0700)]
Rollup merge of #36205 - EugeneGonzalez:E0528, r=jonathandturner

Fixed E0528 label and unit test

Fixes #36194 part of #35233.

r? @jonathandturner

7 years agoRollup merge of #36198 - alexcrichton:fix-travis, r=brson
Jonathan Turner [Fri, 2 Sep 2016 22:28:52 +0000 (15:28 -0700)]
Rollup merge of #36198 - alexcrichton:fix-travis, r=brson

test: Add a min-llvm-version directive

We've got tests which require a particular version of LLVM to run as they're
testing bug fixes. Our build system, however, supports multiple LLVM versions,
so we can't run these tests on all LLVM versions.

This adds a new `min-llvm-version` directive for tests so they can opt out of
being run on older versions of LLVM. This then namely applies that logic to the
`issue-36023.rs` test case and...

Closes #36138

7 years agoRollup merge of #36190 - 0xmohit:pr/issue-31216, r=alexcrichton
Jonathan Turner [Fri, 2 Sep 2016 22:28:52 +0000 (15:28 -0700)]
Rollup merge of #36190 - 0xmohit:pr/issue-31216, r=alexcrichton

configure: check if any of the arguments contain --help

Currently it checks only the first argument.

Fixes #31216

7 years agoRollup merge of #36180 - frewsxcv:patch-33, r=alexcrichton
Jonathan Turner [Fri, 2 Sep 2016 22:28:51 +0000 (15:28 -0700)]
Rollup merge of #36180 - frewsxcv:patch-33, r=alexcrichton

Transition Travis CI to use rustbuild.

7 years agoRollup merge of #36178 - jonathandturner:windows_colors, r=nikomatsakis
Jonathan Turner [Fri, 2 Sep 2016 22:28:51 +0000 (15:28 -0700)]
Rollup merge of #36178 - jonathandturner:windows_colors, r=nikomatsakis

Special case a few colors for Windows

As brought up on [this thread](https://github.com/rust-lang/rust/issues/33240#issuecomment-243310067) the colors used in error messages on Windows can be difficult to read because of the lack of bold.

This PR makes a few changes to improve readability, namely:
* Rather than using BRIGHT_BLUE, on Windows we now use BRIGHT_CYAN, which is easier to read on black when you do not have bold
* We used BRIGHT_YELLOW rather than YELLOW, for the same reason
* Titles will be BRIGHT_WHITE now, to give the illusion of being bold

Some examples:

![warning](https://cloud.githubusercontent.com/assets/547158/18148466/9aa9bbe2-6f8e-11e6-927f-d0eec53cac32.PNG)

![error](https://cloud.githubusercontent.com/assets/547158/18148488/ba9fb186-6f8e-11e6-8d8e-e93d569f61de.PNG)

r? @nikomatsakis

cc @retep998

7 years agoRollup merge of #36171 - jonathandturner:temporary_value, r=nikomatsakis
Jonathan Turner [Fri, 2 Sep 2016 22:28:51 +0000 (15:28 -0700)]
Rollup merge of #36171 - jonathandturner:temporary_value, r=nikomatsakis

Update lifetime errors to specifically note temporaries

This PR updates the error message we give in the case of a temporary value not living long enough.

Before:

<img width="497" alt="screen shot 2016-08-31 at 10 02 47 am" src="https://cloud.githubusercontent.com/assets/547158/18138551/27a06794-6f62-11e6-9ee2-bdf8bed75ca7.png">

Now:

<img width="488" alt="screen shot 2016-08-31 at 10 03 01 am" src="https://cloud.githubusercontent.com/assets/547158/18138557/2e5cf322-6f62-11e6-9047-4a78abf3d78c.png">

Specifically, it makes the following changes:

* Detects if a temporary is being used.  If so, it changes the labels to mention that a temporary value specifically is in question
* Simplifies wording of the existing labels to focus on lifetimes rather than values being valid
* Changes the help to a note, since the help+span wasn't as helpful (and sometimes more confusing) than just a note.

r? @nikomatsakis