Commit Graph

73972 Commits

Author SHA1 Message Date
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
Esteban Küber
e6af9ebea2 Point at unknown lang item attribute 2018-01-23 21:36:40 -08:00
bors
a538fe7ce7 Auto merge of #46931 - clarcharr:float_bits_core, r=alexcrichton
Expose float from_bits and to_bits in libcore.

These methods have no dependencies on libm and thus should be offered in libcore.
2018-01-24 03:02:15 +00:00
Mark Simulacrum
6aeb1cfb64 Add ./x.py check src/{libstd,libtest,rustc}.
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 (i.e., running 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-23 19:39:20 -07:00
Mark Simulacrum
734ee0fb43 Rename check.rs to test.rs 2018-01-23 19:39:20 -07:00
Esteban Küber
3a530baec9 For E0277 on for loops, point at first line
When E0277's span points at a `for` loop, the actual issue is in the
element being iterated. Instead of pointing at the entire loop, point
only at the first line (when possible) so that the span ends in the
element for which E0277 was triggered.
2018-01-23 17:05:12 -08:00
Marco A L Barbosa
9b13e40376 Build musl with -fPIC for all targets 2018-01-23 21:39:17 -02:00
bors
fdecb0564b Auto merge of #45337 - Zoxc:gen-static, r=nikomatsakis
Immovable generators

This adds support for immovable generators which allow you to borrow local values inside generator across suspension points. These are declared using a `static` keyword:
```rust
let mut generator = static || {
    let local = &Vec::new();
    yield;
    local.push(0i8);
};
generator.resume();

// ERROR moving the generator after it has resumed would invalidate the interior reference
// drop(generator);
```

Region inference is no longer affected by the types stored in generators so the regions inside should be similar to other code (and unaffected by the presence of `yield` expressions). The borrow checker is extended to pick up the slack so interior references still result in errors for movable generators. This fixes #44197, #45259 and #45093.

This PR depends on [PR #44917 (immovable types)](https://github.com/rust-lang/rust/pull/44917), I suggest potential reviewers ignore the first commit as it adds immovable types.
2018-01-23 22:50:03 +00:00
Alex Crichton
8bde2acfc7 rustc: Add -C lto=val option
This commit primarily adds the ability to control what kind of LTO happens when
rustc performs LTO, namely allowing values to be specified to the `-C lto`
option, such as `-C lto=thin` and `-C lto=fat`. (where "fat" is the previous
kind of LTO, throw everything in one giant module)

Along the way this also refactors a number of fields which store information
about whether LTO/ThinLTO are enabled to unify them all into one field through
which everything is dispatched, hopefully removing a number of special cases
throughout.

This is intended to help mitigate #47409 but will require a backport as well,
and this would unfortunately need to be an otherwise insta-stable option.
2018-01-23 14:13:47 -08:00
Josh Stone
7eb7d45c0b Let LLVM 5 add DW_OP_deref to indirect args itself
We needed to manually added the `DW_OP_deref` ourselves in earlier LLVM,
but starting with [D31439] in LLVM 5, it appears that LLVM will always
handle this itself.  When we were still adding this manually, the
resulting `.debug_loc` had too many derefs, and this failed test
`debuginfo/by-value-self-argument-in-trait-impl.rs`.

[D31439]: https://reviews.llvm.org/D31439

Fixes #47611.
cc @alexcrichton
r? @michaelwoerister
2018-01-23 13:53:01 -08:00
Esteban Küber
482f7f1978 Rename -Z explain to -Z teach 2018-01-23 11:34:57 -08:00
Esteban Küber
3dac0f5a9c Create StructuredDiagnostic
Create the concept of an `StructuredDiagnostic` that is self-contained
with enough knowledge of all variables to create a `DiagnosticBuilder`,
including different possible versions (one line output and expanded
explanations).
2018-01-23 11:01:38 -08:00
ritiek
06d123d4be Remove similar test that does not run the result 2018-01-23 22:45:10 +05:30
bors
4e3901d35f Auto merge of #47678 - kennytm:rollup, r=kennytm
Rollup of 14 pull requests

- Successful merges: #47423, #47425, #47440, #47541, #47549, #47554, #47558, #47610, #47635, #47655, #47661, #47662, #47667, #47672
- Failed merges:
2018-01-23 16:13:18 +00:00
Marco A L Barbosa
abc1061a65 Use libuwind 6.0 for all musl targets 2018-01-23 14:05:31 -02:00
Marco A L Barbosa
61fdf8eef5 Set crt_static_default = false for musl/mips[el] targets 2018-01-23 13:34:25 -02:00
kennytm
9707b31076
Rollup merge of #47672 - ollie27:rustdoc_auto_traits, r=GuillaumeGomez
rustdoc: Show when traits are auto traits
2018-01-23 22:31:02 +08:00
kennytm
97358644a0
Rollup merge of #47667 - GuillaumeGomez:fix-quoted-search, r=QuietMisdreavus
Fix quoted search

r? @QuietMisdreavus
2018-01-23 22:31:01 +08:00
kennytm
4cc2f96837
Rollup merge of #47662 - spastorino:add_test_to_nll, r=nikomatsakis
Add dynamic-drop test to nll tests also

r? @nikomatsakis

Fixes #47585
2018-01-23 22:31:00 +08:00
kennytm
6dcaa0af20
Rollup merge of #47661 - bjorn3:refactor_driver, r=michaelwoerister
Inline some rustc_driver function
2018-01-23 22:30:59 +08:00
kennytm
117eb68122
Rollup merge of #47655 - etaoins:fix-spurious-warning-on-empty-proc-macro-crate, r=alexcrichton
Fix spurious warning on empty proc macro crates

While attempting to reproduce rust-lang/rust#47086 I noticed the following warning:

```shell
> rustc /dev/null --crate-type proc-macro
warning: unused variable: `registrar`
 --> /dev/null:0:1
```

As there are no macros to register the automatically generated registrar function for the crate has no body. As a result its `registrar` argument is unused triggering the above warning.

The warning is confusing and not easily actionable by the developer. It could also be triggered legitimately by e.g. having all of the macros in a crate #[cfg]'ed out.

Fix by naming the generated argument `_registrar` inside `mk_registrar()`. This suppresses the unused variable warning.
2018-01-23 22:30:58 +08:00
kennytm
9d26a25bb6
Rollup merge of #47635 - Zoxc:remove-attr, r=michaelwoerister
Remove the IGNORED_ATTR_NAMES thread local
2018-01-23 22:30:57 +08:00
bors
3a39b2aa5a Auto merge of #47620 - GuillaumeGomez:multiple-themes, r=QuietMisdreavus
Multiple themes for rustdoc

r? @QuietMisdreavus
2018-01-23 13:23:58 +00:00
Michael Woerister
0a4f347395 incr.comp.: Cache generics_of query. 2018-01-23 10:44:52 +01:00