]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #31666 - dirk:dirk/clarify-memory-arrangement-in-vec-docs, r=steveklabnik
bors [Wed, 17 Feb 2016 09:20:11 +0000 (09:20 +0000)]
Auto merge of #31666 - dirk:dirk/clarify-memory-arrangement-in-vec-docs, r=steveklabnik

Tweak documentation to clarify the structure of `Vec`s as contiguous arrays of items in memory.

Closes #31554; contributes to #29380.

r? @steveklabnik

8 years agoAuto merge of #31685 - petrochenkov:patrefact2, r=eddyb
bors [Wed, 17 Feb 2016 06:01:49 +0000 (06:01 +0000)]
Auto merge of #31685 - petrochenkov:patrefact2, r=eddyb

And split `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::Path`.
This is the HIR part of https://github.com/rust-lang/rust/pull/31581.
This is also kind of a preparation for https://github.com/rust-lang/rfcs/pull/1492.

r? @eddyb

8 years agoAuto merge of #31717 - alexcrichton:llvmup2, r=brson
bors [Wed, 17 Feb 2016 03:25:45 +0000 (03:25 +0000)]
Auto merge of #31717 - alexcrichton:llvmup2, r=brson

This commit rebases our LLVM submodule on the most recent tip of the
`release_38` branch of LLVM. There's been a few fixes and this notably fixes the
assertion error in #31702.

Closes #31702

8 years agoImprove 'std::mem::transmute_copy' doc example.
Corey Farwell [Wed, 17 Feb 2016 02:43:49 +0000 (21:43 -0500)]
Improve 'std::mem::transmute_copy' doc example.

Prior to this commit, it was a trivial example that did not demonstrate
the effects of using the function.

Fixes https://github.com/rust-lang/rust/issues/31094

8 years agoFix sentence in E0451 diagnostic.
rphmeier [Wed, 17 Feb 2016 02:31:50 +0000 (21:31 -0500)]
Fix sentence in E0451 diagnostic.

8 years agoImplement placement-in protocol for `LinkedList`
Andrew Paseltiner [Tue, 16 Feb 2016 03:10:01 +0000 (22:10 -0500)]
Implement placement-in protocol for `LinkedList`

CC #30172.

8 years agoFix #31706
rphmeier [Wed, 17 Feb 2016 01:31:52 +0000 (20:31 -0500)]
Fix #31706

8 years agoAvoid iteration when dropping `HashMap`s whose items don't need dropping
Andrew Paseltiner [Tue, 16 Feb 2016 23:20:35 +0000 (18:20 -0500)]
Avoid iteration when dropping `HashMap`s whose items don't need dropping

This changes the performance of `drop` from linear to constant time for
such `HashMap`s.

Closes #31711.

8 years agorustc: Rebase LLVM on the 3.8 release branch
Alex Crichton [Tue, 16 Feb 2016 17:58:41 +0000 (09:58 -0800)]
rustc: Rebase LLVM on the 3.8 release branch

This commit rebases our LLVM submodule on the most recent tip of the
`release_38` branch of LLVM. There's been a few fixes and this notably fixes the
assertion error in #31702.

8 years agoAuto merge of #31680 - arielb1:fast-fulfill, r=nikomatsakis
bors [Tue, 16 Feb 2016 22:35:09 +0000 (22:35 +0000)]
Auto merge of #31680 - arielb1:fast-fulfill, r=nikomatsakis

this improves typeck performance by 5% (LLVM times are still huge).

Basically fixes #25916 (still O(n^2), but the example takes <1s to
compile).

r? @nikomatsakis

8 years agoDon't compute LastPrivate data for Def::Err.
Jeffrey Seyfried [Tue, 16 Feb 2016 21:59:46 +0000 (21:59 +0000)]
Don't compute LastPrivate data for Def::Err.

8 years agoAdd check on find_best_match_for_name and improve help message for undefined macro
ggomez [Tue, 16 Feb 2016 13:47:37 +0000 (14:47 +0100)]
Add check on find_best_match_for_name and improve help message for undefined macro

8 years agoAuto merge of #31534 - jseyfried:restrict_noninline_mod, r=nikomatsakis
bors [Tue, 16 Feb 2016 19:34:57 +0000 (19:34 +0000)]
Auto merge of #31534 - jseyfried:restrict_noninline_mod, r=nikomatsakis

This PR disallows non-inline modules without path annotations that are either in a block or in an inline module whose containing file is not a directory owner (fixes #29765).
This is a [breaking-change].
r? @nikomatsakis

8 years agoAuto merge of #30714 - wesleywiser:fix_29914, r=arielb1
bors [Tue, 16 Feb 2016 17:13:46 +0000 (17:13 +0000)]
Auto merge of #30714 - wesleywiser:fix_29914, r=arielb1

The issue was that the const evaluator was returning an error because
the feature flag const_indexing wasn't turned on. The error was then
reported as a bug.

Fixes #29914

8 years agoAuto merge of #31678 - JohanLorenzo:follow-up-31368, r=alexcrichton
bors [Tue, 16 Feb 2016 15:12:40 +0000 (15:12 +0000)]
Auto merge of #31678 - JohanLorenzo:follow-up-31368, r=alexcrichton

Thanks for catching this @tamird. Here's a quick fix. I didn't pick "let the linker link dead code" or "link dead code" because it would add no extra information to the flag name. Here's a another proposal.

r? @alexcrichton

8 years agoAuto merge of #31675 - pitdicker:fs_metadata, r=alexcrichton
bors [Tue, 16 Feb 2016 13:09:55 +0000 (13:09 +0000)]
Auto merge of #31675 - pitdicker:fs_metadata, r=alexcrichton

Because we no longer use `GetFileAttributesExW` FileAttr is never created directly from `WIN32_FILE_ATTRIBUTE_DATA` anymore. So we should no longer store FileAttr's attributes in that c struct.

r? @alexcrichton
Is this what you had in mind?

8 years agoFix links in release notes 1.7.0
Wangshan Lu [Tue, 16 Feb 2016 11:40:06 +0000 (19:40 +0800)]
Fix links in release notes 1.7.0

8 years agoAuto merge of #31672 - semarie:rmake-cxx, r=alexcrichton
bors [Tue, 16 Feb 2016 11:10:30 +0000 (11:10 +0000)]
Auto merge of #31672 - semarie:rmake-cxx, r=alexcrichton

use CXX value found at configure time inside run-make tests.

it permits OpenBSD to pass llvm-module-pass test (which use CXX
variable).

r? @alexcrichton

8 years agoAuto merge of #31669 - frewsxcv:llvm-function-pass-rmake-test, r=alexcrichton
bors [Tue, 16 Feb 2016 09:07:37 +0000 (09:07 +0000)]
Auto merge of #31669 - frewsxcv:llvm-function-pass-rmake-test, r=alexcrichton

Part of https://github.com/rust-lang/rust/issues/31185.

Similar to https://github.com/rust-lang/rust/pull/31391.

8 years agoAuto merge of #31668 - cuviper:lfs, r=alexcrichton
bors [Tue, 16 Feb 2016 07:01:34 +0000 (07:01 +0000)]
Auto merge of #31668 - cuviper:lfs, r=alexcrichton

This follows the pattern already used for stat functions from #31551.  Now
`ftruncate`, `lseek`, and `readdir_r` use their explicit 64-bit variants for
LFS support, using wider `off_t` and `dirent` types.  This also updates to
`open64`, which uses no different types but implies the `O_LARGEFILE` flag.

Non-Linux platforms just map their normal functions to the 64-bit names.

r? @alexcrichton

8 years agopass CXX to run-make
Sébastien Marie [Mon, 15 Feb 2016 08:35:30 +0000 (09:35 +0100)]
pass CXX to run-make

use CXX value found at configure time inside run-make tests.

it permits OpenBSD to pass llvm-module-pass test (which use CXX
variable).

8 years agoAuto merge of #31627 - KiChjang:unstable-lint, r=alexcrichton
bors [Tue, 16 Feb 2016 05:16:55 +0000 (05:16 +0000)]
Auto merge of #31627 - KiChjang:unstable-lint, r=alexcrichton

Fixes #31122.

8 years agoAuto merge of #31639 - quodlibetor:doc-search-with-unknown-types, r=alexcrichton
bors [Tue, 16 Feb 2016 03:03:35 +0000 (03:03 +0000)]
Auto merge of #31639 - quodlibetor:doc-search-with-unknown-types, r=alexcrichton

This enables `*` in all type positions in doc searches, which I often
want in order to find functions that create or convert specific
types (e.g. `* -> vec`) but I don't actually know what kinds of input
they expect.

I actually started working on this because of #31598, but I've wanted it
several times when exploring new crates.

8 years agoclarify how insert() doesn't update keys
Jack O'Connor [Sat, 30 Jan 2016 18:44:45 +0000 (13:44 -0500)]
clarify how insert() doesn't update keys

The first time I read the docs for `insert()`, I thought it was saying
it didn't update existing *values*, and I was confused. Reword the docs
to make it clear that `insert()` does update values.

8 years agocorrect the primitive char doc's use of bytes and code points
Jack O'Connor [Tue, 16 Feb 2016 01:18:16 +0000 (20:18 -0500)]
correct the primitive char doc's use of bytes and code points

Previously the docs suggested that '❤️' doesn't fit in a char because
it's 6 bytes. But that's misleading. 'a̚' also doesn't fit in a char,
even though it's only 3 bytes. The important thing is the number of code
points, not the number of bytes. Clarify the primitive char docs around
this.

8 years agoAuto merge of #31646 - Manishearth:rollup, r=Manishearth
bors [Mon, 15 Feb 2016 22:41:02 +0000 (22:41 +0000)]
Auto merge of #31646 - Manishearth:rollup, r=Manishearth

- Successful merges: #31551, #31581, #31614, #31626, #31632, #31642
- Failed merges:

8 years agoFix wrong help message left in #31368
Johan Lorenzo [Mon, 15 Feb 2016 16:44:06 +0000 (17:44 +0100)]
Fix wrong help message left in #31368

8 years agoClarify contiguous memory array structure of vectors in documentation
Dirk Gadsden [Mon, 15 Feb 2016 01:00:46 +0000 (17:00 -0800)]
Clarify contiguous memory array structure of vectors in documentation

Closes #31554.

Contributes to #29380.

8 years agodoc pages: add the ability to search unknown types
Brandon W Maister [Sat, 13 Feb 2016 20:11:08 +0000 (15:11 -0500)]
doc pages: add the ability to search unknown types

This enables `*` in all type positions in doc searches, which I often
want in order to find functions that create or convert specific
types (e.g. `* -> vec`) but I don't actually know what kinds of input
they expect.

I actually started working on this because of #31598, but I've wanted it
several times when exploring new crates.

8 years agoAdd lint to check that all crates have #![unstable]
Keith Yeung [Sat, 13 Feb 2016 11:44:40 +0000 (06:44 -0500)]
Add lint to check that all crates have #![unstable]

8 years agoSplit PatKind::Enum into PatKind::TupleStruct and PatKind::Path
Vadim Petrochenkov [Mon, 15 Feb 2016 21:40:38 +0000 (00:40 +0300)]
Split PatKind::Enum into PatKind::TupleStruct and PatKind::Path

8 years agoAuto merge of #31530 - dirk:dirk/restrict-matching-of-cfg-opts, r=alexcrichton
bors [Mon, 15 Feb 2016 19:30:37 +0000 (19:30 +0000)]
Auto merge of #31530 - dirk:dirk/restrict-matching-of-cfg-opts, r=alexcrichton

Fixes #31497.

8 years agoAuto merge of #31663 - nodakai:cleanup-uint_module, r=alexcrichton
bors [Mon, 15 Feb 2016 17:33:09 +0000 (17:33 +0000)]
Auto merge of #31663 - nodakai:cleanup-uint_module, r=alexcrichton

8 years agouse stalled_on in all obligation types
Ariel Ben-Yehuda [Mon, 15 Feb 2016 17:08:53 +0000 (19:08 +0200)]
use stalled_on in all obligation types

this improves typeck performance by 5% (LLVM times are still huge).

Basically fixes #25916 (still O(n^2), but the example takes <1s to
compile).

8 years agoGlobal error explanations improvements
ggomez [Mon, 15 Feb 2016 16:57:21 +0000 (17:57 +0100)]
Global error explanations improvements

8 years agoFix wrong help message left in #31368
Johan Lorenzo [Mon, 15 Feb 2016 16:44:06 +0000 (17:44 +0100)]
Fix wrong help message left in #31368

8 years agoAdd LLVM FunctionPass regression test using run-make.
Corey Farwell [Mon, 15 Feb 2016 03:57:43 +0000 (22:57 -0500)]
Add LLVM FunctionPass regression test using run-make.

Part of https://github.com/rust-lang/rust/issues/31185.

Similar to https://github.com/rust-lang/rust/pull/31391.

8 years agoAuto merge of #31656 - jonas-schievink:mirdump, r=nrc
bors [Mon, 15 Feb 2016 14:57:44 +0000 (14:57 +0000)]
Auto merge of #31656 - jonas-schievink:mirdump, r=nrc

This allows obtaining a textual MIR dump for individual items or all items in the crate.

I haven't added any tests since ~~I'm too lazy~~ this is an unstable debugging option, but I'll add one if required.

MIR for a single function can now be dumped using `rustc -Zunstable-options --unpretty mir=my_function` and no longer requires the use of in-source `#[rustc_mir]` attributes.

Blocks rust-lang/rust-playpen#154 (if MIR dump support from the playpen is even wanted).

Example output:
```rust
fn main() {
    let x = Some(0);
    x.unwrap_or_else(|| 1);
}
```

```
MIR for expr || 1 (id=16)
fn(arg0: [closure@test.rs:3:22: 3:26]) -> i32 {
    let mut tmp0: ();

    bb0: {
        return = const 1;
        goto -> bb1;
    }

    bb1: {
        return;
    }
}
MIR for fn main::main (id=4)
fn() -> () {
    let var0: core::option::Option<i32>; // x
    let mut tmp0: ();
    let mut tmp1: i32;
    let mut tmp2: core::option::Option<i32>;
    let mut tmp3: [closure@test.rs:3:22: 3:26];

    bb0: {
        var0 = core::option::Option::Some(const 0);
        tmp2 = var0;
        tmp3 = [closure@test.rs:3:22: 3:26];
        tmp1 = core::option::Option<T>::unwrap_or_else(tmp2, tmp3) -> bb2;
    }

    bb1: {
        return;
    }

    bb2: {
        drop(tmp1) -> bb3;
    }

    bb3: {
        return = ();
        goto -> bb1;
    }
}
```

8 years agoAuto merge of #31640 - rkruppe:require-py27, r=sanxiyn
bors [Mon, 15 Feb 2016 13:04:00 +0000 (13:04 +0000)]
Auto merge of #31640 - rkruppe:require-py27, r=sanxiyn

In other words, enforce what was documented in #30626 (and also stop blaming it on LLVM, we have at least one Python script of our own).

Also, there is no Python later than 2.7 and there never will be.

8 years agoRefactor windows::fs::FileAttr
Paul Dicker [Mon, 15 Feb 2016 11:43:30 +0000 (12:43 +0100)]
Refactor windows::fs::FileAttr
Because we no longer use `GetFileAttributesExW` FileAttr is never created
directly from `WIN32_FILE_ATTRIBUTE_DATA` anymore.
So we should no longer store FileAttr's attributes in that c struct.

8 years agoAuto merge of #31653 - tomaka:emscripten-abi, r=eddyb
bors [Mon, 15 Feb 2016 11:07:02 +0000 (11:07 +0000)]
Auto merge of #31653 - tomaka:emscripten-abi, r=eddyb

Needs a correct review because I'm not too confident with how this works.
All tests related to the C ABI are now passing.

References:
- https://github.com/kripken/emscripten-fastcomp-clang/blob/dbe68fecd03d6f646bd075963c3cc0e7130e5767/lib/CodeGen/TargetInfo.cpp#L479-L489
- https://github.com/kripken/emscripten-fastcomp-clang/blob/dbe68fecd03d6f646bd075963c3cc0e7130e5767/lib/CodeGen/TargetInfo.cpp#L466-L477

The `classifyArgumentType` function has two different paths depending on `RAA == CGCXXABI::RAA_DirectInMemory`, but I don't really know what's the corresponding option in Rust.

cc @brson @eddyb

8 years agoAuto merge of #31652 - semarie:openbsd-os-raw, r=alexcrichton
bors [Mon, 15 Feb 2016 09:10:52 +0000 (09:10 +0000)]
Auto merge of #31652 - semarie:openbsd-os-raw, r=alexcrichton

remove unused import that cause an error at compile-time.

r? @alexcrichton

8 years agoAuto merge of #31648 - jseyfried:fix_diagnostics, r=nrc
bors [Mon, 15 Feb 2016 07:13:02 +0000 (07:13 +0000)]
Auto merge of #31648 - jseyfried:fix_diagnostics, r=nrc

This PR fixes two unrelated diagnostics bugs in resolve.

First, it reports privacy errors for an import only after the import resolution is determined, fixing #31402.

Second, it expands the per-module map from block ids to anonymous modules so that it also maps module declarations ids to modules, and it uses this map to in `with_scope` to fix #31644.

r? @nrc

8 years agoRename `error-index-generator` to `error_index_generator`
Dirk Gadsden [Mon, 15 Feb 2016 06:26:37 +0000 (22:26 -0800)]
Rename `error-index-generator` to `error_index_generator`

This is because the tool compiler passes the name of the tool
as a command line `--cfg`. The improved session config parser
is stricter and no longer permits invalid meta items (such as
"error-index-generator").

8 years agoAdd lint to check that all crates have #![unstable]
Keith Yeung [Sat, 13 Feb 2016 11:44:40 +0000 (06:44 -0500)]
Add lint to check that all crates have #![unstable]

8 years agoAuto merge of #31566 - jseyfried:fix_regression, r=nrc
bors [Mon, 15 Feb 2016 05:19:29 +0000 (05:19 +0000)]
Auto merge of #31566 - jseyfried:fix_regression, r=nrc

This fixes a regression caused by #31461 allowing extern crates to be glob imported, and it fixes the test that was supposed to catch it.
r? @nrc

8 years agoAuto merge of #31555 - nrc:err-recover, r=pnkfelix
bors [Mon, 15 Feb 2016 03:17:35 +0000 (03:17 +0000)]
Auto merge of #31555 - nrc:err-recover, r=pnkfelix

Recover from missing brackets in the parser

8 years agostd: use LFS open64 on Linux
Josh Stone [Mon, 15 Feb 2016 00:27:18 +0000 (16:27 -0800)]
std: use LFS open64 on Linux

8 years agostd: use LFS readdir64_r on Linux
Josh Stone [Mon, 15 Feb 2016 00:24:02 +0000 (16:24 -0800)]
std: use LFS readdir64_r on Linux

8 years agostd: use LFS lseek64 on Linux
Josh Stone [Mon, 15 Feb 2016 00:15:39 +0000 (16:15 -0800)]
std: use LFS lseek64 on Linux

8 years agostd: use LFS ftruncate64 on Linux
Josh Stone [Mon, 15 Feb 2016 00:09:57 +0000 (16:09 -0800)]
std: use LFS ftruncate64 on Linux

8 years agoClarify contiguous memory array structure of vectors in documentation
Dirk Gadsden [Mon, 15 Feb 2016 01:00:46 +0000 (17:00 -0800)]
Clarify contiguous memory array structure of vectors in documentation

Closes #31554.

Contributes to #29380.

8 years agoStricter matching of `--cfg` options on rustc
Dirk Gadsden [Wed, 10 Feb 2016 06:48:47 +0000 (22:48 -0800)]
Stricter matching of `--cfg` options on rustc

Includes compile-fail test to check that it fails on incomplete
`--cfg` matches.

Fixes #31497.

8 years agoRebasing
Nick Cameron [Mon, 15 Feb 2016 00:14:31 +0000 (13:14 +1300)]
Rebasing

8 years agolibcore/num: Remove unused macro argument.
NODA, Kai [Sun, 14 Feb 2016 23:34:02 +0000 (07:34 +0800)]
libcore/num: Remove unused macro argument.

It is no longer necessary after dd0d495f50e2d8ba501e6b003cb4c1ef52d95ed5

Signed-off-by: NODA, Kai <nodakai@gmail.com>
8 years agoAuto merge of #31661 - steveklabnik:rollup, r=steveklabnik
bors [Sun, 14 Feb 2016 23:18:00 +0000 (23:18 +0000)]
Auto merge of #31661 - steveklabnik:rollup, r=steveklabnik

- Successful merges: #31607, #31649, #31655, #31658
- Failed merges:

8 years agoRollup merge of #31658 - felgru:master, r=steveklabnik
Steve Klabnik [Sun, 14 Feb 2016 23:02:32 +0000 (18:02 -0500)]
Rollup merge of #31658 - felgru:master, r=steveklabnik

In the Rust code above this block of compiler output, the function is called print_sum, so use the same function name in the error message.

8 years agoRollup merge of #31655 - ollie27:patch-4, r=steveklabnik
Steve Klabnik [Sun, 14 Feb 2016 23:02:32 +0000 (18:02 -0500)]
Rollup merge of #31655 - ollie27:patch-4, r=steveklabnik

r? @steveklabnik

8 years agoRollup merge of #31649 - fbergr:doc, r=steveklabnik
Steve Klabnik [Sun, 14 Feb 2016 23:02:32 +0000 (18:02 -0500)]
Rollup merge of #31649 - fbergr:doc, r=steveklabnik

8 years agoRollup merge of #31607 - steveklabnik:gh31599, r=brson
Steve Klabnik [Sun, 14 Feb 2016 23:02:32 +0000 (18:02 -0500)]
Rollup merge of #31607 - steveklabnik:gh31599, r=brson

Fixes #31599

8 years agoAuto merge of #31460 - alexcrichton:supafast-rustc, r=brson
bors [Sun, 14 Feb 2016 21:24:45 +0000 (21:24 +0000)]
Auto merge of #31460 - alexcrichton:supafast-rustc, r=brson

Looking at some profiles of rustc recently, these seemed like two pretty easy wins we could get in terms of performance on the table.

8 years agoTests
Nick Cameron [Thu, 11 Feb 2016 01:50:19 +0000 (14:50 +1300)]
Tests

8 years agoSome error recovery in the parser
Nick Cameron [Wed, 10 Feb 2016 03:11:27 +0000 (16:11 +1300)]
Some error recovery in the parser

8 years agoAdd some simple error recovery to the parser and fix tests
Nick Cameron [Sun, 31 Jan 2016 19:39:50 +0000 (08:39 +1300)]
Add some simple error recovery to the parser and fix tests

Some tests just add the extra errors, others I fix by doing some simple error recovery. I've tried to avoid doing too much in the hope of doing something more principled later.

In general error messages are getting worse at this stage, but I think in the long run they will get better.

8 years agoerror correction for missing or mismatched closing brackets
Nick Cameron [Fri, 29 Jan 2016 04:49:59 +0000 (17:49 +1300)]
error correction for missing or mismatched closing brackets

8 years agorefactoring: inline some function in the parser
Nick Cameron [Fri, 29 Jan 2016 01:57:58 +0000 (14:57 +1300)]
refactoring: inline some function in the parser

8 years agostd: Stop prefixing jemalloc symbols
Alex Crichton [Sun, 7 Feb 2016 06:54:35 +0000 (22:54 -0800)]
std: Stop prefixing jemalloc symbols

Now that we properly only link in jemalloc when building executables, we have
far less to worry about in terms of polluting the global namespace with the
`free` and `malloc` symbols on Linux. This commit will primarily allow LLVM to
use jemalloc so the compiler will only be using one allocator overall.

Locally this took compile time for libsyntax from 95 seconds to 89 (a 6%
improvement).

8 years agodoc: fix compiler output
Felix Gruber [Sun, 14 Feb 2016 19:50:12 +0000 (20:50 +0100)]
doc: fix compiler output

In the Rust code above, the function is called print_sum, so use the
same function name in the error message.

8 years agotrans: Don't link whole rlibs to executables
Alex Crichton [Thu, 11 Feb 2016 19:06:31 +0000 (11:06 -0800)]
trans: Don't link whole rlibs to executables

Back in 9bc8e6d14 the linking of rlibs changed to using the `link_whole_rlib`
function. This change, however was only intended to affect dylibs, not
executables. For executables we don't actually want to link entire rlibs because
we want the linker to strip out as much as possible.

This commit adds a conditional to this logic to only link entire rlibs if we're
creating a dylib, and otherwise an executable just links an rlib as usual. A
test is included which will fail to link if this behavior is reverted.

8 years agorustc: Ensure FNV hashing is inlined across crates
Alex Crichton [Sun, 7 Feb 2016 06:56:25 +0000 (22:56 -0800)]
rustc: Ensure FNV hashing is inlined across crates

Right now the primary hashing algorithm of the compiler isn't actually inlined
across crates, meaning that it may be missing out on some crucial optimizations
in a few places (perhaps unrolling smaller loops, etc).

This commit made the hashing function disappear from a profiled version of the
compiler, but that's likely because it was just inlined elsewhere. When
compiling winapi, however, this decreased compile time from 18.3 to 17.8 seconds
(a 3% improvement).

8 years agoAuto merge of #31630 - pitdicker:read_link, r=alexcrichton
bors [Sun, 14 Feb 2016 19:42:42 +0000 (19:42 +0000)]
Auto merge of #31630 - pitdicker:read_link, r=alexcrichton

8 years agoFix a couple of issues in from_utf8 docs
Oliver Middleton [Sun, 14 Feb 2016 18:38:37 +0000 (18:38 +0000)]
Fix a couple of issues in from_utf8 docs

8 years agoImplement --unpretty mir
Jonas Schievink [Sun, 14 Feb 2016 18:23:05 +0000 (19:23 +0100)]
Implement --unpretty mir

8 years agoAuto merge of #31642 - rkruppe:rm-regex-script, r=alexcrichton
bors [Sun, 14 Feb 2016 18:00:53 +0000 (18:00 +0000)]
Auto merge of #31642 - rkruppe:rm-regex-script, r=alexcrichton

This file was probably forgotten when libregex moved out of tree. The rust-lang-nursery/regex repo has a nigh-identical file in its script/ folder.

8 years agoFix doc error for Utf8Error
Oliver Middleton [Sun, 14 Feb 2016 17:52:05 +0000 (17:52 +0000)]
Fix doc error for Utf8Error

8 years agoFix signed int checked_neg docs
Oliver Middleton [Sun, 14 Feb 2016 17:44:22 +0000 (17:44 +0000)]
Fix signed int checked_neg docs

8 years agoFix the asmjs ABI
Pierre Krieger [Sun, 14 Feb 2016 16:07:44 +0000 (17:07 +0100)]
Fix the asmjs ABI

8 years agoAuto merge of #31651 - eddyb:fix-26978, r=arielb1
bors [Sun, 14 Feb 2016 16:18:48 +0000 (16:18 +0000)]
Auto merge of #31651 - eddyb:fix-26978, r=arielb1

Handles `str` being an expression's expected type, which was missing from #20083.
Fixes #26978.

8 years agoDo not expect blocks to have type str.
Eduard Burtescu [Sun, 14 Feb 2016 13:38:48 +0000 (15:38 +0200)]
Do not expect blocks to have type str.

8 years agoRemove incorrect documentation
Steve Klabnik [Fri, 12 Feb 2016 16:55:31 +0000 (11:55 -0500)]
Remove incorrect documentation

Fixes #31599

8 years agodoc: Remove trailing whitespace
fbergr [Sun, 14 Feb 2016 12:31:20 +0000 (14:31 +0200)]
doc: Remove trailing whitespace

8 years agoRename hir::Pat_ and its variants
Vadim Petrochenkov [Sun, 14 Feb 2016 12:25:12 +0000 (15:25 +0300)]
Rename hir::Pat_ and its variants

8 years agoAuto merge of #31626 - mitaa:rdoc-srch-escape, r=alexcrichton
bors [Sun, 14 Feb 2016 12:13:58 +0000 (12:13 +0000)]
Auto merge of #31626 - mitaa:rdoc-srch-escape, r=alexcrichton

Maybe they should be Markdown rendered instead, though that doesn't really seem to work all that well.

fixes #31059

r? @alexcrichton

8 years agopolish `std::os::*::raw` deprecation on openbsd
Sébastien Marie [Sun, 14 Feb 2016 11:03:46 +0000 (12:03 +0100)]
polish `std::os::*::raw` deprecation on openbsd

remove unused import that cause an error at compile-time.

8 years agoAuto merge of #31614 - mitaa:rdoc_locitem_extmac, r=alexcrichton
bors [Sun, 14 Feb 2016 10:10:50 +0000 (10:10 +0000)]
Auto merge of #31614 - mitaa:rdoc_locitem_extmac, r=alexcrichton

fixes #26606

r? @alexcrichton

8 years agoRename Module field anonymous_children to module_children, expand it to include both...
Jeffrey Seyfried [Sat, 13 Feb 2016 23:39:51 +0000 (23:39 +0000)]
Rename Module field anonymous_children to module_children, expand it to include both named an anonymous modules, and fix #31644

8 years agoRename Module field children to resolutions
Jeffrey Seyfried [Sun, 14 Feb 2016 08:46:54 +0000 (08:46 +0000)]
Rename Module field children to resolutions

8 years agoAuto merge of #31391 - frewsxcv:test, r=alexcrichton
bors [Sun, 14 Feb 2016 08:25:39 +0000 (08:25 +0000)]
Auto merge of #31391 - frewsxcv:test, r=alexcrichton

Part of #31185

8 years agoAuto merge of #31581 - petrochenkov:patrefact, r=Manishearth
bors [Sun, 14 Feb 2016 06:18:10 +0000 (06:18 +0000)]
Auto merge of #31581 - petrochenkov:patrefact, r=Manishearth

cc https://github.com/rust-lang/rust/pull/31487#issuecomment-182945101
plugin-[breaking-change]

The first commit renames `ast::Pat_` to `ast::PatKind` and uses its variants in enum qualified form. I've also taken the opportunity and renamed `PatKind::Region` into `PatKind::Ref`.

The second commit splits `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::UnitStruct`.
So, pattern kinds now correspond to their struct/variant kinds - `Struct`, `TupleStruct` and `UnitStruct`.
@nikomatsakis @nrc @arielb1 Are you okay with this naming scheme?
An alternative possible naming scheme is `PatKind::StructVariant`, `PatKind::TupleVariant`, `PatKind::UnitVariant` (it's probably closer to the common use, but I like it less).

I intend to apply these changes to HIR later, they should not necessarily go in the same nightly with https://github.com/rust-lang/rust/pull/31487
r? @Manishearth

8 years agoAdd LLVM ModulePass regression test using run-make.
Corey Farwell [Tue, 2 Feb 2016 04:46:02 +0000 (23:46 -0500)]
Add LLVM ModulePass regression test using run-make.

Part of #31185

8 years agoAuto merge of #31551 - alexcrichton:deprecate-std-os-raw, r=brson
bors [Sun, 14 Feb 2016 02:17:38 +0000 (02:17 +0000)]
Auto merge of #31551 - alexcrichton:deprecate-std-os-raw, r=brson

This commit is an implementation of [RFC 1415][rfc] which deprecates all types
in the `std::os::*::raw` modules.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1415-trim-std-os.md

Many of the types in these modules don't actually have a canonical platform
representation, for example the definition of `stat` on 32-bit Linux will change
depending on whether C code is compiled with LFS support or not. Unfortunately
the current types in `std::os::*::raw` are billed as "compatible with C", which
in light of this means it isn't really possible.

To make matters worse, platforms like Android sometimes define these types as
*smaller* than the way they're actually represented in the `stat` structure
itself. This means that when methods like `DirEntry::ino` are called on Android
the result may be truncated as we're tied to returning a `ino_t` type, not the
underlying type.

The commit here incorporates two backwards-compatible components:

* Deprecate all `raw` types that aren't in `std::os::raw`
* Expand the `std::os::*::fs::MetadataExt` trait on all platforms for method
  accessors of all fields. The fields now returned widened types which are the
  same across platforms (consistency across platforms is not required, however,
  it's just convenient).

and two also backwards-incompatible components:

* Change the definition of all `std::os::*::raw` type aliases to
  correspond to the newly widened types that are being returned on each
  platform.
* Change the definition of `std::os::*::raw::stat` on Linux to match the LFS
  definitions rather than the standard ones.

The breaking changes here will specifically break code that assumes that `libc`
and `std` agree on the definition of `std::os::*::raw` types, or that the `std`
types are faithful representations of the types in C. An [audit] has been
performed of crates.io to determine the fallout which was determined two be
minimal, with the two found cases of breakage having been fixed now.

[audit]: https://github.com/rust-lang/rfcs/pull/1415#issuecomment-180645582

---

Ok, so after all that, we're finally able to support LFS on Linux! This commit
then simultaneously starts using `stat64` and friends on Linux to ensure that we
can open >4GB files on 32-bit Linux. Yay!

Closes #28978
Closes #30050
Closes #31549

8 years agoAuto merge of #31643 - Manishearth:rollup, r=Manishearth
bors [Sat, 13 Feb 2016 23:37:10 +0000 (23:37 +0000)]
Auto merge of #31643 - Manishearth:rollup, r=Manishearth

- Successful merges: #31535, #31537, #31542, #31559, #31563, #31582, #31584, #31585, #31589, #31607, #31609, #31610, #31612, #31629, #31635, #31637, #31638
- Failed merges:

8 years agoRollup merge of #31638 - rkruppe:rm-tex, r=alexcrichton
Manish Goregaokar [Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)]
Rollup merge of #31638 - rkruppe:rm-tex, r=alexcrichton

This file is unused since #27789

8 years agoRollup merge of #31637 - rkruppe:ignore-pdb, r=alexcrichton
Manish Goregaokar [Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)]
Rollup merge of #31637 - rkruppe:ignore-pdb, r=alexcrichton

8 years agoRollup merge of #31635 - semarie:grep-e, r=alexcrichton
Manish Goregaokar [Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)]
Rollup merge of #31635 - semarie:grep-e, r=alexcrichton

The BSD grep for "basic regex" don't support \| as alternate operator (at least under OpenBSD).

Use multiple -e arguments for expressing alternative. I have checked it under Linux (Debian).

8 years agoRollup merge of #31629 - petevine:master, r=alexcrichton
Manish Goregaokar [Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)]
Rollup merge of #31629 - petevine:master, r=alexcrichton

This PR should make it easier to create a baseline x86 compiler  as well as make cross-compilation possible through a separate set of rlibs.

Plus, a few Linux distributions (e.g. Debian) have voiced interest in having this target available.

8 years agoRollup merge of #31612 - raindev:grammar, r=steveklabnik
Manish Goregaokar [Sat, 13 Feb 2016 22:29:11 +0000 (03:59 +0530)]
Rollup merge of #31612 - raindev:grammar, r=steveklabnik

I feel sorry for bothering you with such a literally one character changes. If it is counter productive feel free to point it out in the comments, that would be totally understandable. I could try to pack such a changes together in one PR to make them less distractive.

r? @steveklabnik

8 years agoRollup merge of #31610 - Manishearth:doc-clarify-txrx, r=steveklabnik
Manish Goregaokar [Sat, 13 Feb 2016 22:29:10 +0000 (03:59 +0530)]
Rollup merge of #31610 - Manishearth:doc-clarify-txrx, r=steveklabnik

Not everyone knows this convention. We could just rename the variables in the
example, but since this notation is commonly used it's a good opportunity to
introduce it.

r? @steveklabnik

8 years agoRollup merge of #31609 - erickt:nit, r=sfackler
Manish Goregaokar [Sat, 13 Feb 2016 22:29:10 +0000 (03:59 +0530)]
Rollup merge of #31609 - erickt:nit, r=sfackler

8 years agoRollup merge of #31589 - reem:remove-unnecessary-poison-bounds, r=sfackler
Manish Goregaokar [Sat, 13 Feb 2016 22:29:10 +0000 (03:59 +0530)]
Rollup merge of #31589 - reem:remove-unnecessary-poison-bounds, r=sfackler

None