Commit graph

73995 commits

Author SHA1 Message Date
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
Alex Crichton
e9a64996be llvm6: Update FreeBSD images to Ubuntu 18.04
Looks like the clang with 16.04 fails to compile LLVM 6, but it looks like clang
in 18.04 can indeed compile LLVM 6.
2018-01-24 15:34:41 -08:00
Pietro Albini
0847ac0265
Fix wrong span for nested empty groups 2018-01-24 23:46:02 +01:00
Guillaume Gomez
e1e991d3d2 Fix experimental text display on default theme 2018-01-24 19:15:41 +01:00
Marco A L Barbosa
5c5d9ddf64 Add powerpc to run-pass/conditional-compile-arch.rs 2018-01-24 15:16:18 -02:00
evelynmitchell
05652d2ae3
fix for documentation error issue 47716 2018-01-24 09:25:46 -07:00
Alex Crichton
63b3168448 llvm6: Don't clone LLVM modules on wasm
The comment for why cloning exists doesn't actually apply for wasm today and
apparently cloning is causing subtle bugs in LLVM, so let's just avoid it
altogether. More specifically after we emit the assembly for the wasm target we
don't actually use the module again, so there's no need to keep both around.

This seemed to be causing some scary verifier assertions in LLVM which seemed to
be uncovered by presumably (?) buggy behavior. Let's just avoid it for now and
make the wasm target slightly more lean in the process.
2018-01-24 07:18:02 -08:00
Alex Crichton
caedb36f08 llvm6: Different return value for writeArchive
Updated in llvm-mirror/llvm@203c90ba this function now just returns an `Error`,
so this updates the C++ bindings accordingly
2018-01-24 07:18:02 -08:00
Alex Crichton
b6fe1127e4 llvm6: Remove MIPS64 archive variant
It looks like LLVM also removed it in llvm-mirror/llvm@f45adc29d in favor of the
name "GNU64". This was added in the thought that we'd need such a variant when
adding mips64 support but we ended up not needing it! For now let's just
removing the various support on the Rust side of things.
2018-01-24 07:18:02 -08:00
Alex Crichton
9eeecd2ada llvm6: Tweak fast math intrinsics
Looks like they did some refactoring of flags in the backend and this should
catch us up! The "unsafe algebra" boolean has been split into a number of
boolean flags for various operations, and this updates to use the `setFast`
function which should hopefully have the same behavior as before.

This was updated in llvm-mirror/llvm@00e900afd
2018-01-24 07:18:02 -08:00
Alex Crichton
2a7ed74d96 llvm6: Missing include for LLVM 6 in PassWrapper.cpp
Just bog-standard compile error fixed by adding some new header files
2018-01-24 07:18:01 -08:00
Alex Crichton
03f86ae982 llvm6: CodeModel::{JIT,}Default no longer exists
LLVM has since removed the `CodeModel::Default` enum value in favor of an
`Optional` implementationg throughout LLVM. Let's mirror the same change in Rust
and update the various bindings we call accordingly.

Removed in llvm-mirror/llvm@9aafb854c
2018-01-24 07:18:01 -08:00
Pietro Albini
5faba281ad
Fix ICE when use trees have multiple empty nested groups 2018-01-24 13:13:39 +01:00
Manish Goregaokar
a4d36928fd Make it work for traits 2018-01-24 17:19:18 +05:30
Guillaume Gomez
e78f1392b7 Few fixes for multiple themes support feature 2018-01-24 12:13:52 +01:00
John Kåre Alsaker
62afc43a84 Make use of the implemented red/green algorithm for variance 2018-01-24 12:07:37 +01:00
Manish Goregaokar
5a89f40116 Handle methods 2018-01-24 16:34:47 +05:30
bors
a0dcecff90 Auto merge of #47300 - remexre:duration-constructors-as-const-fns, r=alexcrichton
Makes the constructors of Duration const fns.

This affects `Duration::new`, `Duration::from_secs`, `Duration::from_millis`, `Duration::from_micros`, and `Duration::from_nanos`.
2018-01-24 10:39:25 +00:00
Marco A L Barbosa
cd47ddf24d Update libc 2018-01-24 08:37:33 -02:00
Manish Goregaokar
f0e7677272 Return Def from resolve() 2018-01-24 15:57:31 +05:30
Manish Goregaokar
6b26b7472b Return Err() if resolve() is called before modules are set up 2018-01-24 15:54:50 +05:30
Ryan Cumming
65b1e86aed 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.
2018-01-24 20:31:36 +11:00
Manish Goregaokar
f7ba00c636 Turn error into warning 2018-01-24 13:49:59 +05:30
Ed Schouten
583b382deb 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-24 08:30:17 +01:00
bors
9758ff9c0b Auto merge of #47299 - cramertj:unsafe-placer, r=alexcrichton
Make core::ops::Place an unsafe trait

Consumers of `Place` would reasonably expect that the `pointer` function returns a valid pointer to memory that can actually be written to.
2018-01-24 07:22:22 +00:00