]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #52006 - Mark-Simulacrum:keep-stage-fix, r=alexcrichton
Pietro Albini [Tue, 3 Jul 2018 09:31:13 +0000 (11:31 +0200)]
Rollup merge of #52006 - Mark-Simulacrum:keep-stage-fix, r=alexcrichton

 Change --keep-stage to apply more often

Previously, the --keep-stage argument would only function for compilers
that were depended on by future stages. For example, if trying to build
a stage 1 compiler you could --keep-stage 0 to avoid re-building the
stage 0 compiler. However, this is often not what users want in
practice.

The new implementation essentially skips builds all higher stages of the
compiler, so an argument of 1 to keep-stage will skip rebuilds of the
libraries, just linking them into the sysroot. This is unlikely to work
well in cases where metadata or similar changes have been made, but is
likely fine otherwise.

This change is somewhat untested, but since it shouldn't have any effect
except with --keep-stage, I don't see that as a large problem.

r? @alexcrichton
cc @nikomatsakis - I believe you wanted this functionality

6 years agoRollup merge of #52004 - kennytm:toolstate-fixes, r=Mark-Simulacrum
Pietro Albini [Tue, 3 Jul 2018 09:31:12 +0000 (11:31 +0200)]
Rollup merge of #52004 - kennytm:toolstate-fixes, r=Mark-Simulacrum

toolstate: Fixed detection of changed submodule, and other fixes.

1. Make sure that if a submodule is updated but failed to test-pass, we'll block the merge.
2. Make sure failure on external docs (nomicon/RBE/etc) are properly checked.
3. If the commit message starts with "Update RLS" (or clippy etc), automatically run the "tools" job on the PR, so that we could know if the update failed before merging.

6 years agoRollup merge of #51997 - euclio:release-notes, r=Aaronepower
Pietro Albini [Tue, 3 Jul 2018 09:31:11 +0000 (11:31 +0200)]
Rollup merge of #51997 - euclio:release-notes, r=Aaronepower

add entry for cargo-metadata feature to RELEASES

6 years agoRollup merge of #51982 - michaelwoerister:hash-modules-properly, r=nikomatsakis
Pietro Albini [Tue, 3 Jul 2018 09:31:10 +0000 (11:31 +0200)]
Rollup merge of #51982 - michaelwoerister:hash-modules-properly, r=nikomatsakis

incr.comp.: Take names of children into account when computing the ICH of a module's HIR.

Fixes #40876. Red-green tracking does not make this a problem anymore. We should verify this via a perf-run though.

r? @nikomatsakis

6 years agoRollup merge of #51980 - est31:columns, r=alexcrichton
Pietro Albini [Tue, 3 Jul 2018 09:31:09 +0000 (11:31 +0200)]
Rollup merge of #51980 - est31:columns, r=alexcrichton

Emit column info in debuginfo for non msvc like targets

Fixes #42921 everywhere except MSVC. This mimics clang behaviour.

6 years agoRollup merge of #51979 - oli-obk:lowering_cleanups4, r=nikomatsakis
Pietro Albini [Tue, 3 Jul 2018 09:31:07 +0000 (11:31 +0200)]
Rollup merge of #51979 - oli-obk:lowering_cleanups4, r=nikomatsakis

Get rid of `TyImplTraitExistential`

cc @eddyb

r? @nikomatsakis

6 years agoRollup merge of #51978 - estebank:issue-48364, r=oli-obk
Pietro Albini [Tue, 3 Jul 2018 09:31:06 +0000 (11:31 +0200)]
Rollup merge of #51978 - estebank:issue-48364, r=oli-obk

Do not suggest changes to str literal if it isn't one

Fix #48364.

6 years agoRollup merge of #51977 - mnd:fix-bootstrap-test-with-local-stage0, r=simulacrum
Pietro Albini [Tue, 3 Jul 2018 09:31:04 +0000 (11:31 +0200)]
Rollup merge of #51977 - mnd:fix-bootstrap-test-with-local-stage0, r=simulacrum

bootstrap: tests should use rustc from config.toml

Tests should always use "rustc" and "cargo" from config.toml instead of assuming that stage0 binaries was downloaded to build directory.

Without this change `./x.py test src/bootstrap` will always try to use `build/ARCH/stage0/bin/rustc` file as compiler, but when we use local compiler to bootstrap this file does not exist.

6 years agoRollup merge of #51973 - estk:master, r=abonander
Pietro Albini [Tue, 3 Jul 2018 09:31:03 +0000 (11:31 +0200)]
Rollup merge of #51973 - estk:master, r=abonander

Make Stdio handle UnwindSafe

Closes  #51863

This is my first compiler PR. Thanks Niko for the mentor help!

r? @nikomatsakis

6 years agoRollup merge of #51958 - euclio:attr-refactor, r=petrochenkov
Pietro Albini [Tue, 3 Jul 2018 09:31:01 +0000 (11:31 +0200)]
Rollup merge of #51958 - euclio:attr-refactor, r=petrochenkov

Show known meta items in unknown meta items error

This PR adds a label to E0541. It also factors built-in attribute parsing into a submodule of `attr` for ease of future refactoring.

Fixes #51469.

6 years agoRollup merge of #51914 - nikomatsakis:nll-fix-issue-issue-btreemap-annotations, r...
Pietro Albini [Tue, 3 Jul 2018 09:31:00 +0000 (11:31 +0200)]
Rollup merge of #51914 - nikomatsakis:nll-fix-issue-issue-btreemap-annotations, r=gankro

add outlives annotations to `BTreeMap`

NLL requires these annotations, I believe because of <https://github.com/rust-lang/rust/issues/29149>.

Fixes #48224

r? @Gankro
cc @lqd

6 years agoRollup merge of #51809 - drrlvn:rw_exact_all_at, r=alexcrichton
Pietro Albini [Tue, 3 Jul 2018 09:30:59 +0000 (11:30 +0200)]
Rollup merge of #51809 - drrlvn:rw_exact_all_at, r=alexcrichton

Add read_exact_at and write_all_at methods to FileExt on unix

This PR adds `FileExt::read_exact_at()` and `FileExt::write_all_at()`, which are to `read_at()` and `write_at()` as `read_exact()` and `write_all()` are to `read()` and `write()`. This allows the user to not have to deal with `ErrorKind::Interrupted` and calling the functions in a loop.

I was unsure as to how to mark these new methods so I marked them `unstable`, please let me know if I should have done it differently.

I asked in Discord and was told that as this change is small it does not require an RFC.

6 years agoRollup merge of #51548 - DiamondLovesYou:amdgpu-target-machine, r=alexcrichton
Pietro Albini [Tue, 3 Jul 2018 09:30:57 +0000 (11:30 +0200)]
Rollup merge of #51548 - DiamondLovesYou:amdgpu-target-machine, r=alexcrichton

Initialize LLVM's AMDGPU target machine, if available.

Note this isn't useful, yet. More changes will be necessary to be able to
actually codegen for this machine. As such, it is not enabled by default.

This patch is on its own for the benefit of the reviewers.

6 years agoAvoid sorting the item_ids array the StableHash impl of hir::Mod.
Michael Woerister [Tue, 3 Jul 2018 09:16:38 +0000 (11:16 +0200)]
Avoid sorting the item_ids array the StableHash impl of hir::Mod.

6 years agoAuto merge of #51695 - est31:stdsimd_update, r=alexcrichton
bors [Tue, 3 Jul 2018 07:06:46 +0000 (07:06 +0000)]
Auto merge of #51695 - est31:stdsimd_update, r=alexcrichton

Update stdsimd

Closes #51691

6 years agoAuto merge of #51564 - SimonSapin:try-int, r=alexcrichton
bors [Tue, 3 Jul 2018 04:08:02 +0000 (04:08 +0000)]
Auto merge of #51564 - SimonSapin:try-int, r=alexcrichton

Implement always-fallible TryFrom for usize/isize conversions that are infallible on some platforms

This reverts commit 837d6c70233715a0ae8e15c703d40e3046a2f36a "Remove TryFrom impls that might become conditionally-infallible with a portability lint".

This fixes #49415 by adding (restoring) missing `TryFrom` impls for integer conversions to or from `usize` or `isize`, by making them always fallible at the type system level (that is, with `Error=TryFromIntError`) even though they happen to be infallible on some platforms (for some values of `size_of::<usize>()`).

They had been removed to allow the possibility to conditionally having some of them be infallible `From` impls instead, depending on the platforms, and have the [portability lint](https://github.com/rust-lang/rfcs/pull/1868) warn when they are used in code that is not already opting into non-portability. For example `#[allow(some_lint)] usize::from(x: u64)` would be valid on code that only targets 64-bit platforms.

This PR gives up on this possiblity for two reasons:

* Based on discussion with @aturon, it seems that the portability lint is not happening any time soon. It’s better to have the conversions be available *at all* than keep blocking them for so long. Portability-lint-gated platform-specific APIs can always be added separately later.

* For code that is fine with fallibility, the alternative would force it to opt into "non-portability" even though there would be no real portability issue.

6 years agoAuto merge of #51428 - alexreg:uninitialized-statics-simplification, r=oli-obk
bors [Tue, 3 Jul 2018 02:01:49 +0000 (02:01 +0000)]
Auto merge of #51428 - alexreg:uninitialized-statics-simplification, r=oli-obk

Removed `uninitialized_statics` field from `Memory` struct in miri

based on #51110

r? @oli-obk

CC @eddyb

6 years agoAuto merge of #51991 - oli-obk:clippy, r=kennytm
bors [Mon, 2 Jul 2018 23:50:13 +0000 (23:50 +0000)]
Auto merge of #51991 - oli-obk:clippy, r=kennytm

Update the clippy submodule

nth time is the charm? `x.py test src/tools/clippy` passes locally

r? @kennytm

6 years agoChange --keep-stage to apply more
Mark Rousskov [Mon, 2 Jul 2018 22:04:58 +0000 (16:04 -0600)]
Change --keep-stage to apply more

Previously, the --keep-stage argument would only function for compilers
that were depended on by future stages. For example, if trying to build
a stage 1 compiler you could --keep-stage 0 to avoid re-building the
stage 0 compiler. However, this is often not what users want in
practice.

The new implementation essentially skips builds all higher stages of the
compiler, so an argument of 1 to keep-stage will skip rebuilds of the
libraries, just linking them into the sysroot. This is unlikely to work
well in cases where metadata or similar changes have been made, but is
likely fine otherwise.

This change is somewhat untested, but since it shouldn't have any effect
except with --keep-stage, I don't see that as a large problem.

6 years agoRun "tools" job on PR when commit message starts with "Update RLS/miri/..."
kennytm [Mon, 2 Jul 2018 22:01:58 +0000 (06:01 +0800)]
Run "tools" job on PR when commit message starts with "Update RLS/miri/..."

6 years agoFixed detection of test-fail for doctests.
kennytm [Mon, 2 Jul 2018 21:53:18 +0000 (05:53 +0800)]
Fixed detection of test-fail for doctests.

6 years agoFix the tool's path in toolstate verification.
kennytm [Mon, 2 Jul 2018 20:49:42 +0000 (04:49 +0800)]
Fix the tool's path in toolstate verification.

This ensure we do block the tools when they are broken during an update.

6 years agoMake explicit that assemble is not run from CLI
Mark Rousskov [Mon, 2 Jul 2018 20:46:40 +0000 (14:46 -0600)]
Make explicit that assemble is not run from CLI

6 years agoAuto merge of #51944 - MajorBreakfast:generic-future-obj, r=cramertj
bors [Mon, 2 Jul 2018 20:12:00 +0000 (20:12 +0000)]
Auto merge of #51944 - MajorBreakfast:generic-future-obj, r=cramertj

Make custom trait object for `Future` generic

- `TaskObj` -> `FutureObj<'static, ()>`
- The `impl From<...> for FutureObj<'a, T>` impls are impossible because of the type parameter `T`. The impl has to live in libstd, but `FutureObj<'a, T>` is from libcore. Therefore `Into<FutureObj<'a, T>>` was implemented instead. Edit: This didn‘t compile without warnings. I am now using non-generic Form impls.

See https://github.com/rust-lang-nursery/futures-rs/issues/1058

r? @cramertj

Edit: Added lifetime

6 years agoMake Stdio handle UnwindSafe
Evan Simmons [Sun, 1 Jul 2018 21:30:16 +0000 (14:30 -0700)]
Make Stdio handle UnwindSafe

6 years agoAuto merge of #51896 - nikomatsakis:nll-liveness-dirty-list, r=Zoxc
bors [Mon, 2 Jul 2018 18:09:20 +0000 (18:09 +0000)]
Auto merge of #51896 - nikomatsakis:nll-liveness-dirty-list, r=Zoxc

introduce dirty list to liveness, eliminate `ins` vector

At least in my measurements, this seems to knock much of the liveness computation off the profile.

r? @Zoxc
cc @nnethercote

6 years agoadd entry for cargo-metadata feature to RELEASES
Andy Russell [Mon, 2 Jul 2018 17:47:51 +0000 (13:47 -0400)]
add entry for cargo-metadata feature to RELEASES

6 years agoImplemented `UnsafeFutureObj` on `Box`
Josef Reinhard Brandl [Mon, 2 Jul 2018 17:21:32 +0000 (19:21 +0200)]
Implemented `UnsafeFutureObj` on `Box`

6 years agoImplement `UnsafeFutureObj` for `&mut Future`
Josef Reinhard Brandl [Mon, 2 Jul 2018 17:07:59 +0000 (19:07 +0200)]
Implement `UnsafeFutureObj` for `&mut Future`

6 years agoUpdate the clippy submodule
Oliver Schneider [Mon, 2 Jul 2018 17:07:35 +0000 (19:07 +0200)]
Update the clippy submodule

6 years agoRemove unnecessary `PhantomData` field
Josef Reinhard Brandl [Mon, 2 Jul 2018 16:57:58 +0000 (18:57 +0200)]
Remove unnecessary `PhantomData` field

6 years agoAdd explanation for custom trait object
Josef Reinhard Brandl [Mon, 2 Jul 2018 16:55:42 +0000 (18:55 +0200)]
Add explanation for custom trait object

6 years agobootstrap: tests should use rustc from config.toml
Nikolai Merinov [Sun, 1 Jul 2018 20:45:35 +0000 (01:45 +0500)]
bootstrap: tests should use rustc from config.toml

Tests should always use "rustc" and "cargo" from config.toml instead
of assuming that stage0 binaries was downloaded to build directory.

6 years agoAdd some more additional functions to the shim
est31 [Mon, 2 Jul 2018 09:55:52 +0000 (11:55 +0200)]
Add some more additional functions to the shim

They are all needed now due to the stdsimd update.

6 years agoUpdated miri submodule.
Alexander Regueiro [Mon, 2 Jul 2018 16:18:38 +0000 (17:18 +0100)]
Updated miri submodule.

6 years agoFix naming convention issue
Josef Reinhard Brandl [Mon, 2 Jul 2018 16:16:36 +0000 (18:16 +0200)]
Fix naming convention issue

6 years agoAuto merge of #51321 - zackmdavis:hiridification_generations, r=eddyb
bors [Mon, 2 Jul 2018 16:04:54 +0000 (16:04 +0000)]
Auto merge of #51321 - zackmdavis:hiridification_generations, r=eddyb

HirId-ification, continued

Another incremental step towards the vision of #50928 (previously: #50929).

r? @michaelwoerister

6 years agoadd outlives annotations to `BTreeMap`
Niko Matsakis [Tue, 20 Feb 2018 15:26:48 +0000 (10:26 -0500)]
add outlives annotations to `BTreeMap`

nll requires these annotations, I believe because of
https://github.com/rust-lang/rust/issues/29149

6 years agoimprove comments
Niko Matsakis [Mon, 2 Jul 2018 15:40:49 +0000 (11:40 -0400)]
improve comments

6 years agoFill in tracking issue number for read_exact_at/write_all_at
Dror Levin [Mon, 2 Jul 2018 14:38:15 +0000 (17:38 +0300)]
Fill in tracking issue number for read_exact_at/write_all_at

6 years agoincr.comp.: Take names of children into account when computing the ICH of a module...
Michael Woerister [Mon, 2 Jul 2018 14:21:34 +0000 (16:21 +0200)]
incr.comp.: Take names of children into account when computing the ICH of a module's HIR.

6 years agoRemoved `uninitialized_statics` field from `Memory` struct in miri.
Alexander Regueiro [Fri, 8 Jun 2018 02:47:26 +0000 (03:47 +0100)]
Removed `uninitialized_statics` field from `Memory` struct in miri.

Refactored code accordingly.

6 years agoAuto merge of #51122 - oli-obk:clippy, r=Mark-Simulacrum
bors [Mon, 2 Jul 2018 14:04:26 +0000 (14:04 +0000)]
Auto merge of #51122 - oli-obk:clippy, r=Mark-Simulacrum

Did you mean to block nightlies on clippy?

Discussion: https://gitter.im/rust-lang/WG-clippy?at=5b073b6597a0361fb760cdc2

r? @alexcrichton

did I forget anything?

cc @nrc @Manishearth

6 years agoMake `drop` method for `PinMut`'s `UnsafeFutureObj` impl empty
Josef Reinhard Brandl [Sun, 1 Jul 2018 13:27:53 +0000 (15:27 +0200)]
Make `drop` method for `PinMut`'s `UnsafeFutureObj` impl empty

6 years agoImprove doc comments for `FutureObj`
Josef Reinhard Brandl [Sun, 1 Jul 2018 12:58:40 +0000 (14:58 +0200)]
Improve doc comments for `FutureObj`

6 years ago`UnsafeFutureObj` impl for `PinMut`
Josef Reinhard Brandl [Sun, 1 Jul 2018 07:28:16 +0000 (09:28 +0200)]
`UnsafeFutureObj` impl for `PinMut`

6 years agoAdd lifetime to `FutureObj`
Josef Reinhard Brandl [Sat, 30 Jun 2018 19:16:44 +0000 (21:16 +0200)]
Add lifetime to `FutureObj`

6 years agoUse `From` impls for `FutureObj<()>`
Josef Reinhard Brandl [Sat, 30 Jun 2018 17:37:28 +0000 (19:37 +0200)]
Use `From` impls for `FutureObj<()>`

6 years agoMake custom trait object for `Future` generic
Josef Reinhard Brandl [Sat, 30 Jun 2018 15:26:38 +0000 (17:26 +0200)]
Make custom trait object for `Future` generic

6 years agoAuto merge of #51645 - marco-c:error_when_incremental_and_profile, r=michaelwoerister
bors [Mon, 2 Jul 2018 11:58:45 +0000 (11:58 +0000)]
Auto merge of #51645 - marco-c:error_when_incremental_and_profile, r=michaelwoerister

Raise an error if gcov profiling and incremental compilation are both enabled

Fixes #50203.

6 years agoClippy tool also has only a single LICENSE file
Oliver Schneider [Mon, 2 Jul 2018 11:57:29 +0000 (13:57 +0200)]
Clippy tool also has only a single LICENSE file

6 years agoUpdate stdsimd
est31 [Fri, 22 Jun 2018 00:02:51 +0000 (02:02 +0200)]
Update stdsimd

6 years agoEmit column info in debuginfo for non msvc like targets
est31 [Mon, 2 Jul 2018 09:40:32 +0000 (11:40 +0200)]
Emit column info in debuginfo for non msvc like targets

6 years agoUpdate rustdoc
Oliver Schneider [Mon, 2 Jul 2018 08:37:49 +0000 (10:37 +0200)]
Update rustdoc

6 years agoMake sure clippy does not duplicate depenencies
Oliver Schneider [Mon, 2 Jul 2018 08:36:07 +0000 (10:36 +0200)]
Make sure clippy does not duplicate depenencies

6 years agoAuto merge of #51893 - nnethercote:BTreeMap-clone-noalloc, r=nnethercote
bors [Mon, 2 Jul 2018 08:28:12 +0000 (08:28 +0000)]
Auto merge of #51893 - nnethercote:BTreeMap-clone-noalloc, r=nnethercote

Make `BTreeMap::clone()` not allocate when cloning an empty tree.

r? @Gankro

CC @porglezomp

6 years agoGet rid of `TyImplTraitExistential`
Oliver Schneider [Fri, 29 Jun 2018 08:58:17 +0000 (10:58 +0200)]
Get rid of `TyImplTraitExistential`

6 years agoAuto merge of #51931 - cramertj:rm-libbacktrace, r=alexcrichton
bors [Mon, 2 Jul 2018 06:32:16 +0000 (06:32 +0000)]
Auto merge of #51931 - cramertj:rm-libbacktrace, r=alexcrichton

Use in-tree libbacktrace on Fuchsia

cc @abarth

r? @alexcrichton
(welcome back! :smile: )

6 years agoadd FIXMEs pleading for post-@ edit of commentary on mem_categorization
Zack M. Davis [Sat, 2 Jun 2018 23:49:34 +0000 (16:49 -0700)]
add FIXMEs pleading for post-@ edit of commentary on mem_categorization

(The present author fears not being knowledgeable enough to rewrite the
comments unilaterally; merely calling it out is a lazy half-measure, but
at least doesn't actively make things worse the way an ill-informed
rewrite would.)

6 years agouse HirId in middle::mem_categorization::cmt_, and consequences of that
Zack M. Davis [Sun, 3 Jun 2018 01:50:40 +0000 (18:50 -0700)]
use HirId in middle::mem_categorization::cmt_, and consequences of that

For the HirIdification initiative #50928.

6 years agoAuto merge of #51866 - zackmdavis:hir_making_each_day_of_the_year, r=petrochenkov
bors [Mon, 2 Jul 2018 03:18:49 +0000 (03:18 +0000)]
Auto merge of #51866 - zackmdavis:hir_making_each_day_of_the_year, r=petrochenkov

add modifier keyword spans to hir::Visibility; improve unreachable-pub, private-no-mangle lint suggestions

#50455 pointed out that the unreachable-pub suggestion for brace-grouped `use`s was bogus; #50476 partially ameliorated this by marking the suggestion as `Applicability::MaybeIncorrect`, but this is the actual fix.

Meanwhile, another application of having spans available in `hir::Visibility` is found in the private-no-mangle lints, where we can now issue a suggestion to use `pub` if the item has a more restricted visibility marker (this seems much less likely to come up in practice than not having any visibility keyword at all, but thoroughness is a virtue). While we're there, we can also add a helpful note if the item does have a `pub` (but triggered the lint presumably because enclosing modules were private).

![hir_vis](https://user-images.githubusercontent.com/1076988/42018064-ca830290-7a65-11e8-9c4c-48bc846f861f.png)

r? @nrc
cc @Manishearth

6 years agoDo not suggest changes to str literal if it isn't one
Esteban Küber [Mon, 2 Jul 2018 03:03:35 +0000 (20:03 -0700)]
Do not suggest changes to str literal if it isn't one

6 years agoMake `BTreeMap::clone()` not allocate when cloning an empty tree.
Nicholas Nethercote [Fri, 29 Jun 2018 07:02:38 +0000 (17:02 +1000)]
Make `BTreeMap::clone()` not allocate when cloning an empty tree.

6 years agoAuto merge of #51864 - est31:libc_update, r=alexcrichton
bors [Mon, 2 Jul 2018 01:16:13 +0000 (01:16 +0000)]
Auto merge of #51864 - est31:libc_update, r=alexcrichton

Update liblibc

This updates the libc submodule

6 years agoAuto merge of #51110 - alexreg:new-static-eval-rules, r=eddyb
bors [Sun, 1 Jul 2018 23:00:27 +0000 (23:00 +0000)]
Auto merge of #51110 - alexreg:new-static-eval-rules, r=eddyb

Loosened rules involving statics mentioning other statics

Before this PR, trying to mention a static in any way other than taking a reference to it caused a compile-time error. So, while

```rust
static A: u32 = 42;
static B: &u32 = &A;
```

compiles successfully,

```rust
static A: u32 = 42;
static B: u32 = A; // error
```

and

```rust
static A: u32 = 42;
static B: u32 = *&A; // error
```

are not possible to express in Rust. On the other hand, introducing an intermediate `const fn` can presently allow one to do just that:

```rust
static A: u32 = 42;
static B: u32 = foo(&A); // success!

const fn foo(a: &u32) -> u32 {
    *a
}
```

Preventing `const fn` from allowing to work around the ban on reading from statics would cripple `const fn` almost into uselessness.
Additionally, the limitation for reading from statics comes from the old const evaluator(s) and is not shared by `miri`.

This PR loosens the rules around use of statics to allow statics to evaluate other statics by value, allowing all of the above examples to compile and run successfully.
Reads from extern (foreign) statics are however still disallowed by miri, because there is no compile-time value to be read.

```rust
extern static A: u32;

static B: u32 = A; // error
```

This opens up a new avenue of potential issues, as a static can now not just refer to other statics or read from other statics, but even contain references that point into itself.
While it might seem like this could cause subtle bugs like allowing a static to be initialized by its own value, this is inherently impossible in miri.
Reading from a static causes the `const_eval` query for that static to be invoked. Calling the `const_eval` query for a static while already inside the `const_eval` query of said static will cause cycle errors.
It is not possible to accidentally create a bug in miri that would enable initializing a static with itself, because the memory of the static *does not exist* while being initialized.
The memory is not uninitialized, it is not there. Thus any change that would accidentally allow reading from a not yet initialized static would cause ICEs.

Tests have been modified according to the new rules, and new tests have been added for writing to `static mut`s within definitions of statics (which needs to fail), and incremental compilation with complex/interlinking static definitions.
Note that incremental compilation did not need to be adjusted, because all of this was already possible before with workarounds (like intermediate `const fn`s) and the encoding/decoding already supports all the possible cases.

r? @eddyb

6 years agoAuto merge of #51969 - pietroalbini:rollup, r=pietroalbini
bors [Sun, 1 Jul 2018 20:48:57 +0000 (20:48 +0000)]
Auto merge of #51969 - pietroalbini:rollup, r=pietroalbini

Rollup of 7 pull requests

Successful merges:

 - #51511 (Stabilize Iterator::flatten in 1.29, fixes #48213.)
 - #51853 (Fix some doc links)
 - #51890 (Fix inconsequential typo in GlobalAlloc doc example)
 - #51920 (use literal span for concrete type suggestion)
 - #51921 (improve the error message when `#[panic_implementation]` is missing)
 - #51922 (rename the llvm-tools component to llvm-tools-preview and tweak its image)
 - #51961 (Fix typo in /src/librustc_resolve/lib.rs)

Failed merges:

r? @ghost

6 years agoRollup merge of #51961 - 11Takanori:fix-typo, r=petrochenkov
Pietro Albini [Sun, 1 Jul 2018 19:18:51 +0000 (21:18 +0200)]
Rollup merge of #51961 - 11Takanori:fix-typo, r=petrochenkov

Fix typo in /src/librustc_resolve/lib.rs

absoluate -> absolute

6 years agoRollup merge of #51922 - japaric:llvm-tools-preview, r=alexcrichton
Pietro Albini [Sun, 1 Jul 2018 19:18:50 +0000 (21:18 +0200)]
Rollup merge of #51922 - japaric:llvm-tools-preview, r=alexcrichton

rename the llvm-tools component to llvm-tools-preview and tweak its image

as per https://github.com/rust-lang/rust/issues/49584#issuecomment-401217483

r? @alexcrichton or @Mark-Simulacrum

6 years agoRollup merge of #51921 - japaric:panic-impl-error, r=nagisa
Pietro Albini [Sun, 1 Jul 2018 19:18:49 +0000 (21:18 +0200)]
Rollup merge of #51921 - japaric:panic-impl-error, r=nagisa

improve the error message when `#[panic_implementation]` is missing

closes #51341

r? @nagisa
cc @phil-opp

6 years agoRollup merge of #51920 - euclio:concrete-type-suggestion, r=estebank
Pietro Albini [Sun, 1 Jul 2018 19:18:47 +0000 (21:18 +0200)]
Rollup merge of #51920 - euclio:concrete-type-suggestion, r=estebank

use literal span for concrete type suggestion

Fixes #51874.

r? @estebank

6 years agoRollup merge of #51890 - Ixrec:patch-3, r=alexcrichton
Pietro Albini [Sun, 1 Jul 2018 19:18:46 +0000 (21:18 +0200)]
Rollup merge of #51890 - Ixrec:patch-3, r=alexcrichton

Fix inconsequential typo in GlobalAlloc doc example

6 years agoRollup merge of #51853 - MajorBreakfast:fix-doc-links, r=cramertj
Pietro Albini [Sun, 1 Jul 2018 19:18:45 +0000 (21:18 +0200)]
Rollup merge of #51853 - MajorBreakfast:fix-doc-links, r=cramertj

Fix some doc links

The futures crate CI always fails because of these intra doc links. I hope that this will fix this issue.

r? @steveklabnik
@cramertj

Edit: I added @steveklabnik as reviewer because this PR also adjusts a link in `src/libstd/error.rs`

6 years agoRollup merge of #51511 - Centril:feature/stabilize_iterator_flatten, r=SimonSapin
Pietro Albini [Sun, 1 Jul 2018 19:18:43 +0000 (21:18 +0200)]
Rollup merge of #51511 - Centril:feature/stabilize_iterator_flatten, r=SimonSapin

Stabilize Iterator::flatten in 1.29, fixes #48213.

This PR stabilizes [`Iterator::flatten`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.flatten) in *version 1.29* (1.28 goes to beta in 10 days, I don't think there's enough time to land it in that time, but let's see...).

Tracking issue is:  #48213.

cc @bluss re. itertools.
r? @SimonSapin
ping @pietroalbini -- let's do a crater run when this passes CI :)

6 years agoAuto merge of #51833 - wesleywiser:faster_large_constant_arrays, r=oli-obk
bors [Sun, 1 Jul 2018 18:43:41 +0000 (18:43 +0000)]
Auto merge of #51833 - wesleywiser:faster_large_constant_arrays, r=oli-obk

Speed up compilation of large constant arrays

This is a different approach to #51672 as suggested by @oli-obk. Rather
than write each repeated value one-by-one, we write the first one and
then copy its value directly into the remaining memory.

With this change, the [toy program](https://github.com/rust-lang/rust/blob/c2f4744d2db4e162df824d0bd0b093ba4b351545/src/test/run-pass/mir_heavy_promoted.rs) goes from 63 seconds to 19 seconds on my machine.

Edit: Inlining `Size::bytes()` saves an additional 6 seconds dropping the total time to 13 seconds on my machine.

Edit2: Now down to 2.8 seconds.

r? @oli-obk

cc @nnethercote @eddyb

6 years agoUpdate liblibc
est31 [Thu, 28 Jun 2018 05:26:01 +0000 (07:26 +0200)]
Update liblibc

6 years agocall it `hir::VisibilityKind` instead of `hir::Visibility_:*`
Zack M. Davis [Sun, 1 Jul 2018 18:05:10 +0000 (11:05 -0700)]
call it `hir::VisibilityKind` instead of `hir::Visibility_:*`

It was pointed out in review that the glob-exported
underscore-suffixed convention for `Spanned` HIR nodes is no longer
preferred: see February 2016's #31487 for AST's migration away from
this style towards properly namespaced NodeKind enums.

This concerns #51968.

6 years agoAuto merge of #51536 - davidtwco:nll-dyn-trait-underscore-error-improvements, r=nikom...
bors [Sun, 1 Jul 2018 15:49:48 +0000 (15:49 +0000)]
Auto merge of #51536 - davidtwco:nll-dyn-trait-underscore-error-improvements, r=nikomatsakis

NLL: bad error message when converting anonymous lifetime to `'static`

Contributes to #46983. This PR doesn't introduce fantastic errors, but it should hopefully lay some groundwork for diagnostic improvements.
r? @nikomatsakis

6 years agoUpdated affected tests after rebase.
David Wood [Fri, 29 Jun 2018 23:10:00 +0000 (00:10 +0100)]
Updated affected tests after rebase.

6 years agoFix infinite loops when regions are self-referential.
David Wood [Fri, 29 Jun 2018 21:17:35 +0000 (22:17 +0100)]
Fix infinite loops when regions are self-referential.

6 years agoWIP boring() long line
Niko Matsakis [Thu, 28 Jun 2018 19:00:00 +0000 (15:00 -0400)]
WIP boring() long line

6 years agoEnsure that changed errors are lower case.
David Wood [Wed, 27 Jun 2018 20:18:07 +0000 (21:18 +0100)]
Ensure that changed errors are lower case.

6 years agoUpdated affected tests.
David Wood [Tue, 26 Jun 2018 22:30:52 +0000 (23:30 +0100)]
Updated affected tests.

6 years agoIntroduce new categories and show a reasonable error message.
David Wood [Tue, 26 Jun 2018 22:00:24 +0000 (23:00 +0100)]
Introduce new categories and show a reasonable error message.

6 years agoMoved region inference error reporting into own module.
David Wood [Wed, 20 Jun 2018 20:34:34 +0000 (21:34 +0100)]
Moved region inference error reporting into own module.

6 years agoSwitched to while let in DFS and deriving Ord on ConstraintCategory.
David Wood [Wed, 20 Jun 2018 20:11:27 +0000 (21:11 +0100)]
Switched to while let in DFS and deriving Ord on ConstraintCategory.

6 years agoConstraints are now being categorized, sorted and the error labelled. Categorization...
David Wood [Tue, 12 Jun 2018 19:43:14 +0000 (20:43 +0100)]
Constraints are now being categorized, sorted and the error labelled. Categorization needs a bit of work.

6 years agoAdd two regression tests for const eval
Wesley Wiser [Sat, 30 Jun 2018 19:25:07 +0000 (15:25 -0400)]
Add two regression tests for const eval

6 years agoAdded bfs for constraint paths from regions.
David Wood [Mon, 11 Jun 2018 22:07:54 +0000 (23:07 +0100)]
Added bfs for constraint paths from regions.

6 years agodon't consider assignments to temporaries "interesting"
Niko Matsakis [Tue, 5 Jun 2018 10:13:28 +0000 (06:13 -0400)]
don't consider assignments to temporaries "interesting"

6 years agopropagate boring vs interesting causal info for constraints/tests
Niko Matsakis [Mon, 4 Jun 2018 16:25:12 +0000 (12:25 -0400)]
propagate boring vs interesting causal info for constraints/tests

6 years agocategorize `Locations` as interesting or boring
Niko Matsakis [Mon, 4 Jun 2018 15:19:43 +0000 (11:19 -0400)]
categorize `Locations` as interesting or boring

6 years agoremove the `at_location` from Locations
Niko Matsakis [Mon, 4 Jun 2018 13:29:36 +0000 (09:29 -0400)]
remove the `at_location` from Locations

We are not currently using it for anything; even polonius just uses
the `from_location`.

6 years agoupdate mir-opt tests
Niko Matsakis [Fri, 29 Jun 2018 14:04:17 +0000 (10:04 -0400)]
update mir-opt tests

6 years agoremove the `ins` set altogether
Niko Matsakis [Fri, 29 Jun 2018 10:47:12 +0000 (06:47 -0400)]
remove the `ins` set altogether

6 years agorename `ToLocations` to `NormalizeLocation`
Niko Matsakis [Mon, 4 Jun 2018 12:53:34 +0000 (08:53 -0400)]
rename `ToLocations` to `NormalizeLocation`

6 years agoAuto merge of #51883 - estebank:placement-suggestion, r=varkor
bors [Sun, 1 Jul 2018 13:37:05 +0000 (13:37 +0000)]
Auto merge of #51883 - estebank:placement-suggestion, r=varkor

Suggest correct comparison against negative literal

When parsing as emplacement syntax (`x<-1`), suggest the correct syntax
for comparison against a negative value (`x< -1`).

Fix #45651.

6 years agoUpdate clippy submodule
Oliver Schneider [Sun, 1 Jul 2018 11:39:27 +0000 (13:39 +0200)]
Update clippy submodule

6 years agoAuto merge of #51855 - Eh2406:i51821, r=nikomatsakis
bors [Sun, 1 Jul 2018 10:41:51 +0000 (10:41 +0000)]
Auto merge of #51855 - Eh2406:i51821, r=nikomatsakis

A fix for 51821

This dedupe the vec of `OutlivesConstraint` using a `FxHashSet<(RegionVid, RegionVid)>` it alsow adds a `struct ConstraintSet` to encapsulate/ensure this behavere.

6 years agoremove the FxHashSet since it's not helping us in practice
Niko Matsakis [Sun, 1 Jul 2018 09:51:33 +0000 (05:51 -0400)]
remove the FxHashSet since it's not helping us in practice

It turns out that we don't have duplicates, just self-cycles.

6 years agouse `WorkQueue` to track dirty bits in liveness
Niko Matsakis [Fri, 29 Jun 2018 10:38:56 +0000 (06:38 -0400)]
use `WorkQueue` to track dirty bits in liveness