Commit Graph

50526 Commits

Author SHA1 Message Date
ggomez
1c8766761e Global error explanations improvements 2016-02-15 17:57:21 +01:00
Johan Lorenzo
040cbc4566 Fix wrong help message left in #31368 2016-02-15 17:44:06 +01:00
Corey Farwell
a60ec05fdc 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.
2016-02-15 10:08:04 -05:00
bors
7ce4afbdda 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;
    }
}
```
2016-02-15 14:57:44 +00:00
bors
3a254fe4bd 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.
2016-02-15 13:04:00 +00:00
Paul Dicker
44e31b91ad 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.
2016-02-15 12:43:30 +01:00
bors
9a7913786c 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:
- dbe68fecd0/lib/CodeGen/TargetInfo.cpp (L479-L489)
- dbe68fecd0/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
2016-02-15 11:07:02 +00:00
bors
5ba94028ac Auto merge of #31652 - semarie:openbsd-os-raw, r=alexcrichton
remove unused import that cause an error at compile-time.

r? @alexcrichton
2016-02-15 09:10:52 +00:00
bors
4ce803837e 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
2016-02-15 07:13:02 +00:00
Dirk Gadsden
2766e254b1 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").
2016-02-14 22:29:45 -08:00
Keith Yeung
6f092c83dd Add lint to check that all crates have #![unstable] 2016-02-15 01:09:42 -05:00
bors
69ad91290d 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
2016-02-15 05:19:29 +00:00
bors
f9543a9b74 Auto merge of #31555 - nrc:err-recover, r=pnkfelix
Recover from missing brackets in the parser
2016-02-15 03:17:35 +00:00
Josh Stone
c84ab39635 std: use LFS open64 on Linux 2016-02-14 19:11:39 -08:00
Josh Stone
8f2d7d956c std: use LFS readdir64_r on Linux 2016-02-14 19:11:39 -08:00
Josh Stone
dcdfed49d7 std: use LFS lseek64 on Linux 2016-02-14 19:11:39 -08:00
Josh Stone
1ea38f8928 std: use LFS ftruncate64 on Linux 2016-02-14 19:11:39 -08:00
Dirk Gadsden
f9fe6585dc Clarify contiguous memory array structure of vectors in documentation
Closes #31554.

Contributes to #29380.
2016-02-14 17:10:18 -08:00
Dirk Gadsden
b122064a33 Stricter matching of --cfg options on rustc
Includes compile-fail test to check that it fails on incomplete
`--cfg` matches.

Fixes #31497.
2016-02-14 16:44:39 -08:00
Nick Cameron
73a8513b88 Rebasing 2016-02-15 13:14:31 +13:00
NODA, Kai
e03cea40e8
libcore/num: Remove unused macro argument.
It is no longer necessary after dd0d495f50

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2016-02-15 07:44:32 +08:00
bors
2808df961b Auto merge of #31661 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #31607, #31649, #31655, #31658
- Failed merges:
2016-02-14 23:18:00 +00:00
Steve Klabnik
fb09a441c6 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.
2016-02-14 18:02:32 -05:00
Steve Klabnik
c244acceb4 Rollup merge of #31655 - ollie27:patch-4, r=steveklabnik
r? @steveklabnik
2016-02-14 18:02:32 -05:00
Steve Klabnik
6ba5d9cfd5 Rollup merge of #31649 - fbergr:doc, r=steveklabnik 2016-02-14 18:02:32 -05:00
Steve Klabnik
c49edbc5ee Rollup merge of #31607 - steveklabnik:gh31599, r=brson
Fixes #31599
2016-02-14 18:02:32 -05:00
bors
a888333ea6 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.
2016-02-14 21:24:45 +00:00
Nick Cameron
4e1a6f6b36 Tests 2016-02-15 09:33:21 +13:00
Nick Cameron
847a0d2150 Some error recovery in the parser 2016-02-15 09:33:21 +13:00
Nick Cameron
ffd2a0b9d7 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.
2016-02-15 09:30:23 +13:00
Nick Cameron
0ef9c5f585 error correction for missing or mismatched closing brackets 2016-02-15 09:30:23 +13:00
Nick Cameron
36a9f0cff1 refactoring: inline some function in the parser 2016-02-15 09:30:23 +13:00
Alex Crichton
e3b414d861 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).
2016-02-14 11:50:40 -08:00
Felix Gruber
3eebec697c 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.
2016-02-14 20:50:12 +01:00
Alex Crichton
cc719d2d7d 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.
2016-02-14 11:45:59 -08:00
Alex Crichton
12a68e6af3 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).
2016-02-14 11:45:59 -08:00
bors
9b367d9d8b Auto merge of #31630 - pitdicker:read_link, r=alexcrichton 2016-02-14 19:42:42 +00:00
Oliver Middleton
9673ace339 Fix a couple of issues in from_utf8 docs 2016-02-14 18:38:37 +00:00
Jonas Schievink
67aa7b2389 Implement --unpretty mir 2016-02-14 19:23:05 +01:00
bors
58eed9266a 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.
2016-02-14 18:00:53 +00:00
Oliver Middleton
bc8495abd8 Fix doc error for Utf8Error 2016-02-14 17:52:05 +00:00
Oliver Middleton
36c00f8107 Fix signed int checked_neg docs 2016-02-14 17:44:22 +00:00
Pierre Krieger
5b224ec94d Fix the asmjs ABI 2016-02-14 17:25:49 +01:00
bors
004c4b4b7d Auto merge of #31651 - eddyb:fix-26978, r=arielb1
Handles `str` being an expression's expected type, which was missing from #20083.
Fixes #26978.
2016-02-14 16:18:48 +00:00
Eduard Burtescu
5d0a68d1d3 Do not expect blocks to have type str. 2016-02-14 15:38:48 +02:00
Steve Klabnik
b499e5a089 Remove incorrect documentation
Fixes #31599
2016-02-14 08:21:32 -05:00
fbergr
310ab5ea74 doc: Remove trailing whitespace 2016-02-14 14:31:20 +02:00
Vadim Petrochenkov
9b40e1e5b3 Rename hir::Pat_ and its variants 2016-02-14 15:25:12 +03:00
bors
f3619ce026 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
2016-02-14 12:13:58 +00:00
Sébastien Marie
3c5f2f71ca polish std::os::*::raw deprecation on openbsd
remove unused import that cause an error at compile-time.
2016-02-14 12:03:46 +01:00