Commit Graph

73909 Commits

Author SHA1 Message Date
John Kåre Alsaker
9a8d6b8bb5 Do not capture stderr in the compiler. Instead just panic silently for fatal errors 2018-01-26 04:52:30 +01:00
John Kåre Alsaker
634f8cc06a Print inlined functions on Windows 2018-01-26 04:49:54 +01:00
Alex Crichton
6e1cebb387 Shorten a filename for MSVC 2018-01-25 18:11:42 -08:00
Josh Stone
a76bb8806a Call non-git beta builds simply x.y.z-beta
We can't use git commands to compute a prerelease version when we're
building from a source tarball, or if git is otherwise unavailable.
We'll just call such builds `x.y.z-beta`, without a prerelease.
2018-01-25 16:22:58 -08:00
Alex Crichton
beb756f2aa Revert update of the i686-freebsd builder
Looks like llvm 4.0.0 isn't read for that either.
2018-01-25 14:53:30 -08:00
Alex Crichton
cd4b23e674 Remove stray src/llvm-emscripten module
Accidentally added in e9a64996b
2018-01-25 13:50:44 -08:00
Alex Crichton
e61c609320 Merge branch 'configure-lto' of https://github.com/alexcrichton/rust into rollup 2018-01-25 13:50:42 -08:00
Alex Crichton
ab623f2dc2 Merge branch 'cache-ty-collect' of https://github.com/michaelwoerister/rust into rollup 2018-01-25 13:50:25 -08:00
Alex Crichton
ad8b3135e1 Rollup merge of #47719 - malbarbo:run-pass-arch-powerpc, r=alexcrichton
Add powerpc to run-pass/conditional-compile-arch.rs
2018-01-25 13:49:56 -08:00
Alex Crichton
2c7cd60b7a Rollup merge of #47711 - alexcrichton:update-compiler-builtins, r=nikomatsakis
Update compiler-builtins submodule

No sense of urgency, just wanted to make sure we don't lag too far behind!
2018-01-25 13:49:55 -08:00
Alex Crichton
8a9381db01 Rollup merge of #47710 - alexcrichton:llvm-6-compat, r=nikomatsakis
First round of LLVM 6.0.0 compatibility

This includes a number of commits for the first round of upgrading to LLVM 6. There are still [lingering bugs](https://github.com/rust-lang/rust/issues/47683) but I believe all of this will nonetheless be necessary!
2018-01-25 13:49:54 -08:00
Alex Crichton
f7706d5816 Rollup merge of #47705 - pietroalbini:fix-47673, r=petrochenkov
Fix ICE when use trees have multiple empty nested groups

The issue was caused by an oversight of mine in the original use_nested_groups PR, where different paths were resolved with the same `NodeId` in some cases (such as in `use {{}, {}};`).

Fixes #47673
r? @petrochenkov
2018-01-25 13:49:53 -08:00
Alex Crichton
b335b10b22 Rollup merge of #47701 - Manishearth:intra-fixes, r=QuietMisdreavus
Fixes for intra-doc-links

Turn errors into warnings, also handle methods, trait items, and variants.

r? @killercup @QuietMisdreavus
2018-01-25 13:49:51 -08:00
Alex Crichton
024e3aaff7 Rollup merge of #47696 - Zoxc:variance-rg, r=nikomatsakis
Make use of the implemented red/green algorithm for variance

r? @michaelwoerister
2018-01-25 13:49:50 -08:00
Alex Crichton
0ee698e4a6 Rollup merge of #47668 - nikomatsakis:issue-47511, r=eddyb
do not ICE when return type includes unconstrained anon region

It turns out that this *can* happen after all, if the region is only
used in projections from the input types.

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

r? @eddyb
2018-01-25 13:49:49 -08:00
Alex Crichton
014931be8e Rollup merge of #47656 - ishitatsuyuki:patch-1, r=nikomatsakis
[perf] Use std based dedup in projection

Unstable sort was added recently, and the code that is being modified is 3 years old. As quicksort doesn't allocate it will likely perform as well as, or better than linear search.

I didn't benchmark. Have a perf run.
2018-01-25 13:49:48 -08:00
Alex Crichton
8dd36af9cb Rollup merge of #47626 - eddyb:one-less-unwrap, r=nagisa
rustc_trans: remove an unwrap by replacing a bool with Result.

Prompted by @shepmaster.
r? @nagisa
2018-01-25 13:49:47 -08:00
Alex Crichton
4856f07bb5 Rollup merge of #47618 - mrhota:dw_at_noreturn, r=michaelwoerister
Teach rustc about DW_AT_noreturn and a few more DIFlags

We achieve two small things with this PR:
1. We provide definitions for a few additional llvm debuginfo flags
1. We _use_ one of these new flags, `FlagNoReturn`, and add it to debuginfo for functions with the never return type (`!`).
2018-01-25 13:49:46 -08:00
Marco A L Barbosa
c199cb5370 Make 3 run-pass tests works on android (aarch64 and x86) 2018-01-25 18:55:11 -02:00
Alex Crichton
502de01ff4 rustc: SIMD types use pointers in Rust's ABI
This commit changes the ABI of SIMD types in the "Rust" ABI to unconditionally
be passed via pointers instead of being passed as immediates. This should fix a
longstanding issue, #44367, where SIMD-using programs ended up showing very odd
behavior at runtime because the ABI between functions was mismatched.

As a bit of a recap, this is sort of an LLVM bug and sort of an LLVM feature
(today's behavior). LLVM will generate code for a function solely looking at the
function it's generating, including calls to other functions. Let's then say
you've got something that looks like:

```llvm
define void @foo() { ; no target features enabled
  call void @bar(<i64 x 4> zeroinitializer)
  ret void
}

define void @bar(<i64 x 4>) #0 { ; enables the AVX feature
  ...
}
```

LLVM will codegen the call to `bar` *without* using AVX registers becauase `foo`
doesn't have access to these registers. Instead it's generated with emulation
that uses two 128-bit registers. The `bar` function, on the other hand, will
expect its argument in an AVX register (as it has AVX enabled). This means we've
got a codegen problem!

Comments on #44367 have some more contexutal information but the crux of the
issue is that if we want SIMD to work in general we'll need to ensure that
whenever a function calls another they ABI of the arguments being passed is in
agreement.

One possible solution to this would be to insert "shim functions" where whenever
a `target_feature` mismatch is detected the compiler inserts a shim function
where you pass arguments via memory to the shim and then the shim loads the
values and calls the target function (where the shim and the target have the
same target features enabled). This unfortunately is quite nontrivial to
implement in rustc today (especially when accounting for function pointers and
such).

This commit takes a different solution, *always* passing SIMD arguments through
memory instead of passing as immediates. This strategy solves the problem at the
LLVM layer because the ABI between two functions never uses SIMD registers. This
also shouldn't be a hit to performance because SIMD performance is thought to
often rely on inlining anyway, where a `call` instruction, even if using SIMD
registers, would be disastrous to performance regardless. LLVM should then be
more than capable of fixing all our memory usage to use registers instead after
enough inlining has been performed.

Note that there's a few caveats to this commit though:

* The "platform intrinsic" ABI is omitted from "always pass via memory". This
  ABI is used to define intrinsics like `simd_shuffle4` where LLVM and rustc
  need to have the arguments as an immediate.

* Additionally this commit does *not* fix the `extern` ("C") ABI. This means
  that the bug in #44367 can still happen when using non-Rust-ABI functions. My
  hope is that before stabilization we can ban and/or warn about SIMD types in
  these functions (as AFAIK there's not much motivation to belong there anyway),
  but I'll leave that for a later commit and if this is merged I'll file a
  follow-up issue.

All in all this...

Closes #44367
2018-01-25 12:05:24 -08:00
Esteban Küber
2b73733496 Add description to field and method 2018-01-25 11:40:33 -08:00
Esteban Küber
6006b67e6e Fix regression: account for impl methods in arg count mismatch error 2018-01-25 10:49:28 -08:00
Alex Crichton
9852b23657 Rollup merge of #47600 - varkor:empty-never-array, r=eddyb
Fix type inhabitedness check for arrays

Arrays of uninhabited types were considered to also be uninhabited if
their length had not been evaluated, causing unsoundness.

Fixes #47563.

r? @eddyb
2018-01-25 12:48:52 -06:00
Alex Crichton
31f1aa5706 Rollup merge of #47529 - nikomatsakis:impl-trait-issue-38064, r=cramertj
track recursion limit when expanding existential impl trait

r? @cramertj
2018-01-25 12:48:51 -06:00
Alex Crichton
98b375483c Rollup merge of #47502 - petrochenkov:label, r=eddyb
AST/HIR: Add a separate structure for labels
2018-01-25 12:48:49 -06:00
Alex Crichton
304885d959 Rollup merge of #47460 - Mark-Simulacrum:bootstrap-check, r=alexcrichton
Add ./x.py check src/{libstd,libtest,librustc}

This currently only supports a limited subset of the full compilation,
but is likely 90% of what people will want and is possible without
building a full compiler (and also building LLVM). In theory, this means
that contributors who don't want to build LLVM now have an easy way to
compile locally, though running tests won't work.
2018-01-25 12:48:48 -06:00
Alex Crichton
1bdef2f8fc Rollup merge of #47453 - pftbest:nointas, r=alexcrichton
Fix no_integrated_as option to work with new codegen architecture.

Old implementation called the assembler once per crate, but we need to call
it for each object file instead, because a single crate can now have more
than one object file.

This patch fixes issue #45836 (Can't compile core for msp430 in release mode)

This change can be tested on x86_64 using
```sh
export RUSTFLAGS="-C no_integrated_as -C save_temps"
```

r? @alexcrichton
cc @japaric
2018-01-25 12:48:47 -06:00
Alex Crichton
6eb1430547 Rollup merge of #47439 - eddyb:issue-45662, r=nagisa
rustc_trans: ignore trailing padding larger than 8 bytes.

Fixes #45662 by ignoring a missing second register component, as it could be entirely padding.
2018-01-25 12:48:46 -06:00
Alex Crichton
fe2fb24228 Rollup merge of #47437 - eddyb:issue-38763, r=nagisa
rustc_trans: take into account primitives larger than 8 bytes.

Fixes #38763 by marking all "eightbytes" covered by a primitive appropriately, not just the first.
2018-01-25 12:48:45 -06:00
Alex Crichton
3b2403306f Rollup merge of #47415 - varkor:cgu-partition-heuristic, r=michaelwoerister
Add CGU size heuristic for partitioning

This addresses the concern of #47316 by estimating CGU size based on
the size of its MIR. Looking at the size estimate differences for a
small selection of crates, this heuristic produces different orderings,
which should more accurately reflect optimisation time. (Fixes #47316.)

r? @michaelwoerister
2018-01-25 12:48:44 -06:00
varkor
6461532afa Fix never-type rvalue ICE 2018-01-25 18:03:48 +00:00
Oliver Middleton
77bc826f90 Fix rustdoc-js test 2018-01-25 17:18:52 +00:00
bors
9fd7da904b Auto merge of #47740 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 10 pull requests

- Successful merges: #47534, #47609, #47679, #47691, #47700, #47702, #47717, #47721, #47726, #47729
- Failed merges:
2018-01-25 15:27:18 +00:00
Guillaume Gomez
89ff1226e5 Rollup merge of #47729 - alexcrichton:update-cargo, r=sfackler
Update Cargo submodule to master

Just a routine update
2018-01-25 15:52:19 +01:00
Guillaume Gomez
58e56cca56 Rollup merge of #47726 - pietroalbini:fix-nested-empty-groups-span, r=petrochenkov
Fix spans in unused import lint for nested groups

This fixes an inconsistency for empty nested groups, and adds a test for all the possible cases of the lint.

```
warning: unused imports: `*`, `Foo`, `baz::{}`, `foobar::*`
  --> test.rs:16:11
   |
16 | use foo::{Foo, bar::{baz::{}, foobar::*}, *};
   |           ^^^        ^^^^^^^  ^^^^^^^^^   ^
   |
   = note: #[warn(unused_imports)] on by default

warning: unused import: `*`
  --> test.rs:17:24
   |
17 | use foo::bar::baz::{*, *};
   |                        ^

warning: unused import: `use foo::{};`
  --> test.rs:18:1
   |
18 | use foo::{};
   | ^^^^^^^^^^^^
```

cc #44494
2018-01-25 15:52:18 +01:00
Guillaume Gomez
6f2a0c6f68 Rollup merge of #47721 - GuillaumeGomez:experimental-color, r=QuietMisdreavus
Fix experimental text display on default theme

r? @QuietMisdreavus
2018-01-25 15:52:17 +01:00
Guillaume Gomez
f769b9de02 Rollup merge of #47717 - evelynmitchell:47716-doc-fix, r=steveklabnik
fix for documentation error issue 47716

Fix #47716
2018-01-25 15:52:16 +01:00
Guillaume Gomez
a809da3fee Rollup merge of #47702 - etaoins:fix-into-cast-paren-precedence, r=petrochenkov
Fix into() cast paren check precedence

As discussed in #47699 the logic for determining if an expression needs parenthesis when suggesting an `.into()` cast is incorrect. Two broken examples from nightly are:

```
error[E0308]: mismatched types
 --> main.rs:4:10
  |
4 |     test(foo as i8);
  |          ^^^^^^^^^ expected i32, found i8
help: you can cast an `i8` to `i32`, which will sign-extend the source value
  |
4 |     test(foo as i8.into());
  |
```

```
error[E0308]: mismatched types
 --> main.rs:4:10
  |
4 |     test(*foo);
  |          ^^^^ expected i32, found i8
help: you can cast an `i8` to `i32`, which will sign-extend the source value
  |
4 |     test(*foo.into());
  |
```

As suggested by @petrochenkov switch the precedence check to `PREC_POSTFIX`. This catches both `as` and unary operators. Fixes #47699.

r? @petrochenkov
2018-01-25 15:52:15 +01:00
Guillaume Gomez
3a863a3f45 Rollup merge of #47700 - EdSchouten:cc104, r=kennytm
Remove workarounds for cc 1.0.3.

Now that the Rust codebase depends on cc 1.0.4, there is no longer any
need to specify a compiler for CloudABI manually. Cargo will
automatically call into the right compiler executable.
2018-01-25 15:52:15 +01:00
Guillaume Gomez
df55cee0e5 Rollup merge of #47691 - estebank:unknown-lang-item-sp, r=rkruppe
Point at unknown lang item attribute
2018-01-25 15:52:14 +01:00
Guillaume Gomez
bbdc5b9637 Rollup merge of #47679 - etaoins:remove-redundant-backtrace-hint, r=estebank
Remove broken redundant backtrace hint

When the compiler driver panics it attempts to show a hint about using `RUST_BACKTRACE`. However, the logic is currently reversed to the hint is only shown if `RUST_BACKTRACE` is **already**   set:

```shell
> RUST_BACKTRACE=1 rustc /dev/null --crate-type proc-macro
error: internal compiler error: unexpected panic
...
note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

> RUST_BACKTRACE=0 rustc /dev/null --crate-type proc-macro
error: internal compiler error: unexpected panic
...
thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```

As the `panic` itself already has a working `RUST_BACKTRACE` hint just remove the broken duplicate hint entirely.
2018-01-25 15:52:13 +01:00
Guillaume Gomez
83603b8294 Rollup merge of #47609 - ritiek:test-mutating-references, r=nikomatsakis
NLL test for mutating &mut references

As mentioned in #46361.

cc @nikomatsakis?
2018-01-25 15:52:12 +01:00
Guillaume Gomez
e26aac5a9f Rollup merge of #47534 - estebank:suggest-public-traits, r=petrochenkov
On missing method do not suggest private traits

When encountering a method call for an ADT that doesn't have any
implementation of it, we search for traits that could be implemented
that do have that method. Filter out private non-local traits that would
not be able to be implemented.

This doesn't account for public traits that are in a private scope, but
works as a first approximation and is a more correct behavior than the
current one.

Fix #45781.
2018-01-25 15:52:11 +01:00
bors
4cf26f8a13 Auto merge of #47686 - GuillaumeGomez:theme-fixes, r=QuietMisdreavus
Few fixes for multiple themes support feature

r? @QuietMisdreavus

Fixes #47695.
2018-01-25 06:12:06 +00:00
Manish Goregaokar
08ca4fd135 Add tests 2018-01-25 10:11:25 +05:30
Manish Goregaokar
c26f8877c7 Handle variants 2018-01-25 10:11:14 +05:30
Alex Crichton
15899b0c12 Update Cargo submodule to master
Just a routine update
2018-01-24 20:02:16 -08:00
bors
247835aacb Auto merge of #47374 - topecongiro:issue-47096, r=nikomatsakis
Simplify irrefutable slice patterns

Closes #47096.
2018-01-25 03:20:54 +00:00
Alex Crichton
54462f5705 Update compiler-builtins submodule
No sense of urgency, just wanted to make sure we don't lag too far behind!
2018-01-24 18:26:27 -08:00
bors
a0a9007f8d Auto merge of #47006 - bitshifter:stabilize-repr-align, r=eddyb
Stabilized `#[repr(align(x))]` attribute (RFC 1358)

Stabilzed `#[repr(align(x))]` with attr_literal syntax as proposed by @eddyb https://github.com/rust-lang/rust/issues/33626#issuecomment-348467804
2018-01-25 00:26:17 +00:00