]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRemove unused `TypeError` variants
Jonas Schievink [Tue, 20 Sep 2016 00:21:48 +0000 (02:21 +0200)]
Remove unused `TypeError` variants

These weren't flagged by the lint because they were still technically
created somewhere... if you created them before, somehow.

7 years agoAuto merge of #36780 - brson:bump, r=alexcrichton
bors [Wed, 28 Sep 2016 15:33:09 +0000 (08:33 -0700)]
Auto merge of #36780 - brson:bump, r=alexcrichton

Bump version to 1.14

r? @alexcrichton

7 years agoAuto merge of #36777 - tmiasko:chain-read-eof, r=alexcrichton
bors [Wed, 28 Sep 2016 12:04:54 +0000 (05:04 -0700)]
Auto merge of #36777 - tmiasko:chain-read-eof, r=alexcrichton

[std::io::Chain] Mark first as done only when reading into non-zero length buffer.

Fixes #36771.

7 years agoAuto merge of #36604 - japaric:libtest-skip, r=alexcrichton
bors [Wed, 28 Sep 2016 07:38:07 +0000 (00:38 -0700)]
Auto merge of #36604 - japaric:libtest-skip, r=alexcrichton

libtest: add a --skip flag to the test runner

This flag takes a FILTER argument and instructs the test runner to skip
the tests whose names contain the word FILTER. --skip can be used
several times.

---

My motivation for submitting this is that while using [smoke] to run `std` unit tests for cross
targets I found that a few of the tests always fail due to limitations in QEMU (it can't handle too
many threads) and I'd like to skip these problematic tests from the command line to be able to run
the rest of the unit tests.

[smoke]: https://github.com/japaric/smoke

I know there is another mechanism to skip tests: `#[ignore]` but this doesn't work in my use case
because I can't (easily) modify the source of the standard libraries to `#[ignore]` some tests. And
even if I could, the change would involve conditionally ignoring some tests for some targets but
that's not a perfect solution because those tests should pass if executed on real hardware so they
should not be `#[ignored]` in that scenario.

r? @alexcrichton
cc @brson

7 years agofix compiletest
Jorge Aparicio [Wed, 28 Sep 2016 04:03:29 +0000 (23:03 -0500)]
fix compiletest

7 years agoAuto merge of #36776 - alexcrichton:rustc-macro-dep-files, r=nrc
bors [Wed, 28 Sep 2016 03:21:12 +0000 (20:21 -0700)]
Auto merge of #36776 - alexcrichton:rustc-macro-dep-files, r=nrc

rustc: Use a special filename for macros 1.1

This "special filename" is surrounded by `<>` to ensure that
`FileMap::is_real_file` returns `false`. This way the "files" parsed here aren't
emitted as dep info `.d` files and don't confuse Cargo about non-existent files.

Closes #36625

7 years agoAuto merge of #36601 - jseyfried:build_reduced_graph_in_expansion, r=nrc
bors [Tue, 27 Sep 2016 21:11:07 +0000 (14:11 -0700)]
Auto merge of #36601 - jseyfried:build_reduced_graph_in_expansion, r=nrc

Assign def ids and build the module graph during expansion

r? @nrc

7 years agoBump version to 1.14
Brian Anderson [Tue, 27 Sep 2016 19:22:06 +0000 (12:22 -0700)]
Bump version to 1.14

7 years agorustc: Use a special filename for macros 1.1
Alex Crichton [Tue, 27 Sep 2016 18:19:03 +0000 (11:19 -0700)]
rustc: Use a special filename for macros 1.1

This "special filename" is surrounded by `<>` to ensure that
`FileMap::is_real_file` returns `false`. This way the "files" parsed here aren't
emitted as dep info `.d` files and don't confuse Cargo about non-existent files.

Closes #36625

7 years agoAuto merge of #36609 - brson:relnotes, r=alexcrichton
bors [Tue, 27 Sep 2016 17:45:10 +0000 (10:45 -0700)]
Auto merge of #36609 - brson:relnotes, r=alexcrichton

Add changelog for 1.12

[Rendered](https://github.com/brson/rust/blob/relnotes/RELEASES.md).

7 years agoAdd changelog for 1.12
Brian Anderson [Wed, 21 Sep 2016 01:38:26 +0000 (18:38 -0700)]
Add changelog for 1.12

7 years ago[std::io::Chain] Mark first as done only when reading into non-zero length buffer.
Tomasz Miąsko [Mon, 26 Sep 2016 22:00:00 +0000 (00:00 +0200)]
[std::io::Chain] Mark first as done only when reading into non-zero length buffer.

Fixes #36771.

7 years agoAuto merge of #36761 - jonathandturner:E0425_E0446_E0449, r=nrc
bors [Tue, 27 Sep 2016 14:30:34 +0000 (07:30 -0700)]
Auto merge of #36761 - jonathandturner:E0425_E0446_E0449, r=nrc

Update E0425, E0446, E0449

This addresses https://github.com/rust-lang/rust/issues/35343, https://github.com/rust-lang/rust/issues/35923, and https://github.com/rust-lang/rust/issues/35924.  Part of https://github.com/rust-lang/rust/issues/35233

Specifically, this adds labels to these error messages following the suggestions in the attached bugs.

r? @nrc

7 years agoAuto merge of #36758 - michaelwoerister:incr-comp-file-headers, r=eddyb
bors [Tue, 27 Sep 2016 11:05:34 +0000 (04:05 -0700)]
Auto merge of #36758 - michaelwoerister:incr-comp-file-headers, r=eddyb

incr.comp.: Let the compiler ignore incompatible incr. comp. cache artifacts

Implements #35720.

cc @nikomatsakis

7 years agoFix fallout in tests.
Jeffrey Seyfried [Sat, 24 Sep 2016 03:09:14 +0000 (03:09 +0000)]
Fix fallout in tests.

7 years agoFix def id collection for `const_integer`s in the AST.
Jeffrey Seyfried [Fri, 23 Sep 2016 21:13:59 +0000 (21:13 +0000)]
Fix def id collection for `const_integer`s in the AST.

7 years agoWith `--test`, make `#[test]` functions `pub` in `InvocationCollector`
Jeffrey Seyfried [Fri, 23 Sep 2016 07:23:01 +0000 (07:23 +0000)]
With `--test`, make `#[test]` functions `pub` in `InvocationCollector`
and expand the `__test_reexports` in the correct scope.

7 years agoAvoid aborting after expansion from `BuildReducedGraphVisitor` errors.
Jeffrey Seyfried [Tue, 20 Sep 2016 06:33:42 +0000 (06:33 +0000)]
Avoid aborting after expansion from `BuildReducedGraphVisitor` errors.

7 years agoMerge `ModuleData` and `ModuleS`.
Jeffrey Seyfried [Fri, 16 Sep 2016 06:45:03 +0000 (06:45 +0000)]
Merge `ModuleData` and `ModuleS`.

7 years agoBuild the reduced graph during expansion.
Jeffrey Seyfried [Wed, 14 Sep 2016 21:03:09 +0000 (21:03 +0000)]
Build the reduced graph during expansion.

7 years agoPeform def id assignment during expansion.
Jeffrey Seyfried [Wed, 14 Sep 2016 09:55:20 +0000 (09:55 +0000)]
Peform def id assignment during expansion.

7 years agoAuto merge of #36764 - jonathandturner:rollup, r=jonathandturner
bors [Tue, 27 Sep 2016 06:30:19 +0000 (23:30 -0700)]
Auto merge of #36764 - jonathandturner:rollup, r=jonathandturner

Rollup of 14 pull requests

- Successful merges: #36563, #36574, #36586, #36662, #36663, #36669, #36676, #36721, #36723, #36727, #36729, #36742, #36754, #36756
- Failed merges:

7 years agoincr.comp.: Fix build issue in rustc_incremental if CFG_VERSION is not set.
Michael Woerister [Tue, 27 Sep 2016 02:26:10 +0000 (22:26 -0400)]
incr.comp.: Fix build issue in rustc_incremental if CFG_VERSION is not set.

7 years agoAuto merge of #36678 - TimNN:fix-dist, r=alexcrichton
bors [Tue, 27 Sep 2016 00:44:25 +0000 (17:44 -0700)]
Auto merge of #36678 - TimNN:fix-dist, r=alexcrichton

emit feature help in cheat mode (fix nightlies)

This should fix the `distcheck` failure in the latest nightly.

cc #36539

It's probably not ideal to check the environment that often and the code ist duplicated from `librustc/session/config.rs` but this was the easiest fix I could think of.

A cleaner solution would probably be to move the `unstable_features` from `Options` to `ParseSess` and change the `diag` parameter of `emit_feature_err` to take `ParseSess` instead of a `Handler`.

7 years agoRollup merge of #36756 - alygin:e0512-new-format, r=jonathandturner
Jonathan Turner [Tue, 27 Sep 2016 00:29:50 +0000 (17:29 -0700)]
Rollup merge of #36756 - alygin:e0512-new-format, r=jonathandturner

New error format for E0512

Part of #35233, fixes #36107

r? @jonathandturner

7 years agoRollup merge of #36754 - tmiasko:getaddrinfo-errors, r=alexcrichton
Jonathan Turner [Tue, 27 Sep 2016 00:29:49 +0000 (17:29 -0700)]
Rollup merge of #36754 - tmiasko:getaddrinfo-errors, r=alexcrichton

When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno.

Fixes issue #36546. This change also updates libc to earliest version
that includes EAI_SYSTEM constant.

Previously, in cases where `EAI_SYSTEM` has been returned from getaddrinfo, the
resulting `io::Error` would be broadly described as "System error":

    Error { repr: Custom(Custom { kind: Other, error: StringError("failed to lookup address information: System error") }) }

After change a more detailed error is crated based on particular value of
errno, for example:

    Error { repr: Os { code: 64, message: "Machine is not on the network" } }

The only downside is that the prefix "failed to lookup address information" is
no longer included in the error message.

7 years agoRollup merge of #36742 - shepmaster:llvm-4-preamble, r=alexcrichton
Jonathan Turner [Tue, 27 Sep 2016 00:29:49 +0000 (17:29 -0700)]
Rollup merge of #36742 - shepmaster:llvm-4-preamble, r=alexcrichton

Extend preprocessor LLVM version checks to support LLVM 4.x

This doesn't actually do anything for LLVM 4.x yet, but sets the stage.

7 years agoRollup merge of #36729 - frewsxcv:rustdoc, r=alexcrichton
Jonathan Turner [Tue, 27 Sep 2016 00:29:49 +0000 (17:29 -0700)]
Rollup merge of #36729 - frewsxcv:rustdoc, r=alexcrichton

librustdoc refactoring and cleanup.

See each commit for more information. Biggest changes here is the addition of a `passes` module and each pass now lives in its own submodule.

7 years agoRollup merge of #36727 - kallisti5:master, r=Aatch
Jonathan Turner [Tue, 27 Sep 2016 00:29:49 +0000 (17:29 -0700)]
Rollup merge of #36727 - kallisti5:master, r=Aatch

Haiku: Initial work at OS support

These changes should be non-invasive to non-Haiku platforms. These patches were hand reworked from Neil's original Rust 1.9.0 patches. I've done some style cleanup and design updates along the way.

There are a few small additional patches to libc, rust-installer and compiler-rt that will be submitted once this one is accepted.

Haiku can be compiled on Linux, and a full gcc cross-compiler with a Haiku target is available, which means bootstrapping should be fairly easy. The patches here have already successfully bootstrapped under our haiku x86_gcc2 architecture. http://rust-on-haiku.com/wiki/PortingRust

I'll be focusing on our more modern gcc5 x86 and x86 architectures for now.

As for support, we're not seeking official support for now. We understand Haiku isn't a top-tier OS choice, however having these patches upstream greatly reduces the amount of patchwork we have to do. Mesa has Haiku code upstream, and we submit patches to keep it going. Mesa doesn't test on Haiku and we're ok with that :-)

7 years agoRollup merge of #36723 - GuillaumeGomez:e0513, r=jonathandturner
Jonathan Turner [Tue, 27 Sep 2016 00:29:48 +0000 (17:29 -0700)]
Rollup merge of #36723 - GuillaumeGomez:e0513, r=jonathandturner

E0513

Part of #35233

r? @jonathandturner

7 years agoRollup merge of #36721 - TimNN:infinite-emptiness, r=nrc
Jonathan Turner [Tue, 27 Sep 2016 00:29:48 +0000 (17:29 -0700)]
Rollup merge of #36721 - TimNN:infinite-emptiness, r=nrc

reject macros with empty repetitions

Fixes #5067 by checking the lhs of `macro_rules!` for repetitions which could match an empty token tree.

7 years agoRollup merge of #36676 - bluss:rustdoc-where-css, r=steveklabnik
Jonathan Turner [Tue, 27 Sep 2016 00:29:48 +0000 (17:29 -0700)]
Rollup merge of #36676 - bluss:rustdoc-where-css, r=steveklabnik

rustdoc css: Put `where` in trait listings on a new line

This is about the gray area at the top of a trait's documentation page,
that lists all methods and their signatures. A big trait page like
Iterator is very crowded without this tweak.

7 years agoRollup merge of #36669 - jseyfried:refactor_tok_result, r=nrc
Jonathan Turner [Tue, 27 Sep 2016 00:29:48 +0000 (17:29 -0700)]
Rollup merge of #36669 - jseyfried:refactor_tok_result, r=nrc

Unify `TokResult` and `ResultAnyMacro`

Fixes #36641.
r? @nrc

7 years agoRollup merge of #36663 - brson:build-plan, r=alexcrichton
Jonathan Turner [Tue, 27 Sep 2016 00:29:48 +0000 (17:29 -0700)]
Rollup merge of #36663 - brson:build-plan, r=alexcrichton

rustbuild: Print out all build steps when --verbose

These helped me debug some problems with the asmjs target. It's just vomiting debug representations, so not the prettiest stuff.

r? @alexcrichton

7 years agoRollup merge of #36662 - jseyfried:parse_macro_invoc_paths, r=nrc
Jonathan Turner [Tue, 27 Sep 2016 00:29:47 +0000 (17:29 -0700)]
Rollup merge of #36662 - jseyfried:parse_macro_invoc_paths, r=nrc

parser: support paths in bang macro invocations (e.g. `path::to::macro!()`)

r? @nrc

7 years agoRollup merge of #36586 - japaric:rustdoc-sysroot, r=alexcrichton
Jonathan Turner [Tue, 27 Sep 2016 00:29:47 +0000 (17:29 -0700)]
Rollup merge of #36586 - japaric:rustdoc-sysroot, r=alexcrichton

rustdoc: implement --sysroot

with the same semantics as rustc. This let us build documentation for a
crate that depends on a custom sysroot.

r? @alexcrichton
cc @cbiffle

7 years agoRollup merge of #36574 - japaric:link-arg, r=alexcrichton
Jonathan Turner [Tue, 27 Sep 2016 00:29:47 +0000 (17:29 -0700)]
Rollup merge of #36574 - japaric:link-arg, r=alexcrichton

rustc: implement -C link-arg

this flag lets you pass a _single_ argument to the linker but can be
used _repeatedly_. For example, instead of using:

```
rustc -C link-args='-l bar' (..)
```

you could write

```
rustc -C link-arg='-l' -C link-arg='bar' (..)
```

This new flag can be used with RUSTFLAGS where `-C link-args` has
problems with "nested" spaces:

```
RUSTFLAGS='-C link-args="-Tlayout.ld -nostartfiles"'
```

This passes three arguments to rustc: `-C` `link-args="-Tlayout.ld` and
`-nostartfiles"` to `rustc`. That's not what we meant. But this does
what we want:

```
RUSTFLAGS='-C link-arg=-Tlayout.ld -C link-arg=-nostartfiles`
```

cc rust-lang/rfcs#1509

r? @alexcrichton
cc @Zoxc

This needs a test. Any suggestion?

7 years agoRollup merge of #36563 - vanjacosic:patch-1, r=steveklabnik
Jonathan Turner [Tue, 27 Sep 2016 00:29:47 +0000 (17:29 -0700)]
Rollup merge of #36563 - vanjacosic:patch-1, r=steveklabnik

Docs: Update to "Getting Started" section

I came across #34523 and wanted to suggest a solution. See commit for details.

It seemed like a good place to start contributing, let me know if I did anything wrong 😇

7 years agoUpdate E0446 label with improved wording
Jonathan Turner [Tue, 27 Sep 2016 00:05:43 +0000 (17:05 -0700)]
Update E0446 label with improved wording

7 years agoUpdate E0425, E0446, E0449
Jonathan Turner [Mon, 26 Sep 2016 23:05:46 +0000 (16:05 -0700)]
Update E0425, E0446, E0449

7 years agoAuto merge of #36661 - jneem:master, r=nrc
bors [Mon, 26 Sep 2016 21:26:18 +0000 (14:26 -0700)]
Auto merge of #36661 - jneem:master, r=nrc

Change error message for intrinsic signature.

Makes it so the signature of the intrinsic in the user's code is
"found," while the signature that rustc knows about is "expected."

Before this patch, the code
```
extern "platform-intrinsic" {
    fn x86_mm_movemask_ps() -> i32;
}
```
would give the error
```
error[E0444]: platform-specific intrinsic has invalid number of arguments: found 1, expected 0
 --> test.rs:4:5
  |
4 |     fn x86_mm_movemask_ps() -> i32;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error
```

After this patch, it says "found 0, expected 1".

7 years agoincr.comp.: Add test case for cache artifact file headers.
Michael Woerister [Mon, 26 Sep 2016 21:14:31 +0000 (17:14 -0400)]
incr.comp.: Add test case for cache artifact file headers.

7 years agoincr.comp.: Add file header to on-disk artifacts for validation.
Michael Woerister [Mon, 26 Sep 2016 20:05:01 +0000 (16:05 -0400)]
incr.comp.: Add file header to on-disk artifacts for validation.

7 years agoNew error format for E0512
Andrew Lygin [Mon, 26 Sep 2016 19:49:22 +0000 (22:49 +0300)]
New error format for E0512

7 years agoWhen getaddrinfo returns EAI_SYSTEM retrieve actual error from errno.
Tomasz Miąsko [Sat, 24 Sep 2016 22:00:00 +0000 (00:00 +0200)]
When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno.

Fixes issue #36546. This change also updates libc to earliest version
that includes EAI_SYSTEM constant.

7 years agoRemove whitespace from line endings
Vanja Cosic [Mon, 26 Sep 2016 18:55:59 +0000 (20:55 +0200)]
Remove whitespace from line endings

7 years agoUpdate E0513 to new error format
Guillaume Gomez [Sun, 25 Sep 2016 17:37:54 +0000 (19:37 +0200)]
Update E0513 to new error format

7 years agoAdd compile-fail test for E0513
Guillaume Gomez [Sun, 25 Sep 2016 17:18:53 +0000 (19:18 +0200)]
Add compile-fail test for E0513

7 years agoAdd E0513 error explanation
Guillaume Gomez [Sun, 25 Sep 2016 17:10:06 +0000 (19:10 +0200)]
Add E0513 error explanation

7 years agoAuto merge of #36719 - shepmaster:build-env-var-reporting, r=alexcrichton
bors [Mon, 26 Sep 2016 18:12:42 +0000 (11:12 -0700)]
Auto merge of #36719 - shepmaster:build-env-var-reporting, r=alexcrichton

Report which required build-time environment variable is not set

7 years agoExtend preprocessor LLVM version checks to support LLVM 4.x
Jake Goulding [Sat, 24 Sep 2016 14:44:21 +0000 (10:44 -0400)]
Extend preprocessor LLVM version checks to support LLVM 4.x

This doesn't actually do anything for LLVM 4.x yet, but sets the stage.

7 years agoAdd a compile-fail test.
Joe Neeman [Mon, 26 Sep 2016 16:48:35 +0000 (18:48 +0200)]
Add a compile-fail test.

7 years agofix rebase fallout
Tim Neumann [Mon, 26 Sep 2016 15:21:45 +0000 (17:21 +0200)]
fix rebase fallout

7 years agoAuto merge of #36735 - srinivasreddy:typck/variance, r=nrc
bors [Mon, 26 Sep 2016 14:53:27 +0000 (07:53 -0700)]
Auto merge of #36735 - srinivasreddy:typck/variance, r=nrc

run rustfmt on librustc_typeck/variance folder

7 years agoAuto merge of #36734 - nnethercote:fix-HashSet-sizing, r=Aatch
bors [Mon, 26 Sep 2016 11:38:18 +0000 (04:38 -0700)]
Auto merge of #36734 - nnethercote:fix-HashSet-sizing, r=Aatch

Don't allocate during default HashSet creation.

The following `HashMap` creation functions don't allocate heap storage for elements.
```
HashMap::new()
HashMap::default()
HashMap::with_hasher()
```
This is good, because it's surprisingly common to create a HashMap and never
use it. So that case should be cheap.

However, `HashSet` does not have the same behaviour. The corresponding creation
functions *do* allocate heap storage for the default number of non-zero
elements (which is 32 slots for 29 elements).
```
HashMap::new()
HashMap::default()
HashMap::with_hasher()
```
This commit gives `HashSet` the same behaviour as `HashMap`, by simply calling
the corresponding `HashMap` functions (something `HashSet` already does for
`with_capacity` and `with_capacity_and_hasher`). It also reformats one existing
`HashSet` construction to use a consistent single-line format.

This speeds up rustc itself by 1.01--1.04x on most of the non-tiny
rustc-benchmarks.

7 years agoMove `ensure_complete_parse` into `expand.rs`.
Jeffrey Seyfried [Mon, 26 Sep 2016 11:24:10 +0000 (11:24 +0000)]
Move `ensure_complete_parse` into `expand.rs`.

7 years agoAuto merge of #36730 - jseyfried:make_macro_rules_invocations_magic, r=nrc
bors [Mon, 26 Sep 2016 08:21:00 +0000 (01:21 -0700)]
Auto merge of #36730 - jseyfried:make_macro_rules_invocations_magic, r=nrc

Forbid user-defined macros named "macro_rules"

This is a [breaking-change].
r? @nrc

7 years agoHaiku: Use common thread set_name stub
Alexander von Gluck IV [Mon, 26 Sep 2016 05:41:24 +0000 (00:41 -0500)]
Haiku: Use common thread set_name stub

7 years agoappease tidy
Tim Neumann [Sat, 24 Sep 2016 19:03:25 +0000 (21:03 +0200)]
appease tidy

7 years agoemit feature help in cheat mode
Tim Neumann [Sat, 24 Sep 2016 17:28:46 +0000 (19:28 +0200)]
emit feature help in cheat mode

7 years agodeduplicate inline is_nightly_build implementations
Tim Neumann [Sat, 24 Sep 2016 17:26:18 +0000 (19:26 +0200)]
deduplicate inline is_nightly_build implementations

7 years agorefactor away get_unstable_features_setting
Tim Neumann [Sat, 24 Sep 2016 17:20:57 +0000 (19:20 +0200)]
refactor away get_unstable_features_setting

7 years agomake is_nightly_build a method on UnstableFeatures
Tim Neumann [Sat, 24 Sep 2016 17:19:17 +0000 (19:19 +0200)]
make is_nightly_build a method on UnstableFeatures

7 years agoadd unstable_features to ParseSess
Tim Neumann [Sat, 24 Sep 2016 17:04:07 +0000 (19:04 +0200)]
add unstable_features to ParseSess

7 years agomake emit_feature_err take a ParseSess
Tim Neumann [Sat, 24 Sep 2016 16:42:54 +0000 (18:42 +0200)]
make emit_feature_err take a ParseSess

7 years agoAuto merge of #36652 - giannicic:issue-36553, r=nrc
bors [Mon, 26 Sep 2016 05:03:28 +0000 (22:03 -0700)]
Auto merge of #36652 - giannicic:issue-36553, r=nrc

this commit corrects E0520 error text.
See referenced issue for further info

r? @nrc

7 years agoreject macros with empty repetitions
Tim Neumann [Sun, 25 Sep 2016 16:55:04 +0000 (18:55 +0200)]
reject macros with empty repetitions

7 years agoAdd regression test.
Jeffrey Seyfried [Mon, 26 Sep 2016 04:38:26 +0000 (04:38 +0000)]
Add regression test.

7 years agoRefactor `ensure_complete_parse`.
Jeffrey Seyfried [Fri, 23 Sep 2016 23:09:23 +0000 (23:09 +0000)]
Refactor `ensure_complete_parse`.

7 years agoRemove `TokResult`.
Jeffrey Seyfried [Mon, 26 Sep 2016 04:16:55 +0000 (04:16 +0000)]
Remove `TokResult`.

7 years agoRefactor `parse_expansion` out of `ResultAnyMacro`.
Jeffrey Seyfried [Fri, 23 Sep 2016 09:32:58 +0000 (09:32 +0000)]
Refactor `parse_expansion` out of `ResultAnyMacro`.

7 years agorun rustfmt on librustc_typeck/variance folder
Srinivas Reddy Thatiparthy [Mon, 26 Sep 2016 03:14:41 +0000 (08:44 +0530)]
run rustfmt on librustc_typeck/variance folder

7 years agoDon't allocate during default HashSet creation.
Nicholas Nethercote [Mon, 26 Sep 2016 03:05:54 +0000 (13:05 +1000)]
Don't allocate during default HashSet creation.

The following `HashMap` creation functions don't allocate heap storage for elements.
```
HashMap::new()
HashMap::default()
HashMap::with_hasher()
```
This is good, because it's surprisingly common to create a HashMap and never
use it. So that case should be cheap.

However, `HashSet` does not have the same behaviour. The corresponding creation
functions *do* allocate heap storage for the default number of non-zero
elements (which is 32 slots for 29 elements).
```
HashMap::new()
HashMap::default()
HashMap::with_hasher()
```
This commit gives `HashSet` the same behaviour as `HashMap`, by simply calling
the corresponding `HashMap` functions (something `HashSet` already does for
`with_capacity` and `with_capacity_and_hasher`). It also reformats one existing
`HashSet` construction to use a consistent single-line format.

This speeds up rustc itself by 1.01--1.04x on most of the non-tiny
rustc-benchmarks.

7 years agoAuto merge of #36151 - camlorn:struct_layout_optimization, r=eddyb
bors [Mon, 26 Sep 2016 01:47:00 +0000 (18:47 -0700)]
Auto merge of #36151 - camlorn:struct_layout_optimization, r=eddyb

refactor to remove trans::adt and make rustc::ty::layout authoritative

I asked on IRC about optimizing struct layout by reordering fields from most-aligned to least-aligned and somehow ended up getting talked into doing this.  The goal here is to make `layout` authoritative and to remove `adt`.  The former has been accomplished by reimplementing `represent_type_uncached` and the latter is in progress.  @eddyb thought I should make the PR now.

My plan is to reserve the actual optimization for a second PR, as this work is useful by itself.

7 years ago#36553 specialisation error 520 is misleading
Gianni Ciccarelli [Mon, 26 Sep 2016 01:18:42 +0000 (03:18 +0200)]
#36553 specialisation error 520 is misleading

fit string in one line

7 years agoForbid user-defined macros named "macro_rules".
Jeffrey Seyfried [Sun, 25 Sep 2016 23:38:22 +0000 (23:38 +0000)]
Forbid user-defined macros named "macro_rules".

7 years agoIncorporate review comments.
Austin Hicks [Sun, 25 Sep 2016 23:55:43 +0000 (19:55 -0400)]
Incorporate review comments.

7 years agoAuto merge of #36442 - alexcrichton:rustbuild-cross, r=brson
bors [Sun, 25 Sep 2016 22:30:01 +0000 (15:30 -0700)]
Auto merge of #36442 - alexcrichton:rustbuild-cross, r=brson

rustbuild: Nicer error for host builds of targets

If a triple is configured only as a target, not a host, then trying to build
that triple with host artifacts would cause a panic. Fail a little nicer
instead.

Closes #36268

7 years agoMove in-pass-function structs and impls outside functions.
Corey Farwell [Sun, 25 Sep 2016 22:05:58 +0000 (18:05 -0400)]
Move in-pass-function structs and impls outside functions.

Now that each pass has its own module, there's not much of a reason to
keep these structs within the functions.

7 years agoMove pass contants/types into the new `pass` module.
Corey Farwell [Sun, 25 Sep 2016 21:59:40 +0000 (17:59 -0400)]
Move pass contants/types into the new `pass` module.

7 years agoHaiku: Adjust haiku target to match new librustc_back design
Alexander von Gluck IV [Sun, 25 Sep 2016 21:55:40 +0000 (16:55 -0500)]
Haiku: Adjust haiku target to match new librustc_back design

7 years agoSeparate rustdoc passes into separate modules.
Corey Farwell [Sun, 25 Sep 2016 21:38:32 +0000 (17:38 -0400)]
Separate rustdoc passes into separate modules.

7 years agoAuto merge of #36616 - jseyfried:load_macros_in_resolve, r=nrc
bors [Sun, 25 Sep 2016 19:14:11 +0000 (12:14 -0700)]
Auto merge of #36616 - jseyfried:load_macros_in_resolve, r=nrc

Load macros from `#[macro_use]` extern crates in `resolve`

r? @nrc

7 years agoPrivatize `unindent` function.
Corey Farwell [Sun, 25 Sep 2016 19:03:09 +0000 (15:03 -0400)]
Privatize `unindent` function.

Doesn't look like it's used anywhere outside the module.

7 years agoFix incorrect alignment for `if` statement.
Corey Farwell [Sun, 25 Sep 2016 17:57:12 +0000 (13:57 -0400)]
Fix incorrect alignment for `if` statement.

7 years agoUse underscores to breakup long number.
Corey Farwell [Sun, 25 Sep 2016 17:56:54 +0000 (13:56 -0400)]
Use underscores to breakup long number.

7 years agoReport which required build-time environment variable is not set
Jake Goulding [Sun, 25 Sep 2016 15:59:12 +0000 (11:59 -0400)]
Report which required build-time environment variable is not set

7 years agoHaiku: Fix pthread_t typesize set to stable 1.8.0 post #29791
Alexander von Gluck IV [Sun, 25 Sep 2016 15:30:21 +0000 (10:30 -0500)]
Haiku: Fix pthread_t typesize set to stable 1.8.0 post #29791

7 years agoHaiku: Style, TODO to FIXME
Alexander von Gluck IV [Sun, 25 Sep 2016 16:16:38 +0000 (11:16 -0500)]
Haiku: Style, TODO to FIXME

7 years agoHaiku: add support for building on Haiku
Niels Sascha Reedijk [Sun, 25 Sep 2016 04:49:11 +0000 (23:49 -0500)]
Haiku: add support for building on Haiku

* Hand rebased from Niels original work on 1.9.0

7 years agoHaiku: add search path for terminfo
Niels Sascha Reedijk [Sun, 25 Sep 2016 04:44:19 +0000 (23:44 -0500)]
Haiku: add search path for terminfo

* Hand rebased from Niels original work on 1.9.0

7 years agoHaiku: add workaround for missing F_DUPFD_CLOEXEC
Niels Sascha Reedijk [Sun, 25 Sep 2016 04:42:50 +0000 (23:42 -0500)]
Haiku: add workaround for missing F_DUPFD_CLOEXEC

The src/libstd/sys/unix/net.rs file depends on it. It is missing
from Haiku. This workaround should actually 'fix' the problem,
but it turns out the fds-are-cloexec.rs test hangs. I do not
know how related these two issues are, but it warrants further
investigation.

The test is ignored on this platform for now.

* Hand rebased from Niels original work on 1.9.0

7 years agoHaiku: Work around the lack of the FIOCLEX ioctl
Niels Sascha Reedijk [Sun, 25 Sep 2016 04:41:29 +0000 (23:41 -0500)]
Haiku: Work around the lack of the FIOCLEX ioctl

* Hand rebased from Niels original work on 1.9.0

7 years agoAdd support for the Haiku operating system on x86 and x86_64 machines
Niels Sascha Reedijk [Sun, 25 Sep 2016 04:38:56 +0000 (23:38 -0500)]
Add support for the Haiku operating system on x86 and x86_64 machines

* Hand rebased from Niels original work on 1.9.0

7 years agoAuto merge of #36564 - vanjacosic:patch-2, r=GuillaumeGomez
bors [Sun, 25 Sep 2016 15:08:18 +0000 (08:08 -0700)]
Auto merge of #36564 - vanjacosic:patch-2, r=GuillaumeGomez

Docs: Update to "Ownership" section

Found #34865 while looking for easy docs wins I could contribute with.

7 years agoAuto merge of #36713 - TimNN:fix-36708, r=arielb1
bors [Sun, 25 Sep 2016 09:46:18 +0000 (02:46 -0700)]
Auto merge of #36713 - TimNN:fix-36708, r=arielb1

don't unwrap non-local span

Fixes #36708.

7 years agofix 36708
Tim Neumann [Sun, 25 Sep 2016 06:21:51 +0000 (08:21 +0200)]
fix 36708

7 years agoAuto merge of #36709 - Mark-Simulacrum:fix-wsl-tidy, r=Aatch
bors [Sun, 25 Sep 2016 05:20:25 +0000 (22:20 -0700)]
Auto merge of #36709 - Mark-Simulacrum:fix-wsl-tidy, r=Aatch

Skip binary tidy check when on Windows Linux Subsystem

While it's possible that other linux systems will include "Microsoft" in
their /proc/version, this is deemed unlikely, and since this is a tidy
check, will likely be caught by buildbot/travis either way.

Fixes #36706.

7 years agoSkip binary tidy check when on Windows Linux Subsystem
Mark-Simulacrum [Sun, 25 Sep 2016 03:06:32 +0000 (21:06 -0600)]
Skip binary tidy check when on Windows Linux Subsystem

While it's possible that other linux systems will include "Microsoft" in
their /proc/version, this is deemed unlikely, and since this is a tidy
check, will likely be caught by buildbot/travis either way.

7 years agoUpdate codegen/link_section.rs.
Austin Hicks [Sun, 25 Sep 2016 01:56:26 +0000 (21:56 -0400)]
Update codegen/link_section.rs.