]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoShorten a filename for MSVC
Alex Crichton [Fri, 26 Jan 2018 02:11:42 +0000 (18:11 -0800)]
Shorten a filename for MSVC

6 years agoRevert update of the i686-freebsd builder
Alex Crichton [Thu, 25 Jan 2018 22:53:30 +0000 (14:53 -0800)]
Revert update of the i686-freebsd builder

Looks like llvm 4.0.0 isn't read for that either.

6 years agoRemove stray src/llvm-emscripten module
Alex Crichton [Thu, 25 Jan 2018 20:46:45 +0000 (12:46 -0800)]
Remove stray src/llvm-emscripten module

Accidentally added in e9a64996b

6 years agoMerge branch 'configure-lto' of https://github.com/alexcrichton/rust into rollup
Alex Crichton [Thu, 25 Jan 2018 18:51:20 +0000 (10:51 -0800)]
Merge branch 'configure-lto' of https://github.com/alexcrichton/rust into rollup

6 years agoMerge branch 'cache-ty-collect' of https://github.com/michaelwoerister/rust into...
Alex Crichton [Thu, 25 Jan 2018 18:50:35 +0000 (10:50 -0800)]
Merge branch 'cache-ty-collect' of https://github.com/michaelwoerister/rust into rollup

6 years agoRollup merge of #47719 - malbarbo:run-pass-arch-powerpc, r=alexcrichton
Alex Crichton [Thu, 25 Jan 2018 18:49:03 +0000 (12:49 -0600)]
Rollup merge of #47719 - malbarbo:run-pass-arch-powerpc, r=alexcrichton

Add powerpc to run-pass/conditional-compile-arch.rs

6 years agoRollup merge of #47711 - alexcrichton:update-compiler-builtins, r=nikomatsakis
Alex Crichton [Thu, 25 Jan 2018 18:49:02 +0000 (12:49 -0600)]
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!

6 years agoRollup merge of #47710 - alexcrichton:llvm-6-compat, r=nikomatsakis
Alex Crichton [Thu, 25 Jan 2018 18:49:01 +0000 (12:49 -0600)]
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!

6 years agoRollup merge of #47705 - pietroalbini:fix-47673, r=petrochenkov
Alex Crichton [Thu, 25 Jan 2018 18:49:00 +0000 (12:49 -0600)]
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

6 years agoRollup merge of #47701 - Manishearth:intra-fixes, r=QuietMisdreavus
Alex Crichton [Thu, 25 Jan 2018 18:48:59 +0000 (12:48 -0600)]
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

6 years agoRollup merge of #47696 - Zoxc:variance-rg, r=nikomatsakis
Alex Crichton [Thu, 25 Jan 2018 18:48:58 +0000 (12:48 -0600)]
Rollup merge of #47696 - Zoxc:variance-rg, r=nikomatsakis

Make use of the implemented red/green algorithm for variance

r? @michaelwoerister

6 years agoRollup merge of #47668 - nikomatsakis:issue-47511, r=eddyb
Alex Crichton [Thu, 25 Jan 2018 18:48:57 +0000 (12:48 -0600)]
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

6 years agoRollup merge of #47656 - ishitatsuyuki:patch-1, r=nikomatsakis
Alex Crichton [Thu, 25 Jan 2018 18:48:56 +0000 (12:48 -0600)]
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.

6 years agoRollup merge of #47626 - eddyb:one-less-unwrap, r=nagisa
Alex Crichton [Thu, 25 Jan 2018 18:48:55 +0000 (12:48 -0600)]
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

6 years agoRollup merge of #47618 - mrhota:dw_at_noreturn, r=michaelwoerister
Alex Crichton [Thu, 25 Jan 2018 18:48:54 +0000 (12:48 -0600)]
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 (`!`).

6 years agoRollup merge of #47600 - varkor:empty-never-array, r=eddyb
Alex Crichton [Thu, 25 Jan 2018 18:48:52 +0000 (12:48 -0600)]
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

6 years agoRollup merge of #47529 - nikomatsakis:impl-trait-issue-38064, r=cramertj
Alex Crichton [Thu, 25 Jan 2018 18:48:51 +0000 (12:48 -0600)]
Rollup merge of #47529 - nikomatsakis:impl-trait-issue-38064, r=cramertj

track recursion limit when expanding existential impl trait

r? @cramertj

6 years agoRollup merge of #47502 - petrochenkov:label, r=eddyb
Alex Crichton [Thu, 25 Jan 2018 18:48:49 +0000 (12:48 -0600)]
Rollup merge of #47502 - petrochenkov:label, r=eddyb

AST/HIR: Add a separate structure for labels

6 years agoRollup merge of #47460 - Mark-Simulacrum:bootstrap-check, r=alexcrichton
Alex Crichton [Thu, 25 Jan 2018 18:48:48 +0000 (12:48 -0600)]
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.

6 years agoRollup merge of #47453 - pftbest:nointas, r=alexcrichton
Alex Crichton [Thu, 25 Jan 2018 18:48:47 +0000 (12:48 -0600)]
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

6 years agoRollup merge of #47439 - eddyb:issue-45662, r=nagisa
Alex Crichton [Thu, 25 Jan 2018 18:48:46 +0000 (12:48 -0600)]
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.

6 years agoRollup merge of #47437 - eddyb:issue-38763, r=nagisa
Alex Crichton [Thu, 25 Jan 2018 18:48:45 +0000 (12:48 -0600)]
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.

6 years agoRollup merge of #47415 - varkor:cgu-partition-heuristic, r=michaelwoerister
Alex Crichton [Thu, 25 Jan 2018 18:48:44 +0000 (12:48 -0600)]
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

6 years agoAuto merge of #47740 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 25 Jan 2018 15:27:18 +0000 (15:27 +0000)]
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:

6 years agoRollup merge of #47729 - alexcrichton:update-cargo, r=sfackler
Guillaume Gomez [Thu, 25 Jan 2018 14:52:19 +0000 (15:52 +0100)]
Rollup merge of #47729 - alexcrichton:update-cargo, r=sfackler

Update Cargo submodule to master

Just a routine update

6 years agoRollup merge of #47726 - pietroalbini:fix-nested-empty-groups-span, r=petrochenkov
Guillaume Gomez [Thu, 25 Jan 2018 14:52:18 +0000 (15:52 +0100)]
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

6 years agoRollup merge of #47721 - GuillaumeGomez:experimental-color, r=QuietMisdreavus
Guillaume Gomez [Thu, 25 Jan 2018 14:52:17 +0000 (15:52 +0100)]
Rollup merge of #47721 - GuillaumeGomez:experimental-color, r=QuietMisdreavus

Fix experimental text display on default theme

r? @QuietMisdreavus

6 years agoRollup merge of #47717 - evelynmitchell:47716-doc-fix, r=steveklabnik
Guillaume Gomez [Thu, 25 Jan 2018 14:52:16 +0000 (15:52 +0100)]
Rollup merge of #47717 - evelynmitchell:47716-doc-fix, r=steveklabnik

fix for documentation error issue 47716

Fix #47716

6 years agoRollup merge of #47702 - etaoins:fix-into-cast-paren-precedence, r=petrochenkov
Guillaume Gomez [Thu, 25 Jan 2018 14:52:15 +0000 (15:52 +0100)]
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

6 years agoRollup merge of #47700 - EdSchouten:cc104, r=kennytm
Guillaume Gomez [Thu, 25 Jan 2018 14:52:15 +0000 (15:52 +0100)]
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.

6 years agoRollup merge of #47691 - estebank:unknown-lang-item-sp, r=rkruppe
Guillaume Gomez [Thu, 25 Jan 2018 14:52:14 +0000 (15:52 +0100)]
Rollup merge of #47691 - estebank:unknown-lang-item-sp, r=rkruppe

Point at unknown lang item attribute

6 years agoRollup merge of #47679 - etaoins:remove-redundant-backtrace-hint, r=estebank
Guillaume Gomez [Thu, 25 Jan 2018 14:52:13 +0000 (15:52 +0100)]
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.

6 years agoRollup merge of #47609 - ritiek:test-mutating-references, r=nikomatsakis
Guillaume Gomez [Thu, 25 Jan 2018 14:52:12 +0000 (15:52 +0100)]
Rollup merge of #47609 - ritiek:test-mutating-references, r=nikomatsakis

NLL test for mutating &mut references

As mentioned in #46361.

cc @nikomatsakis?

6 years agoRollup merge of #47534 - estebank:suggest-public-traits, r=petrochenkov
Guillaume Gomez [Thu, 25 Jan 2018 14:52:11 +0000 (15:52 +0100)]
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.

6 years agoAuto merge of #47686 - GuillaumeGomez:theme-fixes, r=QuietMisdreavus
bors [Thu, 25 Jan 2018 06:12:06 +0000 (06:12 +0000)]
Auto merge of #47686 - GuillaumeGomez:theme-fixes, r=QuietMisdreavus

Few fixes for multiple themes support feature

r? @QuietMisdreavus

Fixes #47695.

6 years agoAdd tests
Manish Goregaokar [Thu, 25 Jan 2018 04:41:25 +0000 (10:11 +0530)]
Add tests

6 years agoHandle variants
Manish Goregaokar [Wed, 24 Jan 2018 12:05:31 +0000 (17:35 +0530)]
Handle variants

6 years agoUpdate Cargo submodule to master
Alex Crichton [Thu, 25 Jan 2018 04:01:42 +0000 (20:01 -0800)]
Update Cargo submodule to master

Just a routine update

6 years agoAuto merge of #47374 - topecongiro:issue-47096, r=nikomatsakis
bors [Thu, 25 Jan 2018 03:20:54 +0000 (03:20 +0000)]
Auto merge of #47374 - topecongiro:issue-47096, r=nikomatsakis

Simplify irrefutable slice patterns

Closes #47096.

6 years agoUpdate compiler-builtins submodule
Alex Crichton [Wed, 24 Jan 2018 15:47:40 +0000 (07:47 -0800)]
Update compiler-builtins submodule

No sense of urgency, just wanted to make sure we don't lag too far behind!

6 years agoAuto merge of #47006 - bitshifter:stabilize-repr-align, r=eddyb
bors [Thu, 25 Jan 2018 00:26:17 +0000 (00:26 +0000)]
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

6 years agollvm6: Update FreeBSD images to Ubuntu 18.04
Alex Crichton [Tue, 23 Jan 2018 18:25:50 +0000 (10:25 -0800)]
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.

6 years agoFix wrong span for nested empty groups
Pietro Albini [Wed, 24 Jan 2018 22:32:17 +0000 (23:32 +0100)]
Fix wrong span for nested empty groups

6 years agoFix experimental text display on default theme
Guillaume Gomez [Wed, 24 Jan 2018 18:15:41 +0000 (19:15 +0100)]
Fix experimental text display on default theme

6 years agoAdd powerpc to run-pass/conditional-compile-arch.rs
Marco A L Barbosa [Wed, 24 Jan 2018 17:16:18 +0000 (15:16 -0200)]
Add powerpc to run-pass/conditional-compile-arch.rs

6 years agofix for documentation error issue 47716
evelynmitchell [Wed, 24 Jan 2018 16:25:46 +0000 (09:25 -0700)]
fix for documentation error issue 47716

6 years agollvm6: Don't clone LLVM modules on wasm
Alex Crichton [Wed, 24 Jan 2018 05:59:53 +0000 (21:59 -0800)]
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.

6 years agollvm6: Different return value for writeArchive
Alex Crichton [Tue, 23 Jan 2018 01:59:27 +0000 (17:59 -0800)]
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

6 years agollvm6: Remove MIPS64 archive variant
Alex Crichton [Tue, 23 Jan 2018 01:30:22 +0000 (17:30 -0800)]
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.

6 years agollvm6: Tweak fast math intrinsics
Alex Crichton [Tue, 23 Jan 2018 01:28:23 +0000 (17:28 -0800)]
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

6 years agollvm6: Missing include for LLVM 6 in PassWrapper.cpp
Alex Crichton [Tue, 23 Jan 2018 01:28:09 +0000 (17:28 -0800)]
llvm6: Missing include for LLVM 6 in PassWrapper.cpp

Just bog-standard compile error fixed by adding some new header files

6 years agollvm6: CodeModel::{JIT,}Default no longer exists
Alex Crichton [Tue, 23 Jan 2018 01:01:36 +0000 (17:01 -0800)]
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

6 years agoFix ICE when use trees have multiple empty nested groups
Pietro Albini [Wed, 24 Jan 2018 12:13:39 +0000 (13:13 +0100)]
Fix ICE when use trees have multiple empty nested groups

6 years agoMake it work for traits
Manish Goregaokar [Wed, 24 Jan 2018 11:14:26 +0000 (16:44 +0530)]
Make it work for traits

6 years agoFew fixes for multiple themes support feature
Guillaume Gomez [Tue, 23 Jan 2018 21:10:16 +0000 (22:10 +0100)]
Few fixes for multiple themes support feature

6 years agoMake use of the implemented red/green algorithm for variance
John Kåre Alsaker [Wed, 24 Jan 2018 02:51:02 +0000 (03:51 +0100)]
Make use of the implemented red/green algorithm for variance

6 years agoHandle methods
Manish Goregaokar [Wed, 24 Jan 2018 10:45:36 +0000 (16:15 +0530)]
Handle methods

6 years agoAuto merge of #47300 - remexre:duration-constructors-as-const-fns, r=alexcrichton
bors [Wed, 24 Jan 2018 10:39:25 +0000 (10:39 +0000)]
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`.

6 years agoReturn Def from resolve()
Manish Goregaokar [Wed, 24 Jan 2018 10:27:31 +0000 (15:57 +0530)]
Return Def from resolve()

6 years agoReturn Err() if resolve() is called before modules are set up
Manish Goregaokar [Wed, 24 Jan 2018 10:24:45 +0000 (15:54 +0530)]
Return Err() if resolve() is called before modules are set up

6 years agoFix into() cast paren check precedence
Ryan Cumming [Wed, 24 Jan 2018 09:31:36 +0000 (20:31 +1100)]
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.

6 years agoTurn error into warning
Manish Goregaokar [Wed, 24 Jan 2018 08:19:57 +0000 (13:49 +0530)]
Turn error into warning

6 years agoRemove workarounds for cc 1.0.3.
Ed Schouten [Wed, 24 Jan 2018 07:30:17 +0000 (08:30 +0100)]
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.

6 years agoAuto merge of #47299 - cramertj:unsafe-placer, r=alexcrichton
bors [Wed, 24 Jan 2018 07:22:22 +0000 (07:22 +0000)]
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.

6 years agoPoint at unknown lang item attribute
Esteban Küber [Tue, 23 Jan 2018 23:34:16 +0000 (15:34 -0800)]
Point at unknown lang item attribute

6 years agoAuto merge of #46931 - clarcharr:float_bits_core, r=alexcrichton
bors [Wed, 24 Jan 2018 03:02:15 +0000 (03:02 +0000)]
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.

6 years agoAdd ./x.py check src/{libstd,libtest,rustc}.
Mark Simulacrum [Mon, 15 Jan 2018 17:44:00 +0000 (10:44 -0700)]
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.

6 years agoRename check.rs to test.rs
Mark Simulacrum [Mon, 15 Jan 2018 17:43:37 +0000 (10:43 -0700)]
Rename check.rs to test.rs

6 years agoAuto merge of #45337 - Zoxc:gen-static, r=nikomatsakis
bors [Tue, 23 Jan 2018 22:50:03 +0000 (22:50 +0000)]
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.

6 years agorustc: Add `-C lto=val` option
Alex Crichton [Tue, 16 Jan 2018 23:02:31 +0000 (15:02 -0800)]
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.

6 years agoRemove similar test that does not run the result
ritiek [Tue, 23 Jan 2018 17:15:10 +0000 (22:45 +0530)]
Remove similar test that does not run the result

6 years agoAuto merge of #47678 - kennytm:rollup, r=kennytm
bors [Tue, 23 Jan 2018 16:13:18 +0000 (16:13 +0000)]
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:

6 years agoRollup merge of #47672 - ollie27:rustdoc_auto_traits, r=GuillaumeGomez
kennytm [Tue, 23 Jan 2018 09:03:47 +0000 (17:03 +0800)]
Rollup merge of #47672 - ollie27:rustdoc_auto_traits, r=GuillaumeGomez

rustdoc: Show when traits are auto traits

6 years agoRollup merge of #47667 - GuillaumeGomez:fix-quoted-search, r=QuietMisdreavus
kennytm [Tue, 23 Jan 2018 09:03:46 +0000 (17:03 +0800)]
Rollup merge of #47667 - GuillaumeGomez:fix-quoted-search, r=QuietMisdreavus

Fix quoted search

r? @QuietMisdreavus

6 years agoRollup merge of #47662 - spastorino:add_test_to_nll, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:45 +0000 (17:03 +0800)]
Rollup merge of #47662 - spastorino:add_test_to_nll, r=nikomatsakis

Add dynamic-drop test to nll tests also

r? @nikomatsakis

Fixes #47585

6 years agoRollup merge of #47661 - bjorn3:refactor_driver, r=michaelwoerister
kennytm [Tue, 23 Jan 2018 09:03:44 +0000 (17:03 +0800)]
Rollup merge of #47661 - bjorn3:refactor_driver, r=michaelwoerister

Inline some rustc_driver function

6 years agoRollup merge of #47655 - etaoins:fix-spurious-warning-on-empty-proc-macro-crate,...
kennytm [Tue, 23 Jan 2018 09:03:43 +0000 (17:03 +0800)]
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.

6 years agoRollup merge of #47635 - Zoxc:remove-attr, r=michaelwoerister
kennytm [Tue, 23 Jan 2018 09:03:42 +0000 (17:03 +0800)]
Rollup merge of #47635 - Zoxc:remove-attr, r=michaelwoerister

Remove the IGNORED_ATTR_NAMES thread local

6 years agoAuto merge of #47620 - GuillaumeGomez:multiple-themes, r=QuietMisdreavus
bors [Tue, 23 Jan 2018 13:23:58 +0000 (13:23 +0000)]
Auto merge of #47620 - GuillaumeGomez:multiple-themes, r=QuietMisdreavus

Multiple themes for rustdoc

r? @QuietMisdreavus

6 years agoincr.comp.: Cache generics_of query.
Michael Woerister [Wed, 17 Jan 2018 15:39:29 +0000 (16:39 +0100)]
incr.comp.: Cache generics_of query.

6 years agoMake ty::Generics::type_param_to_index use DefId instead of DefIndex as key.
Michael Woerister [Wed, 17 Jan 2018 15:23:50 +0000 (16:23 +0100)]
Make ty::Generics::type_param_to_index use DefId instead of DefIndex as key.

6 years agoincr.comp.: Cache type_of and some other queries.
Michael Woerister [Mon, 15 Jan 2018 15:38:04 +0000 (16:38 +0100)]
incr.comp.: Cache type_of and some other queries.

6 years agoRemove broken redundant backtrace hint
Ryan Cumming [Tue, 23 Jan 2018 08:42:46 +0000 (19:42 +1100)]
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.

6 years agoRollup merge of #47610 - cuviper:captured-dwarf, r=eddyb
kennytm [Tue, 23 Jan 2018 09:03:40 +0000 (17:03 +0800)]
Rollup merge of #47610 - cuviper:captured-dwarf, r=eddyb

LLVM5: Update DW_OP_plus to DW_OP_plus_uconst

LLVM <= 4.0 used a non-standard interpretation of `DW_OP_plus`.  In the
DWARF standard, this adds two items on the expressions stack.  LLVM's
behavior was more like DWARF's `DW_OP_plus_uconst` -- adding a constant
that follows the op.  The patch series starting with [D33892] switched
to the standard DWARF interpretation, so we need to follow.

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

Fixes #47464
r? @eddyb

6 years agoRollup merge of #47558 - spastorino:rustc_args, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:39 +0000 (17:03 +0800)]
Rollup merge of #47558 - spastorino:rustc_args, r=nikomatsakis

Add rustc-args option to test runner

r? @nikomatsakis

6 years agoRollup merge of #47554 - EdSchouten:cloudabi-jemalloc, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:38 +0000 (17:03 +0800)]
Rollup merge of #47554 - EdSchouten:cloudabi-jemalloc, r=nikomatsakis

Make liballoc_jemalloc work on CloudABI.

The automated builds for CloudABI in dist-various-2 don't use
--disable-jemalloc, even though my original container image did. Instead
of setting that flag, let's go the extra mile of making jemalloc work.
CloudABI's C library already uses jemalloc and now exposes the API
extensions used by us.

This makes the CloudABI dist work out of the box.

6 years agoRollup merge of #47549 - Manishearth:29723-regression, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:37 +0000 (17:03 +0800)]
Rollup merge of #47549 - Manishearth:29723-regression, r=nikomatsakis

Add regression test for #29723

cc #29723

r? @nikomatsakis

6 years agoRollup merge of #47541 - psumbera:master, r=eddyb
kennytm [Tue, 23 Jan 2018 09:03:36 +0000 (17:03 +0800)]
Rollup merge of #47541 - psumbera:master, r=eddyb

Fixes sparc64 cabi fixes.

Argument up to 16 bytes size is provided in registers.
Return value up to 32 bytes size is stored in registers.

Fixes: #46679
---

Firefox now (almost) build on sparc. Original rust issue seems to be gone. Note that I'm not rust expert and the fix was suggested in bug.

6 years agoRollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:35 +0000 (17:03 +0800)]
Rollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakis

Change the --unpretty flag to -Z unpretty

First PR :smile: !

-Z unpretty no longer requires -Z unstable-options.

Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI).

Fix #47395

r? @nikomatsakis EDIT: apparently rust-highfive doesn't see edits...

6 years agoRollup merge of #47425 - EdSchouten:immutable-tls, r=nikomatsakis
kennytm [Tue, 23 Jan 2018 09:03:34 +0000 (17:03 +0800)]
Rollup merge of #47425 - EdSchouten:immutable-tls, r=nikomatsakis

Properly pass down immutability info for thread-locals.

For thread-locals we call into cat_rvalue_node() to create a CMT
(Category, Mutability, Type) that always has McDeclared. This is
incorrect for thread-locals that don't have the 'mut' keyword; we should
use McImmutable there.

Extend cat_rvalue_node() to have an additional mutability parameter. Fix
up all the callers to make use of that function. Also extend one of the
existing unit tests to cover this.

Fixes: #47053
6 years agoRollup merge of #47423 - est31:rustbook_checking, r=alexcrichton
kennytm [Tue, 23 Jan 2018 09:03:32 +0000 (17:03 +0800)]
Rollup merge of #47423 - est31:rustbook_checking, r=alexcrichton

Check for deadlinks from the summary during book generation

Previously, any deadlinks from a book's SUMMARY.md wouldn't
cause any errors or warnings or similar but mdbook would simply
create a page with blank content.

This has kept bug #47394 hidden. It should have been detected
back in the PR when those wrongly named files got added to the
book.

PR #47414 was one component of the solution. This change
is a second line of defense for the unstable book and a first
line of defense for any other book.

We also update mdbook to the most recent version.

6 years agoAuto merge of #47046 - Manishearth:intra-doc-links, r=eddyb,GuillaumeGomez,QuietMisdr...
bors [Tue, 23 Jan 2018 07:38:53 +0000 (07:38 +0000)]
Auto merge of #47046 - Manishearth:intra-doc-links, r=eddyb,GuillaumeGomez,QuietMisdreavus,Manishearth

Implement RFC 1946 - intra-rustdoc links

https://github.com/rust-lang/rfcs/pull/1946 https://github.com/rust-lang/rust/issues/43466

Note for reviewers: The plain line counts are a little inflated because of how the markdown link parsing was done. [Read the file diff with "whitespace only" changes removed](https://github.com/rust-lang/rust/pull/47046/files?w=1) to get a better view of what actually changed there.

This pulls the name/path resolution mechanisms out of the compiler and runs it on the markdown in a crate's docs, so that links can be made to `SomeStruct` directly rather than finding the folder path to `struct.SomeStruct.html`. Check the `src/test/rustdoc/intra-paths.rs` test in this PR for a demo. The change was... a little invasive, but unlocks a really powerful mechanism for writing documentation that doesn't care about where an item was written to on the hard disk.

Items included:

 - [x] Make work with the hoedown renderer
 - [x] Handle relative paths
 - [x] Parse out the "path ambiguities" qualifiers (`[crate foo]`, `[struct Foo]`, `[foo()]`, `[static FOO]`, `[foo!]`, etc)
 - [x] Resolve foreign macros
 - [x] Resolve local macros
 - [x] Handle the use of inner/outer attributes giving different resolution scopes (handling for non-modules pushed to different PR)

Items not included:

 - [ ] Make sure cross-crate inlining works (blocked on refactor described in https://github.com/rust-lang/rust/pull/47046#issuecomment-354824520)
 - [ ] Implied Shortcut Reference Links (where just doing `[::std::iter::Iterator][]` without a reference anchor will resolve using the reference name rather than the link target) (requires modifying the markdown parser - blocked on Hoedown/Pulldown switch and https://github.com/google/pulldown-cmark/issues/121)
 - [ ] Handle enum variants and UFCS methods (Enum variants link to the enum page, associated methods don't link at all)
 - [ ] Emit more warnings/errors when things fail to resolve (linking to a value-namespaced item without a qualifier will emit an error, otherwise the link is just treated as a url, not a rust path)
 - [ ] Give better spans for resolution errors (currently the span for the first doc comment is used)
 - [ ] Check for inner doc comments on things that aren't modules

I'm making the PR, but it should be noted that most of the work was done by Misdreavus :smile:

(Editor's note: This has become a lie, check that commit log, Manish did a ton of work after this PR was opened `>_>`)

6 years agoPort borrows across yield check to MIR borrowck
John Kåre Alsaker [Thu, 11 Jan 2018 18:50:40 +0000 (19:50 +0100)]
Port borrows across yield check to MIR borrowck

6 years agoAdd dropck test
John Kåre Alsaker [Thu, 11 Jan 2018 18:50:01 +0000 (19:50 +0100)]
Add dropck test

6 years agoFix yield-while-local-borrowed.rs test
John Kåre Alsaker [Thu, 11 Jan 2018 18:49:26 +0000 (19:49 +0100)]
Fix yield-while-local-borrowed.rs test

6 years agoUse delay_span_bug for things that should be errors
John Kåre Alsaker [Thu, 11 Jan 2018 18:46:51 +0000 (19:46 +0100)]
Use delay_span_bug for things that should be errors

6 years agoMake immovable generators unsafe
John Kåre Alsaker [Fri, 22 Dec 2017 21:12:27 +0000 (22:12 +0100)]
Make immovable generators unsafe

6 years agoAdds support for immovable generators. Move checking of invalid borrows across suspen...
John Kåre Alsaker [Sat, 7 Oct 2017 14:36:28 +0000 (16:36 +0200)]
Adds support for immovable generators. Move checking of invalid borrows across suspension points to borrowck. Fixes #44197, #45259 and #45093.

6 years agorustdoc: Show when traits are auto traits
Oliver Middleton [Tue, 23 Jan 2018 01:04:24 +0000 (01:04 +0000)]
rustdoc: Show when traits are auto traits

6 years agoImplement Ord as necessary
Tatsuyuki Ishi [Mon, 22 Jan 2018 23:21:17 +0000 (08:21 +0900)]
Implement Ord as necessary