]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAttempt to clarify LTO and codegen-units.
Eric Huss [Sat, 2 Nov 2019 16:47:14 +0000 (09:47 -0700)]
Attempt to clarify LTO and codegen-units.

4 years agoBe more specific with -C inline-threshold.
Eric Huss [Sat, 26 Oct 2019 16:05:06 +0000 (09:05 -0700)]
Be more specific with -C inline-threshold.

4 years agoApply suggestions from kinnison
Eric Huss [Sat, 26 Oct 2019 16:05:57 +0000 (09:05 -0700)]
Apply suggestions from kinnison

Co-Authored-By: Daniel Silverstone <dsilvers@digital-scurf.org>
4 years agoUpdate codegen option documentation.
Eric Huss [Sat, 5 Oct 2019 16:58:51 +0000 (09:58 -0700)]
Update codegen option documentation.

4 years agoAuto merge of #65758 - RalfJung:miri, r=oli-obk
bors [Sat, 26 Oct 2019 09:19:48 +0000 (09:19 +0000)]
Auto merge of #65758 - RalfJung:miri, r=oli-obk

update Miri

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

4 years agoupdate miri
Ralf Jung [Sat, 26 Oct 2019 08:14:56 +0000 (10:14 +0200)]
update miri

4 years agouse plain cargo to install xargo
Ralf Jung [Fri, 25 Oct 2019 07:22:17 +0000 (09:22 +0200)]
use plain cargo to install xargo

4 years agobootstrap now takes care of installing xargo
Ralf Jung [Thu, 24 Oct 2019 13:39:20 +0000 (15:39 +0200)]
bootstrap now takes care of installing xargo

4 years agoupdate Miri
Ralf Jung [Thu, 24 Oct 2019 10:04:05 +0000 (12:04 +0200)]
update Miri

4 years agoAuto merge of #63812 - eddyb:promo-sanity, r=oli-obk
bors [Sat, 26 Oct 2019 00:11:36 +0000 (00:11 +0000)]
Auto merge of #63812 - eddyb:promo-sanity, r=oli-obk

rustc_mir: double-check const-promotion candidates for sanity.

Previously, const promotion involved tracking information about the value in a MIR local (or any part of the computation leading up to that value), aka "qualifs", in a quite stateful manner, which is hard to extend to arbitrary CFGs without a dataflow pass.

However, the nature of the promotion we do is that it's effectively an SSA-like "tree" (or DAG, really), of assigned-once locals - which is how we can take them from the original MIR in the first place.
This structure means that the subset of the MIR responsible for computing any given part of a const-promoted value is readily analyzable by walking that tree/DAG.

This PR implements such an analysis in `promote_consts`, reusing the `HasMutInterior` / `NeedsDrop` computation from `qualify_consts`, but reimplementing the equivalent of `IsNotPromotable` / `IsNotImplicitlyPromotable`.

Eventually we should be able to remove `IsNotPromotable` / `IsNotImplicitlyPromotable` from `qualify_consts`, which will simplify @ecstatic-morse's dataflow-based const-checking efforts.

But currently this is mainly for a crater check-only run - it will compare the results from the old promotion collection and the new promotion validation and ICE if they don't match.

r? @oli-obk

4 years agorustc_mir: use the new validator's Qualif in promotion.
Eduard-Mihai Burtescu [Mon, 21 Oct 2019 18:18:12 +0000 (21:18 +0300)]
rustc_mir: use the new validator's Qualif in promotion.

4 years agorustc_mir: double-check const-promotion candidates for sanity.
Eduard-Mihai Burtescu [Wed, 21 Aug 2019 20:31:58 +0000 (23:31 +0300)]
rustc_mir: double-check const-promotion candidates for sanity.

4 years agoAuto merge of #65826 - JohnTitor:rollup-mr6crka, r=JohnTitor
bors [Fri, 25 Oct 2019 20:41:28 +0000 (20:41 +0000)]
Auto merge of #65826 - JohnTitor:rollup-mr6crka, r=JohnTitor

Rollup of 6 pull requests

Successful merges:

 - #65705 (Add {String,Vec}::into_raw_parts)
 - #65749 (Insurance policy in case `iter.size_hint()` lies.)
 - #65799 (Fill tracking issue number for `array_value_iter`)
 - #65800 (self-profiling: Update measureme to 0.4.0 and remove non-RAII methods from profiler.)
 - #65806 (Add [T]::as_ptr_range() and [T]::as_mut_ptr_range().)
 - #65810 (SGX: Clear additional flag on enclave entry)

Failed merges:

r? @ghost

4 years agoRollup merge of #65810 - raoulstrackx:ac_mitigation, r=nagisa
Yuki Okushi [Fri, 25 Oct 2019 17:46:02 +0000 (02:46 +0900)]
Rollup merge of #65810 - raoulstrackx:ac_mitigation, r=nagisa

SGX: Clear additional flag on enclave entry

An attacker could set both the AC flag in CR0 as in rflags. This causes the enclave to perform an AEX upon a misaligned memory access, and an attacker learns some information about the internal enclave state.
The AC flag in rflags is copied from userspace upon an enclave entry. Upon AEX it is copied and later restored. This patch forces the rflag.AC bit to be reset right after an enter.

4 years agoRollup merge of #65806 - fusion-engineering-forks:slice-ptr-range, r=Centril
Yuki Okushi [Fri, 25 Oct 2019 17:46:01 +0000 (02:46 +0900)]
Rollup merge of #65806 - fusion-engineering-forks:slice-ptr-range, r=Centril

Add [T]::as_ptr_range() and [T]::as_mut_ptr_range().

Implementation of https://github.com/rust-lang/rfcs/pull/2791

4 years agoRollup merge of #65800 - michaelwoerister:measureme-0.4.0, r=wesleywiser
Yuki Okushi [Fri, 25 Oct 2019 17:45:59 +0000 (02:45 +0900)]
Rollup merge of #65800 - michaelwoerister:measureme-0.4.0, r=wesleywiser

self-profiling: Update measureme to 0.4.0 and remove non-RAII methods from profiler.

This PR removes all non-RAII based profiling methods from `SelfProfilerRef` :tada:
It also delegates the `TimingGuard` implementation to `measureme`, now that that is available there.

r? @wesleywiser

4 years agoRollup merge of #65799 - LukasKalbertodt:fill-array-value-iter-tracking-issue, r...
Yuki Okushi [Fri, 25 Oct 2019 17:45:58 +0000 (02:45 +0900)]
Rollup merge of #65799 - LukasKalbertodt:fill-array-value-iter-tracking-issue, r=Centril

Fill tracking issue number for `array_value_iter`

Thanks for [noticing](https://github.com/rust-lang/rust/pull/62959#discussion_r338930448)!

r? @Centril

4 years agoRollup merge of #65749 - Centril:insurance-policy, r=RalfJung
Yuki Okushi [Fri, 25 Oct 2019 17:45:57 +0000 (02:45 +0900)]
Rollup merge of #65749 - Centril:insurance-policy, r=RalfJung

Insurance policy in case `iter.size_hint()` lies.

Follow up to https://github.com/rust-lang/rust/pull/64949/files#r334235076.
(If the perf impact is bad we can use `debug_assert!` instead.)

The good news is that the UI tests pass locally so `iter.size_hint()` seems to be honest *thus far*.
On the other hand, with the status quo we do not have an insurance policy should that change in some case. This is problematic because a) this could possibly make some program be accepted which shouldn't, b) the compiler itself could have memory unsafety if the correctness of the iterator is assumed in `unsafe { ... }` code (even though the blame lies with the `unsafe { ... }` block in question.)

r? @RalfJung
cc @nnethercote

4 years agoRollup merge of #65705 - shepmaster:vec-into-raw, r=SimonSapin
Yuki Okushi [Fri, 25 Oct 2019 17:45:56 +0000 (02:45 +0900)]
Rollup merge of #65705 - shepmaster:vec-into-raw, r=SimonSapin

Add {String,Vec}::into_raw_parts

Aspects to address:

- [x] Create a tracking issue
  - #65816

4 years agoFix slice::as_ptr_range doctest.
Mara Bos [Fri, 25 Oct 2019 15:22:03 +0000 (17:22 +0200)]
Fix slice::as_ptr_range doctest.

4 years agoTake out an insurance policy in case `iter.size_hint()`
Mazdak Farrokhzad [Thu, 24 Oct 2019 01:21:23 +0000 (03:21 +0200)]
Take out an insurance policy in case `iter.size_hint()`
lies, underreporting the number of elements.

4 years agoAdd {String,Vec}::into_raw_parts
Jake Goulding [Tue, 22 Oct 2019 16:48:52 +0000 (12:48 -0400)]
Add {String,Vec}::into_raw_parts

4 years agoUse ManuallyDrop in examples for {Vec,String}::from_raw_parts
Jake Goulding [Tue, 22 Oct 2019 19:40:22 +0000 (15:40 -0400)]
Use ManuallyDrop in examples for {Vec,String}::from_raw_parts

4 years agoRemove unneeded pointer casting
Jake Goulding [Tue, 22 Oct 2019 17:54:09 +0000 (13:54 -0400)]
Remove unneeded pointer casting

4 years agoforgot pushfq/popqfq: fixed
Raoul Strackx [Fri, 25 Oct 2019 14:06:13 +0000 (16:06 +0200)]
forgot pushfq/popqfq: fixed

4 years agoExplain why pointer::add in slice::as_ptr_range is safe.
Mara Bos [Fri, 25 Oct 2019 13:21:00 +0000 (15:21 +0200)]
Explain why pointer::add in slice::as_ptr_range is safe.

4 years agocleaning up code
Raoul Strackx [Fri, 25 Oct 2019 13:44:07 +0000 (15:44 +0200)]
cleaning up code

4 years agoremoved unnecessary push
Raoul Strackx [Fri, 25 Oct 2019 13:27:48 +0000 (15:27 +0200)]
removed unnecessary push

4 years agoAdd slice_ptr_range tracking issue number.
Mara Bos [Fri, 25 Oct 2019 12:33:07 +0000 (14:33 +0200)]
Add slice_ptr_range tracking issue number.

4 years agoAdd [T]::as_ptr_range() and [T]::as_mut_ptr_range().
Mara Bos [Fri, 25 Oct 2019 12:07:08 +0000 (14:07 +0200)]
Add [T]::as_ptr_range() and [T]::as_mut_ptr_range().

See https://github.com/rust-lang/rfcs/pull/2791 for motivation.

4 years agoAuto merge of #65804 - Centril:rollup-arlxgch, r=Centril
bors [Fri, 25 Oct 2019 11:13:30 +0000 (11:13 +0000)]
Auto merge of #65804 - Centril:rollup-arlxgch, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #64639 (Stabilize `#[non_exhaustive]` (RFC 2008))
 - #65074 (Fix the start/end byte positions in the compiler JSON output)
 - #65315 (Intern place projection)
 - #65685 (Fix check of `statx` and handle EPERM)
 - #65731 (Prevent unnecessary allocation in PathBuf::set_extension.)
 - #65740 (Fix default "disable-shortcuts" feature value)
 - #65787 (move panictry! to where it is used.)
 - #65789 (move Attribute::with_desugared_doc to librustdoc)
 - #65790 (move report_invalid_macro_expansion_item to item.rs)

Failed merges:

r? @ghost

4 years agoRollup merge of #65790 - Centril:move-report-invalid, r=davidtwco
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:55 +0000 (13:12 +0200)]
Rollup merge of #65790 - Centril:move-report-invalid, r=davidtwco

move report_invalid_macro_expansion_item to item.rs

From https://github.com/rust-lang/rust/pull/65324.

r? @Mark-Simulacrum

4 years agoRollup merge of #65789 - Centril:with-desugared-doc, r=davidtwco
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:54 +0000 (13:12 +0200)]
Rollup merge of #65789 - Centril:with-desugared-doc, r=davidtwco

move Attribute::with_desugared_doc to librustdoc

From https://github.com/rust-lang/rust/pull/65324.

r? @varkor

4 years agoRollup merge of #65787 - Centril:panictry, r=davidtwco
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:53 +0000 (13:12 +0200)]
Rollup merge of #65787 - Centril:panictry, r=davidtwco

move panictry! to where it is used.

From https://github.com/rust-lang/rust/pull/65324

r? @davidtwco

4 years agoRollup merge of #65740 - GuillaumeGomez:fix-disable-shortcut-feature, r=Dylan-DPC
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:51 +0000 (13:12 +0200)]
Rollup merge of #65740 - GuillaumeGomez:fix-disable-shortcut-feature, r=Dylan-DPC

Fix default "disable-shortcuts" feature value

Follow-up of https://github.com/rust-lang/rust/pull/65656

It fixes the bad handling of the default value of the feature (which would disable shortcut by default, which is bad!).

r? @Dylan-DPC
cc @kinnison

4 years agoRollup merge of #65731 - fusion-engineering-forks:set-extension, r=dtolnay
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:50 +0000 (13:12 +0200)]
Rollup merge of #65731 - fusion-engineering-forks:set-extension, r=dtolnay

Prevent unnecessary allocation in PathBuf::set_extension.

It was allocating a new `OsString` that was immediately dropped after using it with `set_file_name`. Now it directly changes the extension in the original buffer, without touching the rest of the file name or allocating a temporary string.

4 years agoRollup merge of #65685 - oxalica:statx-eperm, r=alexcrichton
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:48 +0000 (13:12 +0200)]
Rollup merge of #65685 - oxalica:statx-eperm, r=alexcrichton

Fix check of `statx` and handle EPERM

Should fix #65662

https://github.com/rust-lang/rust/issues/65662#issuecomment-544593939
> I think a reasonable solution might be to do something like try to stat AT_CWD initially and if that fails with EPERM or ENOSYS we disable the syscall entirely, otherwise it's cached as always good to use.

r? @alexcrichton

4 years agoRollup merge of #65315 - spastorino:intern-place-projection, r=oli-obk
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:46 +0000 (13:12 +0200)]
Rollup merge of #65315 - spastorino:intern-place-projection, r=oli-obk

Intern place projection

This should sit on top of https://github.com/rust-lang/rust/pull/65197. After that one merged, I'm gonna rebase on top of it.

The important commits are the last three and there's a bunch of code repetition that I'm going to remove but for that I need to refactor some things that probably need to be added before this PR.

Anyway this work helps as is because we can run perf tests :).

r? @oli-obk /cc @nikomatsakis

4 years agoRollup merge of #65074 - Rantanen:json-byte-pos, r=matklad
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:45 +0000 (13:12 +0200)]
Rollup merge of #65074 - Rantanen:json-byte-pos, r=matklad

Fix the start/end byte positions in the compiler JSON output

Track the changes made during normalization in the `SourceFile` and use this information to correct the `start_byte` and `end_byte` fields in the JSON output.

This should ensure the start/end byte fields can be used to index the original file, even if Rust normalized the source code for parsing purposes. Both CRLF to LF and BOM removal are handled with this one.

The rough plan was discussed with @matklad in rust-lang-nursery/rustfix#176 - although I ended up going with `u32` offset tracking so I wouldn't need to deal with `u32 + i32` arithmetics when applying the offset to the span byte positions.

Fixes #65029

4 years agoRollup merge of #64639 - davidtwco:rfc-2008-stabilization, r=Centril
Mazdak Farrokhzad [Fri, 25 Oct 2019 11:12:43 +0000 (13:12 +0200)]
Rollup merge of #64639 - davidtwco:rfc-2008-stabilization, r=Centril

Stabilize `#[non_exhaustive]` (RFC 2008)

Fixes #44109.

This pull request stabilizes the `#[non_exhaustive]` attribute, which is used to indicate that a type will have more fields / variants added in the future. It can be applied to `struct`s, `enum`s and `enum` variants. See https://github.com/rust-lang/rust/issues/44109#issuecomment-533356866 for the stabilization report.

r? @Centril

4 years agoFill tracking issue number for `array_value_iter` and fix Rust version
Lukas Kalbertodt [Fri, 25 Oct 2019 08:50:21 +0000 (10:50 +0200)]
Fill tracking issue number for `array_value_iter` and fix Rust version

4 years agoself-profiling: Switch query-blocking measurements to RAII-style API.
Michael Woerister [Thu, 24 Oct 2019 15:37:48 +0000 (17:37 +0200)]
self-profiling: Switch query-blocking measurements to RAII-style API.

4 years agowith_desugared_doc: correctly refer to `attr` instead of `self`
Mazdak Farrokhzad [Fri, 25 Oct 2019 08:43:08 +0000 (10:43 +0200)]
with_desugared_doc: correctly refer to `attr` instead of `self`

Co-Authored-By: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
4 years agoRFC 2008: Stabilization
David Wood [Fri, 20 Sep 2019 20:09:39 +0000 (21:09 +0100)]
RFC 2008: Stabilization

This commit stabilizes RFC 2008 (#44109) by removing the feature gate.

Signed-off-by: David Wood <david@davidtw.co>
4 years agoAuto merge of #65764 - Manishearth:clippyup, r=Manishearth
bors [Fri, 25 Oct 2019 07:47:13 +0000 (07:47 +0000)]
Auto merge of #65764 - Manishearth:clippyup, r=Manishearth

Update clippy

Fixes #65754

r? @ghost

4 years agoAuto merge of #65793 - Centril:rollup-v40xke9, r=Centril
bors [Fri, 25 Oct 2019 04:24:40 +0000 (04:24 +0000)]
Auto merge of #65793 - Centril:rollup-v40xke9, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #62959 (Add by-value iterator for arrays )
 - #65390 (Add long error explanation for E0576)
 - #65408 (reorder config.toml.example options and add one missing option)
 - #65414 (ignore uninhabited non-exhaustive variant fields)
 - #65666 (Deprecated proc_macro doesn't trigger warning on build library)
 - #65742 (Pre-expansion gate most of the things)
 - #65747 (Adjust the tracking issue for `untagged_unions`.)
 - #65763 (Changed APIT with explicit generic args span to specific arg spans)
 - #65775 (Fix more `ReEmpty` ICEs)

Failed merges:

 - #65519 (trait-based structural match implementation)

r? @ghost

4 years agoRollup merge of #65775 - matthewjasper:reempty, r=pnkfelix
Mazdak Farrokhzad [Fri, 25 Oct 2019 04:18:14 +0000 (06:18 +0200)]
Rollup merge of #65775 - matthewjasper:reempty, r=pnkfelix

Fix more `ReEmpty` ICEs

closes #65553

r? @pnkfelix

4 years agoRollup merge of #65763 - ObsidianMinor:diag/65642, r=varkor
Mazdak Farrokhzad [Fri, 25 Oct 2019 04:18:12 +0000 (06:18 +0200)]
Rollup merge of #65763 - ObsidianMinor:diag/65642, r=varkor

Changed APIT with explicit generic args span to specific arg spans

Fixes #65642.

4 years agoRollup merge of #65747 - Centril:union-issue-fix, r=varkor
Mazdak Farrokhzad [Fri, 25 Oct 2019 04:18:11 +0000 (06:18 +0200)]
Rollup merge of #65747 - Centril:union-issue-fix, r=varkor

Adjust the tracking issue for `untagged_unions`.

Makes https://github.com/rust-lang/rust/issues/55149 the new tracking issue for `untagged_unions`.
Closes https://github.com/rust-lang/rust/issues/32836 which is the old tracking issue.

r? @varkor

4 years agoRollup merge of #65742 - Centril:gate-pre-expansion-subset, r=davidtwco
Mazdak Farrokhzad [Fri, 25 Oct 2019 04:18:09 +0000 (06:18 +0200)]
Rollup merge of #65742 - Centril:gate-pre-expansion-subset, r=davidtwco

Pre-expansion gate most of the things

This is a subset of https://github.com/rust-lang/rust/pull/64672. A crater run has already been done and this PR implements conclusions according to https://github.com/rust-lang/rust/pull/64672#issuecomment-542703363.

r? @davidtwco
cc @petrochenkov

4 years agoRollup merge of #65666 - XiangQingW:proc_macro, r=petrochenkov
Mazdak Farrokhzad [Fri, 25 Oct 2019 04:18:08 +0000 (06:18 +0200)]
Rollup merge of #65666 - XiangQingW:proc_macro, r=petrochenkov

Deprecated proc_macro doesn't trigger warning on build library

Fix #65189

4 years agoRollup merge of #65414 - davidtwco:issue-65157-non-exhaustive-always-useful, r=varkor
Mazdak Farrokhzad [Fri, 25 Oct 2019 04:18:06 +0000 (06:18 +0200)]
Rollup merge of #65414 - davidtwco:issue-65157-non-exhaustive-always-useful, r=varkor

ignore uninhabited non-exhaustive variant fields

Fixes #65157.

This PR modifies the uninhabitedness checking so that the fields of
a non-exhaustive variant (which is not local) are ignored if they are
uninhabited. This is an improvement over the previous behaviour which
considered all non-local non-exhaustive variants useful because
unreachable patterns are now detected.

r? @arielb1
cc @varkor

4 years agoRollup merge of #65408 - guanqun:remove-rust-optimize, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 25 Oct 2019 04:18:04 +0000 (06:18 +0200)]
Rollup merge of #65408 - guanqun:remove-rust-optimize, r=Mark-Simulacrum

reorder config.toml.example options and add one missing option

r? @Mark-Simulacrum

4 years agoRollup merge of #65390 - GuillaumeGomez:long-err-explanation-E0576, r=matthewjasper...
Mazdak Farrokhzad [Fri, 25 Oct 2019 04:18:02 +0000 (06:18 +0200)]
Rollup merge of #65390 - GuillaumeGomez:long-err-explanation-E0576, r=matthewjasper,kinnison

Add long error explanation for E0576

Part of #61137.

4 years agoRollup merge of #62959 - LukasKalbertodt:array-value-iter, r=scottmcm
Mazdak Farrokhzad [Fri, 25 Oct 2019 04:18:01 +0000 (06:18 +0200)]
Rollup merge of #62959 - LukasKalbertodt:array-value-iter, r=scottmcm

Add by-value iterator for arrays

This adds an iterator that can iterate over arrays by value, yielding all elements by value. However, **this PR does _not_ add a corresponding `IntoIterator` impl for arrays**. The `IntoIterator` impl needs some discussion about backwards-compatibility that should take place in a separate PR. With this patch, this code should work (but there is currently still a bug):

```rust
#![feature(array_value_iter)]
use std::array::IntoIter;

let arr = [1, 2, 3];
for x in IntoIter::new(arr) {
    println!("{}", x);
}
```

**TODO**:
- [x] Get initial feedback
- [x] Add tests
- [x] Figure out why stage1 produces weird bugs ([comment](https://github.com/rust-lang/rust/pull/62959#issuecomment-516016524))
- [x] Add UI tests as mentioned [here](https://github.com/rust-lang/rust/pull/62959#discussion_r307061894) (will do that soon-ish)
- [x] Fix [this new bug](https://github.com/rust-lang/rust/pull/62959#issuecomment-544732159)

**Notes for reviewers**
- Is the use of `MaybeUninit` correct here? I think it has to be used due to the `Clone` impl which has to fill the dead array elements with something, but cannot fill it with a correct instance.
- Are the unit tests sufficient?

CC #25725

4 years agomove report_invalid_macro_expansion_item to item.rs
Mazdak Farrokhzad [Fri, 25 Oct 2019 02:55:51 +0000 (04:55 +0200)]
move report_invalid_macro_expansion_item to item.rs

4 years agomove Attribute::with_desugared_doc to librustdoc
Mazdak Farrokhzad [Fri, 11 Oct 2019 12:01:02 +0000 (14:01 +0200)]
move Attribute::with_desugared_doc to librustdoc

4 years agomove panictry! to where it is used.
Mazdak Farrokhzad [Fri, 11 Oct 2019 16:52:09 +0000 (18:52 +0200)]
move panictry! to where it is used.

4 years agoAuto merge of #65771 - Centril:rollup-upfsvrb, r=Centril
bors [Fri, 25 Oct 2019 00:40:55 +0000 (00:40 +0000)]
Auto merge of #65771 - Centril:rollup-upfsvrb, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #65625 (Turn crate store into a resolver output)
 - #65627 (Forbid non-`structural_match` types in const generics)
 - #65710 (Update cargo)
 - #65729 (Update test cases for vxWorks)
 - #65746 (Tweak format string error to point at arguments always)
 - #65753 (Don't assert for different instance on impl trait alias)
 - #65755 (Avoid ICE when adjusting bad self ty)
 - #65766 (Update hashbrown to 0.6.2)

Failed merges:

r? @ghost

4 years agoFix more `ReEmpty` ICEs
Matthew Jasper [Sun, 20 Oct 2019 21:08:44 +0000 (22:08 +0100)]
Fix more `ReEmpty` ICEs

4 years agoRollup merge of #65766 - alexcrichton:less-inline-hashbrown, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 24 Oct 2019 18:20:10 +0000 (20:20 +0200)]
Rollup merge of #65766 - alexcrichton:less-inline-hashbrown, r=Mark-Simulacrum

Update hashbrown to 0.6.2

Pulls in rust-lang/hashbrown#119 which should be a good improvement for
compile times of hashmap-heavy crates.

4 years agoRollup merge of #65755 - estebank:icicle, r=davidtwco
Mazdak Farrokhzad [Thu, 24 Oct 2019 18:20:08 +0000 (20:20 +0200)]
Rollup merge of #65755 - estebank:icicle, r=davidtwco

Avoid ICE when adjusting bad self ty

Fix #65611.

4 years agoRollup merge of #65753 - csmoe:derive_fold, r=Centril
Mazdak Farrokhzad [Thu, 24 Oct 2019 18:20:07 +0000 (20:20 +0200)]
Rollup merge of #65753 - csmoe:derive_fold, r=Centril

Don't assert for different instance on impl trait alias

Closes https://github.com/rust-lang/rust/issues/65679
r? @Centril @nikomatsakis

4 years agoRollup merge of #65746 - estebank:newcomer-format, r=Centril
Mazdak Farrokhzad [Thu, 24 Oct 2019 18:20:05 +0000 (20:20 +0200)]
Rollup merge of #65746 - estebank:newcomer-format, r=Centril

Tweak format string error to point at arguments always

Add secondary span labels with no text to make it clear when there's a
mismatch bewteen the positional arguments in a format string and the
arguments to the macro. This shouldn't affect experienced users, but it
should make it easier for newcomers to more clearly understand how
`format!()` and `println!()` are supposed to be used.

```
error: 2 positional arguments in format string, but there is 1 argument
 --> file8.rs:2:14
  |
2 |     format!("{} {}", 1);
  |              ^^ ^^   -
```

instead of

```
error: 2 positional arguments in format string, but there is 1 argument
 --> file8.rs:2:14
  |
2 |     format!("{} {}", 1);
  |              ^^ ^^
```

r? @Centril

4 years agoRollup merge of #65729 - Wind-River:master_003, r=alexcrichton
Mazdak Farrokhzad [Thu, 24 Oct 2019 18:20:04 +0000 (20:20 +0200)]
Rollup merge of #65729 - Wind-River:master_003, r=alexcrichton

Update test cases for vxWorks

4 years agoRollup merge of #65710 - ehuss:update-cargo, r=alexcrichton
Mazdak Farrokhzad [Thu, 24 Oct 2019 18:20:02 +0000 (20:20 +0200)]
Rollup merge of #65710 - ehuss:update-cargo, r=alexcrichton

Update cargo

6 commits in 3a9abe3f065554a7fbc59f440df2baba4a6e47ee..3ba5f27170db10af7a92f2b682e049397197b8fa
2019-10-15 15:55:35 +0000 to 2019-10-22 15:05:18 +0000
- Fix typo in `cargo install --profile` help (rust-lang/cargo#7532)
- Use stricter -Z flag parsing. (rust-lang/cargo#7531)
- Set timestamp on generated files in archive to now (rust-lang/cargo#7523)
- Support rustc's `-Z panic-abort-tests` in Cargo (rust-lang/cargo#7460)
- rustfmt for nightly changes. (rust-lang/cargo#7526)
- Allow --all-features in root of virtual workspace. (rust-lang/cargo#7525)

4 years agoRollup merge of #65627 - varkor:const-generics-forbid-non-structural_match, r=petroch...
Mazdak Farrokhzad [Thu, 24 Oct 2019 18:20:01 +0000 (20:20 +0200)]
Rollup merge of #65627 - varkor:const-generics-forbid-non-structural_match, r=petrochenkov

Forbid non-`structural_match` types in const generics

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

4 years agoRollup merge of #65625 - petrochenkov:cstore, r=Mark-Simulacrum,Zoxc
Mazdak Farrokhzad [Thu, 24 Oct 2019 18:19:59 +0000 (20:19 +0200)]
Rollup merge of #65625 - petrochenkov:cstore, r=Mark-Simulacrum,Zoxc

Turn crate store into a resolver output

Crate store (`CStore`) is a vector of data (`CrateMetadata`) associated with extern crates loaded during the current compilation session.

All crates are loaded in the resolver when resolving either paths pointing to extern prelude or `extern crate` items. (There are also a couple of crates like panic runtime that are loaded kind of like implicit `extern crate`s, but that also happens in resolve.)

The use of `CStore` from `rustc_plugin` (which is outside of the resolver) was unnecessary because legacy plugins are not added to the crate store and don't use `CrateNum`s.

So, `CStore` can be produced by the resolver instead of being kept in some really global data (`rustc_interface::Compiler`) like now.

As a result of crate store being more "local" we can now remove some locks and `Lrc`s.

4 years agorustc_interface: Remove `ExpansionResult` and some `Steal`s
Vadim Petrochenkov [Mon, 21 Oct 2019 20:32:51 +0000 (23:32 +0300)]
rustc_interface: Remove `ExpansionResult` and some `Steal`s

4 years agorustc_metadata: Minimize use of `Lrc` in crate store
Vadim Petrochenkov [Sun, 20 Oct 2019 11:06:48 +0000 (14:06 +0300)]
rustc_metadata: Minimize use of `Lrc` in crate store

Crate metadatas are still stored as `Lrc<CrateMetadata>` in `CStore` because crate store has to be cloneable due to `Resolver::clone_outputs`.

4 years agorustc_metadata: Remove `RwLock` from `CStore`
Vadim Petrochenkov [Sun, 20 Oct 2019 09:49:14 +0000 (12:49 +0300)]
rustc_metadata: Remove `RwLock` from `CStore`

4 years agoTurn crate store into a resolver output
Vadim Petrochenkov [Sun, 20 Oct 2019 00:28:36 +0000 (03:28 +0300)]
Turn crate store into a resolver output

4 years agorustc: Combine resolver outputs into a single struct
Vadim Petrochenkov [Sun, 20 Oct 2019 00:19:12 +0000 (03:19 +0300)]
rustc: Combine resolver outputs into a single struct

4 years agoresolve: Privatize all resolver fields
Vadim Petrochenkov [Sat, 19 Oct 2019 23:55:39 +0000 (02:55 +0300)]
resolve: Privatize all resolver fields

4 years agorustc: Add a convenience alias for `dyn MetadataLoader + Sync`
Vadim Petrochenkov [Thu, 17 Oct 2019 18:26:13 +0000 (21:26 +0300)]
rustc: Add a convenience alias for `dyn MetadataLoader + Sync`

4 years agorustc_metadata: Move some code around
Vadim Petrochenkov [Thu, 17 Oct 2019 16:08:06 +0000 (19:08 +0300)]
rustc_metadata: Move some code around

Plugin search doesn't need a crate loader, only crate locator

4 years agorustc_metadata: Remove unnecessary use of crate store in plugin loader
Vadim Petrochenkov [Wed, 16 Oct 2019 16:57:10 +0000 (19:57 +0300)]
rustc_metadata: Remove unnecessary use of crate store in plugin loader

4 years agorustc_driver: Remove unnecessary use of crate store
Vadim Petrochenkov [Wed, 16 Oct 2019 16:03:21 +0000 (19:03 +0300)]
rustc_driver: Remove unnecessary use of crate store

4 years agoDon't assert for different instance on impl trait alias
csmoe [Thu, 24 Oct 2019 06:25:23 +0000 (14:25 +0800)]
Don't assert for different instance on impl trait alias

4 years agoAuto merge of #65762 - mati865:msys2-bug, r=pietroalbini
bors [Thu, 24 Oct 2019 16:08:03 +0000 (16:08 +0000)]
Auto merge of #65762 - mati865:msys2-bug, r=pietroalbini

workaround msys2 bug

4 years agoworkaround msys2 bug
Mateusz Mikuła [Thu, 24 Oct 2019 14:47:56 +0000 (16:47 +0200)]
workaround msys2 bug

Co-Authored-By: Pietro Albini <pietro@pietroalbini.org>
4 years agoreorder TomlTarget struct's fields based on the order in config.toml.example
Guanqun Lu [Thu, 24 Oct 2019 15:54:31 +0000 (23:54 +0800)]
reorder TomlTarget struct's fields based on the order in config.toml.example

4 years agoreorder Rust struct's fields based on the order in config.toml.example
Guanqun Lu [Thu, 24 Oct 2019 15:53:45 +0000 (23:53 +0800)]
reorder Rust struct's fields based on the order in config.toml.example

4 years agoreorder Install struct's fields based on the order in config.toml.example
Guanqun Lu [Thu, 24 Oct 2019 15:51:02 +0000 (23:51 +0800)]
reorder Install struct's fields based on the order in config.toml.example

4 years agoreorder Build struct's fields based on the order in config.toml.example
Guanqun Lu [Thu, 24 Oct 2019 15:50:03 +0000 (23:50 +0800)]
reorder Build struct's fields based on the order in config.toml.example

4 years agoreorder Llvm struct's fields based on the order in config.toml.example
Guanqun Lu [Thu, 24 Oct 2019 15:46:05 +0000 (23:46 +0800)]
reorder Llvm struct's fields based on the order in config.toml.example

4 years agoadd the missing rust.musl-root option in config.toml.example
Guanqun Lu [Thu, 24 Oct 2019 15:43:06 +0000 (23:43 +0800)]
add the missing rust.musl-root option in config.toml.example

4 years agoadd a WARNING to rust.optimize option in config.toml.example
Guanqun Lu [Thu, 24 Oct 2019 15:41:48 +0000 (23:41 +0800)]
add a WARNING to rust.optimize option in config.toml.example

4 years agoUpdate clippy
Manish Goregaokar [Thu, 24 Oct 2019 15:06:40 +0000 (08:06 -0700)]
Update clippy

4 years agoself-profiling: Update measureme to 0.4.0 and use new RAII-based API.
Michael Woerister [Thu, 24 Oct 2019 15:14:38 +0000 (17:14 +0200)]
self-profiling: Update measureme to 0.4.0 and use new RAII-based API.

4 years agoself-profiling: Remove unused methods from profiler.
Michael Woerister [Thu, 24 Oct 2019 15:13:38 +0000 (17:13 +0200)]
self-profiling: Remove unused methods from profiler.

4 years agoUpdate hashbrown to 0.6.2
Alex Crichton [Thu, 24 Oct 2019 15:07:03 +0000 (08:07 -0700)]
Update hashbrown to 0.6.2

Pulls in rust-lang/hashbrown#119 which should be a good improvement for
compile times of hashmap-heavy crates.

4 years agoChanged APIT with explicit generic args span to specific arg spans
Sydney Acksman [Thu, 24 Oct 2019 14:46:19 +0000 (09:46 -0500)]
Changed APIT with explicit generic args span to specific arg spans

4 years agoAdd UI tests for `array::IntoIter` impls
Lukas Kalbertodt [Mon, 21 Oct 2019 11:47:02 +0000 (13:47 +0200)]
Add UI tests for `array::IntoIter` impls

This it to make sure traits are implemented for arrays with length 32
and below, while they are not implemented for >= 33.

4 years agoAdd unit tests for `array::IntoIter`
Lukas Kalbertodt [Fri, 26 Jul 2019 11:27:13 +0000 (13:27 +0200)]
Add unit tests for `array::IntoIter`

Many tests are based on tests by Josh Stone <cuviper@gmail.com>

4 years agoAdd `array::IntoIter` as a consuming/by-value array iterator
Lukas Kalbertodt [Wed, 24 Jul 2019 22:39:39 +0000 (00:39 +0200)]
Add `array::IntoIter` as a consuming/by-value array iterator

The iterator is implemented using const generics. It implements the
traits `Iterator`, `DoubleEndedIterator`, `ExactSizeIterator`,
`FusedIterator` and `TrustedLen`. It also contains a public method
`new` to create it from an array.

`IntoIterator` was not implemented for arrays yet, as there are still
some open questions regarding backwards compatibility. This commit
only adds the iterator impl and does not yet offer a convenient way
to obtain that iterator.

4 years agoAvoid ICE when adjusting bad self ty
Esteban Küber [Thu, 24 Oct 2019 07:37:32 +0000 (00:37 -0700)]
Avoid ICE when adjusting bad self ty

4 years agoAuto merge of #65474 - Mark-Simulacrum:rustc-dev-split, r=pietroalbini
bors [Thu, 24 Oct 2019 07:27:00 +0000 (07:27 +0000)]
Auto merge of #65474 - Mark-Simulacrum:rustc-dev-split, r=pietroalbini

Split the rustc target libraries into separate rustc-dev component

This is re-applies a squashed version of #64823 as well as including #65337 to fix bugs noted after merging the first PR.

The second PR is confirmed as fixing windows-gnu, and presumably also fixes other platforms, such as musl (i.e. #65335 should be fixed); `RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup toolchain install nightly-2019-10-16` can be installed to confirm that this is indeed the case.

4 years agoDeprecated proc_macro doesn't trigger warning on build library
wangxiangqing [Mon, 21 Oct 2019 16:08:14 +0000 (00:08 +0800)]
Deprecated proc_macro doesn't trigger warning on build library

Change-Id: Ib3a396e7334d209fe6c6ef425bbfc7b2ae471378

4 years agoAuto merge of #65733 - Centril:rollup-0zth66f, r=Centril
bors [Thu, 24 Oct 2019 03:38:57 +0000 (03:38 +0000)]
Auto merge of #65733 - Centril:rollup-0zth66f, r=Centril

Rollup of 12 pull requests

Successful merges:

 - #64178 (More Clippy fixes for alloc, core and std)
 - #65144 (Add Cow::is_borrowed and Cow::is_owned)
 - #65193 (Lockless LintStore)
 - #65479 (Add the `matches!( $expr, $pat ) -> bool` macro)
 - #65518 (Avoid ICE when checking `Destination` of `break` inside a closure)
 - #65583 (rustc_metadata: use a table for super_predicates, fn_sig, impl_trait_ref.)
 - #65641 (Derive `Rustc{En,De}codable` for `TokenStream`.)
 - #65648 (Eliminate `intersect_opt`.)
 - #65657 (Remove `InternedString`)
 - #65691 (Update E0659 error code long explanation to 2018 edition)
 - #65696 (Fix an issue with const inference variables sticking around under Chalk + NLL)
 - #65704 (relax ExactSizeIterator bound on write_bytes)

Failed merges:

r? @ghost