]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #58912 - pnkfelix:issue-58813-incr-comp-regress-test, r=petrochenkov
Pietro Albini [Fri, 8 Mar 2019 08:41:55 +0000 (09:41 +0100)]
Rollup merge of #58912 - pnkfelix:issue-58813-incr-comp-regress-test, r=petrochenkov

Regression test for #58813

Fix #58813

5 years agoRollup merge of #58911 - pnkfelix:issue-58435-regression-test, r=alexcrichton
Pietro Albini [Fri, 8 Mar 2019 08:41:54 +0000 (09:41 +0100)]
Rollup merge of #58911 - pnkfelix:issue-58435-regression-test, r=alexcrichton

Regression test for #58435.

Fix #58435

5 years agoRollup merge of #58906 - Nemo157:generator-state-debug-info, r=Zoxc
Pietro Albini [Fri, 8 Mar 2019 08:41:52 +0000 (09:41 +0100)]
Rollup merge of #58906 - Nemo157:generator-state-debug-info, r=Zoxc

Monomorphize generator field types for debuginfo

Fixes #58888

r? @Zoxc

5 years agoRollup merge of #58893 - benaryorg:thread_local_example_join, r=alexcrichton
Pietro Albini [Fri, 8 Mar 2019 08:41:50 +0000 (09:41 +0100)]
Rollup merge of #58893 - benaryorg:thread_local_example_join, r=alexcrichton

race condition in thread local storage example

The example had a potential race condition that would still pass the test.
If the thread which was supposed to modify it's own thread local was slower than the instruction to
modify in the main thread, then the test would pass even in case of a failure.
This is would be minor if the child thread was waited for since it check using an `assert_eq` for the
same thing, but vice versa.
However, if the `assert_eq` failed this would trigger a panic, which is not at all caught by the
example since the thread is not waited on.

Signed-off-by: benaryorg <binary@benary.org>
5 years agoRollup merge of #58891 - Delta-Psi:doc-fixes, r=Centril
Pietro Albini [Fri, 8 Mar 2019 08:41:49 +0000 (09:41 +0100)]
Rollup merge of #58891 - Delta-Psi:doc-fixes, r=Centril

Remove stray ` in the docs for the FromIterator implementation for Option

5 years agoRollup merge of #58883 - estebank:unused-closure-arg, r=varkor
Pietro Albini [Fri, 8 Mar 2019 08:41:47 +0000 (09:41 +0100)]
Rollup merge of #58883 - estebank:unused-closure-arg, r=varkor

Suggest appropriate code for unused field when destructuring pattern

Fix #56472.

5 years agoRollup merge of #58877 - estebank:macro-borrow, r=davidtwco
Pietro Albini [Fri, 8 Mar 2019 08:41:45 +0000 (09:41 +0100)]
Rollup merge of #58877 - estebank:macro-borrow, r=davidtwco

Suggest removal of `&` when borrowing macro and appropriate

Fix #58815.

5 years agoRollup merge of #58861 - estebank:fix-negative-traits, r=petrochenkov
Pietro Albini [Fri, 8 Mar 2019 08:41:43 +0000 (09:41 +0100)]
Rollup merge of #58861 - estebank:fix-negative-traits, r=petrochenkov

Expand where negative supertrait specific error is shown

Fix #58857.

r? @petrochenkov

5 years agoRollup merge of #58369 - nox:sync-hash-map-entry, r=Amanieu
Pietro Albini [Fri, 8 Mar 2019 08:41:42 +0000 (09:41 +0100)]
Rollup merge of #58369 - nox:sync-hash-map-entry, r=Amanieu

Make the Entry API of HashMap<K, V> Sync and Send

Fixes #45219

5 years agoRollup merge of #58269 - taeguk:add-some-sources-to-rust-src-distribution, r=Mark...
Pietro Albini [Fri, 8 Mar 2019 08:41:40 +0000 (09:41 +0100)]
Rollup merge of #58269 - taeguk:add-some-sources-to-rust-src-distribution, r=Mark-Simulacrum

Add librustc and libsyntax to rust-src distribution.

Fixes #58268.

5 years agoRollup merge of #58204 - estebank:impl-trait-semi, r=zackmdavis
Pietro Albini [Fri, 8 Mar 2019 08:41:38 +0000 (09:41 +0100)]
Rollup merge of #58204 - estebank:impl-trait-semi, r=zackmdavis

On return type `impl Trait` for block with no expr point at last semi

Partial solution, doesn't actually validate that the last statement in the function body can satisfy the trait bound, but it's a good incremental improvement over the status quo.

```
error[E0277]: the trait bound `(): Bar` is not satisfied
  --> $DIR/impl-trait-return-trailing-semicolon.rs:3:13
   |
LL | fn foo() -> impl Bar {
   |             ^^^^^^^^ the trait `Bar` is not implemented for `()`
LL |     5;
   |      - consider removing this semicolon
   |
   = note: the return type of a function must have a statically known size
```

Partially addresses #54771.

5 years agoRollup merge of #58080 - MikaelUrankar:freebsd_arm, r=sanxiyn
Pietro Albini [Fri, 8 Mar 2019 08:41:36 +0000 (09:41 +0100)]
Rollup merge of #58080 - MikaelUrankar:freebsd_arm, r=sanxiyn

Add FreeBSD armv6 and armv7 targets

5 years agoAuto merge of #58013 - Zoxc:stable-hash-macro-simple, r=oli-obk
bors [Fri, 8 Mar 2019 05:46:08 +0000 (05:46 +0000)]
Auto merge of #58013 - Zoxc:stable-hash-macro-simple, r=oli-obk

Create a derive macro for HashStable and allow proc macros in rustc

A combination of https://github.com/rust-lang/rust/pull/56864 and https://github.com/rust-lang/rust/pull/56795. There were complications with using `serde_derive` as rustc doesn't know which crate to use for the host when there is a serde_derive in the sysroot and cargo passes another on the command line built from crates.io.

r? @eddyb (for proc macro changes) @alexcrichton (for rustbuild changes) @michaelwoerister (for the macro itself)

5 years agoAuto merge of #58583 - varkor:const-generics-ty, r=oli-obk
bors [Thu, 7 Mar 2019 00:27:07 +0000 (00:27 +0000)]
Auto merge of #58583 - varkor:const-generics-ty, r=oli-obk

Add const generics to ty (and transitive dependencies)

Split out from #53645. This work is a collaborative effort with @yodaldevoid.

There are a number of stubs. Some I plan to leave for the next PRs (e.g. `infer` and `rustdoc`). Others I can either fix up in this PR, or as follow ups (which would avoid the time-consuming rebasing).

It was a little hard to split this up, as so much depends on ty and friends. Apologies for the large diff.

r? @eddyb

5 years agoMake Cargo a rustc tool again
John Kåre Alsaker [Wed, 6 Mar 2019 17:48:08 +0000 (18:48 +0100)]
Make Cargo a rustc tool again

5 years agoRegression test for #58813
Felix S. Klock II [Mon, 4 Mar 2019 12:55:32 +0000 (13:55 +0100)]
Regression test for #58813

(Update: Fixed test; revision is meant to introduce compile-failure, w/o ICE.)

5 years agoRefactor const_to_op
varkor [Wed, 6 Mar 2019 09:58:27 +0000 (09:58 +0000)]
Refactor const_to_op

5 years agoMake adjustments for comments
varkor [Tue, 5 Mar 2019 22:49:37 +0000 (22:49 +0000)]
Make adjustments for comments

5 years agoFix rebase fallout
varkor [Tue, 5 Mar 2019 22:31:06 +0000 (22:31 +0000)]
Fix rebase fallout

5 years agoClean up some generic substs handling
varkor [Wed, 20 Feb 2019 12:47:19 +0000 (12:47 +0000)]
Clean up some generic substs handling

5 years agoFix negative integer literal test
varkor [Wed, 20 Feb 2019 11:01:39 +0000 (11:01 +0000)]
Fix negative integer literal test

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoUpdate test fallout
varkor [Wed, 20 Feb 2019 01:20:35 +0000 (01:20 +0000)]
Update test fallout

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoUpdate const generics tests
varkor [Wed, 20 Feb 2019 01:20:22 +0000 (01:20 +0000)]
Update const generics tests

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoHandle const generics elsewhere
varkor [Wed, 20 Feb 2019 01:20:06 +0000 (01:20 +0000)]
Handle const generics elsewhere

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoHandle const generics in typeck
varkor [Wed, 20 Feb 2019 01:19:42 +0000 (01:19 +0000)]
Handle const generics in typeck

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoHandle new ConstValue variants in mir
varkor [Wed, 20 Feb 2019 01:19:13 +0000 (01:19 +0000)]
Handle new ConstValue variants in mir

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoImplement structural_impls for const generics
varkor [Wed, 20 Feb 2019 01:18:43 +0000 (01:18 +0000)]
Implement structural_impls for const generics

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd HAS_CT_INFER
varkor [Wed, 20 Feb 2019 01:18:30 +0000 (01:18 +0000)]
Add HAS_CT_INFER

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoStub rustdoc const generics implementations
varkor [Wed, 20 Feb 2019 01:18:04 +0000 (01:18 +0000)]
Stub rustdoc const generics implementations

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoImplement collect for const parameters
varkor [Wed, 20 Feb 2019 01:17:35 +0000 (01:17 +0000)]
Implement collect for const parameters

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoImplement wfcheck for const parameters
varkor [Wed, 20 Feb 2019 01:17:15 +0000 (01:17 +0000)]
Implement wfcheck for const parameters

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoRefactor compare_method
varkor [Wed, 20 Feb 2019 01:16:52 +0000 (01:16 +0000)]
Refactor compare_method

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd ast_const_to_const
varkor [Wed, 20 Feb 2019 01:16:42 +0000 (01:16 +0000)]
Add ast_const_to_const

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoMake a lazy const from a const param
varkor [Wed, 20 Feb 2019 01:16:12 +0000 (01:16 +0000)]
Make a lazy const from a const param

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoPretty printing for const generics
varkor [Wed, 20 Feb 2019 01:15:49 +0000 (01:15 +0000)]
Pretty printing for const generics

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd const type flags
varkor [Wed, 20 Feb 2019 01:15:21 +0000 (01:15 +0000)]
Add const type flags

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoTake const into account in context
varkor [Wed, 20 Feb 2019 01:14:56 +0000 (01:14 +0000)]
Take const into account in context

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoStub methods in infer
varkor [Wed, 20 Feb 2019 01:14:18 +0000 (01:14 +0000)]
Stub methods in infer

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoImplement Hash for new types
varkor [Wed, 20 Feb 2019 01:13:49 +0000 (01:13 +0000)]
Implement Hash for new types

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoUpdate diagnostics to include const parameters
varkor [Wed, 20 Feb 2019 01:13:32 +0000 (01:13 +0000)]
Update diagnostics to include const parameters

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd type constraints from const parameters
varkor [Wed, 20 Feb 2019 01:13:19 +0000 (01:13 +0000)]
Add type constraints from const parameters

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd ConstValue::Param and ConstValue::Infer
varkor [Wed, 20 Feb 2019 01:12:46 +0000 (01:12 +0000)]
Add ConstValue::Param and ConstValue::Infer

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd const kind and UnpackedKind::Const
varkor [Wed, 20 Feb 2019 01:12:15 +0000 (01:12 +0000)]
Add const kind and UnpackedKind::Const

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoTake const generics into account when monomorphising
varkor [Wed, 20 Feb 2019 01:11:37 +0000 (01:11 +0000)]
Take const generics into account when monomorphising

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoUse non_erasable_generics for codegen
varkor [Wed, 20 Feb 2019 01:11:10 +0000 (01:11 +0000)]
Use non_erasable_generics for codegen

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd type_flags helper methods to consts
varkor [Wed, 20 Feb 2019 01:10:22 +0000 (01:10 +0000)]
Add type_flags helper methods to consts

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd InferConst
varkor [Wed, 20 Feb 2019 01:10:11 +0000 (01:10 +0000)]
Add InferConst

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd ConstVid
varkor [Wed, 20 Feb 2019 01:10:03 +0000 (01:10 +0000)]
Add ConstVid

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd ParamConst
varkor [Wed, 20 Feb 2019 01:09:52 +0000 (01:09 +0000)]
Add ParamConst

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd Const generic param to ty
varkor [Wed, 20 Feb 2019 01:09:29 +0000 (01:09 +0000)]
Add Const generic param to ty

Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
5 years agoAdd a test for HashStable stability
John Kåre Alsaker [Tue, 5 Mar 2019 18:28:20 +0000 (19:28 +0100)]
Add a test for HashStable stability

5 years agoMake rustc_macro a Rust 2018 crate
John Kåre Alsaker [Tue, 5 Mar 2019 18:27:50 +0000 (19:27 +0100)]
Make rustc_macro a Rust 2018 crate

5 years agoMove locate_ctxt back
John Kåre Alsaker [Tue, 5 Mar 2019 17:53:23 +0000 (18:53 +0100)]
Move locate_ctxt back

5 years agoAuto merge of #58423 - nox:relax-bounds-buf-reader, r=dtolnay
bors [Tue, 5 Mar 2019 05:40:16 +0000 (05:40 +0000)]
Auto merge of #58423 - nox:relax-bounds-buf-reader, r=dtolnay

Relax Read bounds on a bunch of BufReader<R> methods

5 years agoUse Ident for project
John Kåre Alsaker [Tue, 5 Mar 2019 04:53:16 +0000 (05:53 +0100)]
Use Ident for project

5 years agoAdd librustc, libsyntax to rust-src distribution.
Taeguk Kwon [Thu, 7 Feb 2019 14:06:41 +0000 (23:06 +0900)]
Add librustc, libsyntax to rust-src distribution.

5 years agoUpdate Cargo.lock
John Kåre Alsaker [Fri, 1 Mar 2019 00:22:10 +0000 (01:22 +0100)]
Update Cargo.lock

5 years agoAdd ignore and project attributes
John Kåre Alsaker [Sun, 16 Dec 2018 03:44:12 +0000 (04:44 +0100)]
Add ignore and project attributes

5 years agoEncode proc macro stability
John Kåre Alsaker [Mon, 28 Jan 2019 22:40:14 +0000 (23:40 +0100)]
Encode proc macro stability

5 years agoBootstrap changes
John Kåre Alsaker [Sun, 2 Dec 2018 20:47:41 +0000 (21:47 +0100)]
Bootstrap changes

5 years agoAllow linking to a proc macro on the target in metadata and still use a host proc...
John Kåre Alsaker [Sun, 13 Jan 2019 08:18:37 +0000 (09:18 +0100)]
Allow linking to a proc macro on the target in metadata and still use a host proc macro to execute them

5 years agoCreate a derive macro for HashStable
John Kåre Alsaker [Mon, 3 Dec 2018 00:14:35 +0000 (01:14 +0100)]
Create a derive macro for HashStable

5 years agoFix rebase and move suggestion to its own method
Esteban Küber [Mon, 4 Mar 2019 21:39:52 +0000 (13:39 -0800)]
Fix rebase and move suggestion to its own method

5 years agoAdd fixme
Esteban Küber [Thu, 7 Feb 2019 14:02:17 +0000 (06:02 -0800)]
Add fixme

5 years agoOn return type `impl Trait` for block with no expr point at last semi
Esteban Küber [Tue, 5 Feb 2019 23:17:08 +0000 (15:17 -0800)]
On return type `impl Trait` for block with no expr point at last semi

5 years agoRegression test for #58435.
Felix S. Klock II [Mon, 4 Mar 2019 12:16:49 +0000 (13:16 +0100)]
Regression test for #58435.

5 years agoMake the Entry API of HashMap<K, V> Sync and Send (fixes #45219)
Anthony Ramine [Sun, 10 Feb 2019 16:54:56 +0000 (17:54 +0100)]
Make the Entry API of HashMap<K, V> Sync and Send (fixes #45219)

5 years agoAuto merge of #58380 - estebank:missing-match-pats, r=zackmdavis
bors [Mon, 4 Mar 2019 04:46:38 +0000 (04:46 +0000)]
Auto merge of #58380 - estebank:missing-match-pats, r=zackmdavis

Point at enum definition when match patterns are not exhaustive

```
error[E0004]: non-exhaustive patterns: type `X` is non-empty
 --> file.rs:9:11
  |
1 | / enum X {
2 | |     A,
  | |     - variant not covered
3 | |     B,
  | |     - variant not covered
4 | |     C,
  | |     - variant not covered
5 | | }
  | |_- `X` defined here
...
9 |       match x {
  |             ^
  |
  = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: `B` and `C` not covered
  --> file.rs:11:11
   |
1  | / enum X {
2  | |     A,
3  | |     B,
4  | |     C,
   | |     - not covered
5  | | }
   | |_- `X` defined here
...
11 |       match x {
   |             ^ patterns `C` not covered
```

When a match expression doesn't have patterns covering every variant,
point at the enum's definition span. On a best effort basis, point at the
variant(s) that are missing. This does not handle the case when the missing
pattern is due to a field's enum variants:

```
enum E1 {
    A,
    B,
    C,
}
enum E2 {
    A(E1),
    B,
}
fn foo() {
    match E2::A(E1::A) {
        E2::A(E1::B) => {}
        E2::B => {}
    }
    //~^ ERROR `E2::A(E1::A)` and `E2::A(E1::C)` not handled
}
```

Unify look between match with no arms and match with some missing patterns.

Fix #37518.

5 years agoAuto merge of #58807 - Xanewok:update-clippy, r=Xanewok
bors [Mon, 4 Mar 2019 01:46:37 +0000 (01:46 +0000)]
Auto merge of #58807 - Xanewok:update-clippy, r=Xanewok

Update Clippy

Should fix the fallout caused by https://github.com/rust-lang/rust/pull/58321 (still testing it locally).

r? @oli-obk

5 years agoUpdate Clippy
Igor Matuszewski [Sun, 3 Mar 2019 13:48:03 +0000 (14:48 +0100)]
Update Clippy

5 years agoAuto merge of #58505 - schomatis:fix/nll/remove-live-var, r=matthewjasper
bors [Sun, 3 Mar 2019 22:49:16 +0000 (22:49 +0000)]
Auto merge of #58505 - schomatis:fix/nll/remove-live-var, r=matthewjasper

[NLL] Remove `LiveVar`

The `LiveVar` type (and related) made it harder to reason about the code. It seemed as an abstraction that didn't bring any useful concept to the reader (when transitioning from the RFC theory to the actual implementation code).

It achieved a compactness in the vectors storing the def/use/drop information that was related only to the `LocalUseMap`. This PR went in the other direction and favored time over memory (but this decision can be easily reverted to the other side without reintroducing `LiveVar`).

What this PR aims at is to clarify that there's no significant transformation between the MIR `Local` and the `LiveVar` (now refactored as `live_locals: Vec<Local>`): we're just filtering (not mapping) the entire group of `Local`s into a meaningful subset that we should perform the liveness analysis on.

As a side note, there is no guarantee that the liveness analysis is performed only on (what the code calls) "live" variables, if the NLL facts are requested it will be performed on *any* variable so there can't be any assumptions on that regard. (Still, this PR didn't change the general naming convention to reduce the number of changes here and streamline the review process).

**Acceptance criteria:** This PR attempts to do only a minor refactoring and not to change the logic so it can't have any performance impact, particularly, it can't lose any of the significant performance improvement achieved in the great work done in https://github.com/rust-lang/rust/pull/52115.

r? @nikomatsakis

5 years agoMonomorphize generator field types for debuginfo
Wim Looman [Sun, 3 Mar 2019 22:23:38 +0000 (11:23 +1300)]
Monomorphize generator field types for debuginfo

5 years agorace condition in thread local storage example
benaryorg [Sun, 3 Mar 2019 14:21:52 +0000 (15:21 +0100)]
race condition in thread local storage example

The example had a potential race condition that would still pass the test.
If the thread which was supposed to modify it's own thread local was slower than the instruction to
modify in the main thread, then the test would pass even in case of a failure.
This is would be minor if the child thread was waited for since it check using an `assert_eq` for
the same thing, but vice versa.
However, if the `assert_eq` failed this would trigger a panic, which is not at all caught by the
example since the thread is not waited on.

Signed-off-by: benaryorg <binary@benary.org>
5 years agoAuto merge of #58425 - wesleywiser:more_profiler_changes, r=michaelwoerister
bors [Sun, 3 Mar 2019 19:48:12 +0000 (19:48 +0000)]
Auto merge of #58425 - wesleywiser:more_profiler_changes, r=michaelwoerister

[self-profiler] Make the profiler faster/more efficient

Related to #58372

r? @michaelwoerister

5 years agoAuto merge of #58673 - matthewjasper:typeck-ptr-coercions, r=pnkfelix
bors [Sun, 3 Mar 2019 16:46:12 +0000 (16:46 +0000)]
Auto merge of #58673 - matthewjasper:typeck-ptr-coercions, r=pnkfelix

[NLL] Type check operations with pointer types

It seems these were forgotten about. Moving to `Rvalue::AddressOf` simplifies the coercions from references, but I want this to be fixed as soon as possible.

r? @pnkfelix

5 years agoUse FxHashMap
Wesley Wiser [Mon, 25 Feb 2019 23:46:53 +0000 (18:46 -0500)]
Use FxHashMap

5 years agoReduce the size of events by using a u64 instead of Instant
Wesley Wiser [Wed, 13 Feb 2019 10:33:51 +0000 (05:33 -0500)]
Reduce the size of events by using a u64 instead of Instant

Part of #58372

5 years agoRemove profiler output and replace with a raw event dump
Wesley Wiser [Mon, 11 Feb 2019 23:11:43 +0000 (18:11 -0500)]
Remove profiler output and replace with a raw event dump

Related to #58372

5 years agoWrap the self-profiler in an `Arc<Mutex<>>`
Wesley Wiser [Sun, 10 Feb 2019 22:23:00 +0000 (17:23 -0500)]
Wrap the self-profiler in an `Arc<Mutex<>>`

This will allow us to send it across threads and measure things like
LLVM time.

5 years agoRemove stray ` in the documentation for the FromIterator implementation for Option
Alexandra V [Sun, 3 Mar 2019 12:25:55 +0000 (13:25 +0100)]
Remove stray ` in the documentation for the FromIterator implementation for Option

5 years agoAuto merge of #58879 - spastorino:update_miri, r=oli-obk
bors [Sun, 3 Mar 2019 11:42:39 +0000 (11:42 +0000)]
Auto merge of #58879 - spastorino:update_miri, r=oli-obk

Update miri

Related to #58841

r? @RalfJung

5 years agoAuto merge of #58866 - kennytm:rollup, r=kennytm
bors [Sun, 3 Mar 2019 08:47:51 +0000 (08:47 +0000)]
Auto merge of #58866 - kennytm:rollup, r=kennytm

Rollup of 14 pull requests

Successful merges:

 - #58730 (Have all methods of Filter and FilterMap use internal iteration)
 - #58780 (ManuallyDrop != MaybeUninit)
 - #58782 (Replace `s` with `self` in docs for str methods taking self.)
 - #58785 (allow specifying attributes for tool lints)
 - #58802 (Ensure `record_layout_for_printing()` is inlined.)
 - #58821 (Fixed a syntax error in the pin docs)
 - #58830 (tidy: deny(rust_2018_idioms))
 - #58832 (Revert switching to GCP on AppVeyor)
 - #58833 (tools/rustbook: deny(rust_2018_idioms))
 - #58835 (tools/remote-test-{client,server}: deny(rust_2018_idioms))
 - #58838 (Fix typo in Vec#resize_with documentation)
 - #58842 (Forbid duplicating Cargo as a dependency)
 - #58852 (Update toolchain to build NetBSD release)
 - #58865 (Fix C-variadic function printing)

5 years agoRollup merge of #58865 - dlrobertson:fix-varargs, r=alexreg
kennytm [Sun, 3 Mar 2019 05:56:57 +0000 (13:56 +0800)]
Rollup merge of #58865 - dlrobertson:fix-varargs, r=alexreg

Fix C-variadic function printing

There is no longer a need to append the string `", ..."` to a functions
args as `...` is parsed as an argument and will appear in the functions
arguments.

Fixes: #58853
5 years agoAuto merge of #58793 - Mark-Simulacrum:master-next, r=alexcrichton
bors [Sun, 3 Mar 2019 05:51:44 +0000 (05:51 +0000)]
Auto merge of #58793 - Mark-Simulacrum:master-next, r=alexcrichton

Bootstrap compiler update for 1.35 release

r? @alexcrichton

5 years agoCall clang and llvm-objdump with correct library path
Mark Rousskov [Sun, 3 Mar 2019 05:27:26 +0000 (22:27 -0700)]
Call clang and llvm-objdump with correct library path

5 years agoAuto merge of #58464 - jethrogb:jb/std-test-panic-output, r=alexcrichton
bors [Sun, 3 Mar 2019 03:00:16 +0000 (03:00 +0000)]
Auto merge of #58464 - jethrogb:jb/std-test-panic-output, r=alexcrichton

Use the correct stderr when testing libstd

When compiling the unit tests for libstd, there are two copies of `std` in existence, see [lib.rs](https://github.com/rust-lang/rust/blob/919cf42/src/libstd/lib.rs#L335-L341). This means there are two copies of everything, including thread local variable definitions. Before this PR, it's possible that libtest would configure a stderr sink in one of those copies, whereas the panic logic would inspect the sink in the other copy, resulting in libtest missing the relevant panic message. This PR makes sure that when testing, the panic logic always accesses the stderr sink from “realstd”, using the same logic that libtest uses.

5 years agoNit
Alexander Regueiro [Sat, 2 Mar 2019 15:16:36 +0000 (15:16 +0000)]
Nit

5 years agoReword error message
Esteban Küber [Sun, 3 Mar 2019 00:44:00 +0000 (16:44 -0800)]
Reword error message

5 years agoUse anonymous explicit lifetimes
Esteban Küber [Mon, 11 Feb 2019 19:22:46 +0000 (11:22 -0800)]
Use anonymous explicit lifetimes

5 years agoPoint at enum definition when match patterns are not exhaustive
Esteban Küber [Sun, 10 Feb 2019 13:12:00 +0000 (05:12 -0800)]
Point at enum definition when match patterns are not exhaustive

```
error[E0004]: non-exhaustive patterns: type `X` is non-empty
 --> file.rs:9:11
  |
1 | / enum X {
2 | |     A,
  | |     - variant not covered
3 | |     B,
  | |     - variant not covered
4 | |     C,
  | |     - variant not covered
5 | | }
  | |_- `X` defined here
...
9 |       match x {
  |             ^
  |
  = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms

error[E0004]: non-exhaustive patterns: `B` and `C` not covered
  --> file.rs:11:11
   |
1  | / enum X {
2  | |     A,
3  | |     B,
4  | |     C,
   | |     - not covered
5  | | }
   | |_- `X` defined here
...
11 |       match x {
   |             ^ patterns `C` not covered
```

When a match expression doesn't have patterns covering every variant,
point at the enum's definition span. On a best effort basis, point at the
variant(s) that are missing. This does not handle the case when the missing
pattern is due to a field's enum variants:

```
enum E1 {
    A,
    B,
    C,
}
enum E2 {
    A(E1),
    B,
}
fn foo() {
    match E2::A(E1::A) {
        E2::A(E1::B) => {}
        E2::B => {}
    }
    //~^ ERROR `E2::A(E1::A)` and `E2::A(E1::C)` not handled
}
```

Unify look between match with no arms and match with some missing patterns.

Fix #37518.

5 years agoUpdate miri
Santiago Pastorino [Sat, 2 Mar 2019 19:58:38 +0000 (16:58 -0300)]
Update miri

5 years agoSuggest appropriate code for unused field when desrtucturing patttern
Esteban Küber [Sat, 2 Mar 2019 23:16:53 +0000 (15:16 -0800)]
Suggest appropriate code for unused field when desrtucturing patttern

Fix #56472.

5 years agoSuggest removal of `&` when borrowing macro and appropriate
Esteban Küber [Sat, 2 Mar 2019 19:25:00 +0000 (11:25 -0800)]
Suggest removal of `&` when borrowing macro and appropriate

Fix #58815.

5 years agoAuto merge of #58836 - ljedrz:begone_NodeId, r=Zoxc
bors [Sat, 2 Mar 2019 19:07:22 +0000 (19:07 +0000)]
Auto merge of #58836 - ljedrz:begone_NodeId, r=Zoxc

Remove NodeId from even more HIR nodes

The next iteration of HirIdification (#57578).

Removes `NodeId` from:

- [x] `StructField`
- [x] `ForeignItem`
- [x] `Item`
- [x] `Pat`
- [x] `FieldPat`
- [x] `VariantData`
- [x] `ImplItemId` (replaces it with `HirId`)
- [x] `TraitItemId` (replaces it with `HirId`)

5 years agoBootstrap compiler update for 1.35 release
Mark Rousskov [Wed, 27 Feb 2019 23:58:12 +0000 (16:58 -0700)]
Bootstrap compiler update for 1.35 release

5 years agoFix C-variadic function printing
Dan Robertson [Sat, 2 Mar 2019 03:14:29 +0000 (03:14 +0000)]
Fix C-variadic function printing

There is no longer a need to append the string `", ..."` to a functions
args as `...` is parsed as an argument and will appear in the functions
arguments.

5 years agoRollup merge of #58842 - mati865:53005, r=alexcrichton
kennytm [Sat, 2 Mar 2019 09:39:26 +0000 (17:39 +0800)]
Rollup merge of #58842 - mati865:53005, r=alexcrichton

Forbid duplicating Cargo as a dependency

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

5 years agoRollup merge of #58852 - alexcrichton:update-netbsd, r=Mark-Simulacrum
kennytm [Sat, 2 Mar 2019 06:55:26 +0000 (14:55 +0800)]
Rollup merge of #58852 - alexcrichton:update-netbsd, r=Mark-Simulacrum

Update toolchain to build NetBSD release

This allows us to remove the "allow old toolchains" flag we pass to
LLVM, ensuring that we'll be up to date when LLVM needs us to be!

This is a follow-up from https://github.com/rust-lang/rust/pull/58408 where NetBSD was explicitly whitelisted to allow older toolchains.

5 years agoRollup merge of #58838 - jens1o:patch-1, r=Centril
kennytm [Sat, 2 Mar 2019 06:55:24 +0000 (14:55 +0800)]
Rollup merge of #58838 - jens1o:patch-1, r=Centril

Fix typo in Vec#resize_with documentation

5 years agoRollup merge of #58835 - Centril:rust_2018_idioms-remote-test, r=oli-obk
kennytm [Sat, 2 Mar 2019 06:55:23 +0000 (14:55 +0800)]
Rollup merge of #58835 - Centril:rust_2018_idioms-remote-test, r=oli-obk

tools/remote-test-{client,server}: deny(rust_2018_idioms)

r? @oli-obk

(+ tiny amount of cleanup)