]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #54257 - alexcrichton:wasm-math-symbols, r=TimNN
kennytm [Thu, 20 Sep 2018 13:36:21 +0000 (21:36 +0800)]
Rollup merge of #54257 - alexcrichton:wasm-math-symbols, r=TimNN

Switch wasm math symbols to their original names

The names `Math_*` were given to help undefined symbol messages indicate how to
implement them, but these are all implemented in compiler-rt now so there's no
need to rename them! This change should make it so wasm binaries by default, no
matter the math symbols used, will not have unresolved symbols.

5 years agoRollup merge of #54233 - irinagpopa:llvm-3.9, r=tromey
kennytm [Thu, 20 Sep 2018 13:36:19 +0000 (21:36 +0800)]
Rollup merge of #54233 - irinagpopa:llvm-3.9, r=tromey

Remove LLVM 3.9 workaround.

5 years agoRollup merge of #53470 - bjorn3:warn_metadata_errors, r=alexcrichton
kennytm [Thu, 20 Sep 2018 13:36:18 +0000 (21:36 +0800)]
Rollup merge of #53470 - bjorn3:warn_metadata_errors, r=alexcrichton

Warn about metadata loader errors

Output when writing corrupting to libcore.rlib

```
warning: no metadata found: failed to read rlib metadata in '/Users/bjorn/Documents/rust_fork/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/libcore-857d662d379c5d0c.rlib': File too small to be an archive

error[E0463]: can't find crate for `core`

error: aborting due to previous error
```

Fixes #53381

5 years agoRollup merge of #52813 - newpavlov:duration_mul_div_extras, r=alexcrichton
kennytm [Thu, 20 Sep 2018 13:36:16 +0000 (21:36 +0800)]
Rollup merge of #52813 - newpavlov:duration_mul_div_extras, r=alexcrichton

Duration div mul extras

Successor of #52556.

This PR adds the following `impl`s:
- `impl Mul<Duration> for u32` (to allow `10*SECOND` in addition to `SECOND*10`)
- `impl Mul<f64> for Duration` (to allow `2.5*SECOND` vs `2*SECOND + 500*MILLISECOND`)
- `impl Mul<Duration> for f64`
- `impl MulAssign<f64> for Duration`
- `impl Div<f64> for Duration`
- `impl DivAssign<f64> for Duration`
- `impl Div<Duration> for Duration` (`Output = f64`, can be useful e.g. for `duration/MINUTE`)

`f64` is chosen over `f32` to minimize rounding errors. (52 bits fraction precision vs `Duration`'s ~94 bit)

5 years agoAuto merge of #54255 - spastorino:use-of-moved-value-error, r=nikomatsakis
bors [Thu, 20 Sep 2018 09:02:46 +0000 (09:02 +0000)]
Auto merge of #54255 - spastorino:use-of-moved-value-error, r=nikomatsakis

Inspect parents paths when checking for moves

Closes #52669

5 years agoAuto merge of #54241 - vi:suggest_with_applicability, r=estebank
bors [Thu, 20 Sep 2018 06:34:22 +0000 (06:34 +0000)]
Auto merge of #54241 - vi:suggest_with_applicability, r=estebank

Remove usages of span_suggestion without Applicability

Use `Applicability::Unspecified` for all of them instead.

Shall deprecations for the non-`_with_applicability` functions be added?

Shall clippy be addressed somehow?

r? @estebank

5 years agoAuto merge of #54301 - alexcrichton:update-curl, r=Mark-Simulacrum
bors [Thu, 20 Sep 2018 02:51:56 +0000 (02:51 +0000)]
Auto merge of #54301 - alexcrichton:update-curl, r=Mark-Simulacrum

Update some `*-sys` dependencies of Cargo/RLS

This is intended to help solve #54206 on nightly where the RLS on MinGW is
having build issues with accidentally building a `curl` library which links to
pthread symbols on Windows (where it should use native mutex locking instead).
The build system for these `*-sys` crates have all been rewritten to be based on
`cc` to bypass native build systems and platform detection to make sure we
configure them correctly.

5 years agoUpdate some `*-sys` dependencies of Cargo/RLS
Alex Crichton [Mon, 17 Sep 2018 16:52:02 +0000 (09:52 -0700)]
Update some `*-sys` dependencies of Cargo/RLS

This is intended to help solve #54206 on nightly where the RLS on MinGW is
having build issues with accidentally building a `curl` library which links to
pthread symbols on Windows (where it should use native mutex locking instead).
The build system for these `*-sys` crates have all been rewritten to be based on
`cc` to bypass native build systems and platform detection to make sure we
configure them correctly.

5 years agoAuto merge of #54211 - nnethercote:keccak-Liveness-memory, r=nikomatsakis
bors [Thu, 20 Sep 2018 00:16:46 +0000 (00:16 +0000)]
Auto merge of #54211 - nnethercote:keccak-Liveness-memory, r=nikomatsakis

Split `Liveness::users` into three.

This reduces memory usage on some benchmarks because no space is wasted
for padding. For a `check-clean` build of `keccak` it reduces `max-rss`
by 20%.

r? @nikomatsakis, but I want to do a perf run. Locally, I had these results:
- instructions: slight regression
- max-rss: big win on "Clean" builds
- faults: big win on "Clean" and "Nll" builds
- wall-time: small win on "Clean" and "Nll" builds

So I want to see how a different machine compares.

5 years agoAuto merge of #54174 - parched:park, r=alexcrichton
bors [Wed, 19 Sep 2018 17:08:28 +0000 (17:08 +0000)]
Auto merge of #54174 - parched:park, r=alexcrichton

Fix `thread` `park`/`unpark` synchronization

Previously the code below would not be guaranteed to exit when the
second unpark took the `return, // already unparked` path because there
was no write to synchronize with a read in `park`.

EDIT: doesn't actually require third thread
```
use std::sync::atomic::{AtomicBool, Ordering};
use std::thread::{current, spawn, park};

static FLAG: AtomicBool = AtomicBool::new(false);

fn main() {
    let thread_0 = current();
    spawn(move || {
        thread_0.unpark();
        FLAG.store(true, Ordering::Relaxed);
        thread_0.unpark();
    });

    while !FLAG.load(Ordering::Relaxed) {
        park();
    }
}
```

I have some other ideas on how to improve the performance of `park` and `unpark` using fences, avoiding any atomic RMW when the state is already `NOTIFIED`, and also how to avoid calling `notify_one` without the mutex locked. But I need to write some micro benchmarks first, so I'll submit those changes at a later date if they prove to be faster.

Fixes https://github.com/rust-lang/rust/issues/53366 I hope.

5 years agoAdded tracking issue, fixed check, 1.30 -> 1.31
Artyom Pavlov [Wed, 19 Sep 2018 15:40:33 +0000 (18:40 +0300)]
Added tracking issue, fixed check, 1.30 -> 1.31

5 years agoAuto merge of #54101 - osa1:issue_54099, r=nikomatsakis
bors [Wed, 19 Sep 2018 09:20:36 +0000 (09:20 +0000)]
Auto merge of #54101 - osa1:issue_54099, r=nikomatsakis

Fix camel case type warning for types with trailing underscores

Fixes #54099

5 years agoAuto merge of #53877 - withoutboats:compositional-pin, r=aturon
bors [Wed, 19 Sep 2018 06:56:19 +0000 (06:56 +0000)]
Auto merge of #53877 - withoutboats:compositional-pin, r=aturon

Update to a new pinning API.

~~Blocked on #53843 because of method resolution problems with new pin type.~~

@r? @cramertj

cc @RalfJung @pythonesque anyone interested in #49150

5 years agoAuto merge of #54318 - nnethercote:use-HybridBitSet-in-SparseBitMatrix, r=pnkfelix
bors [Wed, 19 Sep 2018 02:37:37 +0000 (02:37 +0000)]
Auto merge of #54318 - nnethercote:use-HybridBitSet-in-SparseBitMatrix, r=pnkfelix

Use `HybridBitSet` in `SparseBitMatrix`.

This fixes most of the remaining NLL memory regression.

r? @pnkfelix, because you reviewed #54286.
cc @nikomatsakis, because NLL
cc @Mark-Simulacrum, because this removes `array_vec.rs`
cc @lqd, because this massively improves `unic-ucd-name`, and probably other public crates

5 years agoAuto merge of #53995 - davidtwco:issue-53807, r=nikomatsakis
bors [Wed, 19 Sep 2018 00:01:51 +0000 (00:01 +0000)]
Auto merge of #53995 - davidtwco:issue-53807, r=nikomatsakis

NLL: Deduplicate errors for incorrect move in loop

Fixes #53807.

r? @nikomatsakis

5 years agoCleanup Deref impls and add ?Sized bound to &mut T impls
Taylor Cramer [Tue, 18 Sep 2018 18:48:03 +0000 (11:48 -0700)]
Cleanup Deref impls and add ?Sized bound to &mut T impls

5 years agoExpand synchronization comments in `park`/`unpark`
James Duley [Tue, 18 Sep 2018 16:51:49 +0000 (17:51 +0100)]
Expand synchronization comments in `park`/`unpark`

5 years agoSwitched from FxHashMap to BTreeMap to preserve ordering when iterating.
David Wood [Tue, 11 Sep 2018 14:01:53 +0000 (16:01 +0200)]
Switched from FxHashMap to BTreeMap to preserve ordering when iterating.

5 years agoDe-duplicate moved variable errors.
David Wood [Thu, 6 Sep 2018 13:48:33 +0000 (15:48 +0200)]
De-duplicate moved variable errors.

By introducing a new map that tracks the errors reported and the
`Place`s that spawned those errors against the move out that the error
was referring to, we are able to silence duplicate errors by emitting
only the error which corresponds to the most specific `Place` (that which
other `Place`s which reported errors are prefixes of).

This generally is an improvement, however there is a case -
`liveness-move-in-while` - where the output regresses.

5 years agoLog when buffering a diagnostic.
David Wood [Thu, 6 Sep 2018 11:07:14 +0000 (13:07 +0200)]
Log when buffering a diagnostic.

This is useful in debugging when and where errors are emitted in
logs.

5 years agoAuto merge of #54034 - pnkfelix:issue-15287-bind-by-move-pattern-guards, r=nikomatsakis
bors [Tue, 18 Sep 2018 11:39:51 +0000 (11:39 +0000)]
Auto merge of #54034 - pnkfelix:issue-15287-bind-by-move-pattern-guards, r=nikomatsakis

Add feature to enable bind by move pattern guards

Implement #15287 as described on https://github.com/rust-lang/rust/issues/15287#issuecomment-404827419

5 years agoAuto merge of #54319 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Tue, 18 Sep 2018 09:06:42 +0000 (09:06 +0000)]
Auto merge of #54319 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 9 pull requests

Successful merges:

 - #53522 (Add doc for impl From for Addr)
 - #54097 (rustdoc: Remove namespace for keywords)
 - #54205 (Add treat-err-as-bug flag in rustdoc)
 - #54225 (Regression test for rust-lang/rust#53675.)
 - #54232 (add `-Z dont-buffer-diagnostics`)
 - #54273 (Suggest to change numeric literal instead of casting)
 - #54299 (Issue 54246)
 - #54311 (Remove README with now-out-of-date docs about docs.)
 - #54313 (OsStr: Document that it's not NUL terminated)

Failed merges:

r? @ghost

5 years agoRemove outdated rustdoc PinBox tests
Taylor Cramer [Tue, 18 Sep 2018 08:42:27 +0000 (01:42 -0700)]
Remove outdated rustdoc PinBox tests

5 years agoRollup merge of #54313 - cgwalters:osstr-ref-cstr, r=joshtriplett
Guillaume Gomez [Tue, 18 Sep 2018 08:21:44 +0000 (10:21 +0200)]
Rollup merge of #54313 - cgwalters:osstr-ref-cstr, r=joshtriplett

OsStr: Document that it's not NUL terminated

I somehow got confused into thinking this was the case, but
it's definitely not.  Let's help the common case of people who
have an `OsStr` and need to call e.g. Unix APIs.

5 years agoRollup merge of #54311 - frewsxcv:frewsxcv-readme, r=GuillaumeGomez
Guillaume Gomez [Tue, 18 Sep 2018 08:21:42 +0000 (10:21 +0200)]
Rollup merge of #54311 - frewsxcv:frewsxcv-readme, r=GuillaumeGomez

Remove README with now-out-of-date docs about docs.

These docs haven't really been touched in years, and from what I tried, the `rustdoc` commands don't work. Seems like we don't need this?

5 years agoRollup merge of #54299 - snaedis:issue-54246, r=varkor
Guillaume Gomez [Tue, 18 Sep 2018 08:21:41 +0000 (10:21 +0200)]
Rollup merge of #54299 - snaedis:issue-54246, r=varkor

Issue 54246

I added the option of providing a help message for deprecated features, that takes precedence over the default `help: remove this attribute` message, along with messages for the features that mention replacements in the reason for deprecation.

Fixes #54246.

5 years agoRollup merge of #54273 - csmoe:lint_ty_lit, r=estebank
Guillaume Gomez [Tue, 18 Sep 2018 08:21:40 +0000 (10:21 +0200)]
Rollup merge of #54273 - csmoe:lint_ty_lit, r=estebank

Suggest to change numeric literal instead of casting

Closes #54160
r? @estebank

5 years agoRollup merge of #54232 - pnkfelix:add-way-to-disable-diagnostic-buffering, r=nikomatsakis
Guillaume Gomez [Tue, 18 Sep 2018 08:21:39 +0000 (10:21 +0200)]
Rollup merge of #54232 - pnkfelix:add-way-to-disable-diagnostic-buffering, r=nikomatsakis

add `-Z dont-buffer-diagnostics`

Add `-Z dont-buffer-diagnostics`, a way to force NLL to immediately its diagnostics.

This is mainly intended for developers who want to see the error in its original context in the control flow. Two uses cases for that are:

  1. `-Z treat-err-as-bug` (which then allows extraction of a stack-trace to the origin of the error)

  2. RUST_LOG=... rustc, in which case it is often useful to see the logging statements that occurred immediately prior to the point where the diagnostic was signalled.

5 years agoRollup merge of #54225 - pnkfelix:issue-53675-add-test-called-panic, r=petrochenkov
Guillaume Gomez [Tue, 18 Sep 2018 08:21:37 +0000 (10:21 +0200)]
Rollup merge of #54225 - pnkfelix:issue-53675-add-test-called-panic, r=petrochenkov

Regression test for rust-lang/rust#53675.

(Includes a couple variations on the theme. I confirmed that the ones
in `in_expression_position` and `what_if_we_use_panic_directly_in_expr`
both failed back on "rustc 1.30.0-nightly (0f063aef6 2018-09-03)".)

Fix #53675

5 years agoRollup merge of #54205 - GuillaumeGomez:treat-err-as-bug, r=QuietMisdreavus
Guillaume Gomez [Tue, 18 Sep 2018 08:21:36 +0000 (10:21 +0200)]
Rollup merge of #54205 - GuillaumeGomez:treat-err-as-bug, r=QuietMisdreavus

Add treat-err-as-bug flag in rustdoc

cc @nikomatsakis
r? @QuietMisdreavus

5 years agoRollup merge of #54097 - GuillaumeGomez:remove-keyword-namespace, r=QuietMisdreavus
Guillaume Gomez [Tue, 18 Sep 2018 08:21:35 +0000 (10:21 +0200)]
Rollup merge of #54097 - GuillaumeGomez:remove-keyword-namespace, r=QuietMisdreavus

rustdoc: Remove namespace for keywords

Fixes #54084.

r? @QuietMisdreavus

5 years agoRollup merge of #53522 - phungleson:fix-impl-from-for-addr, r=TimNN
Guillaume Gomez [Tue, 18 Sep 2018 08:21:33 +0000 (10:21 +0200)]
Rollup merge of #53522 - phungleson:fix-impl-from-for-addr, r=TimNN

Add doc for impl From for Addr

As part of issue #51430 (cc @skade).

The impl is very simple, let me know if we need to go into any details.

Additionally, I added `#[inline]` for the conversion method, let me know if it is un-necessary or might break something.

5 years agoUse `HybridBitSet` for rows within `SparseBitMatrix`.
Nicholas Nethercote [Tue, 18 Sep 2018 04:21:41 +0000 (14:21 +1000)]
Use `HybridBitSet` for rows within `SparseBitMatrix`.

This requires adding a few extra methods to `HybridBitSet`. (These are
tested in a new unit test.)

This commit reduces the `max-rss` for `nll-check` builds of `html5ever`
by 46%, `ucd` by 45%, `clap-rs` by 23%, `inflate` by 14%. And the
results for the `unic-ucd-name` crate are even more impressive: a 21%
reduction in instructions, a 60% reduction in wall-time, a 96%
reduction in `max-rss`, and a 97% reduction in faults!

Fixes #52028.

5 years agoRemove `array_vec.rs`.
Nicholas Nethercote [Tue, 18 Sep 2018 03:51:20 +0000 (13:51 +1000)]
Remove `array_vec.rs`.

`SparseBitSet` is the only remaining user of `ArrayVec`. This commit
switches it to using `SmallVec`, and removes `array_vec.rs`.

Why the switch? Although `SparseBitSet` is size-limited and doesn't need
the ability to spill to the heap, `SmallVec` has many more features than
`ArrayVec`. In particular, it's now possible to keep `SparseBitSet`'s
elements in sorted order, which gives in-order iteration, which is a
requirement for the next commit.

5 years agoUse `elem` instead of `bit` consistently for arguments.
Nicholas Nethercote [Tue, 18 Sep 2018 03:40:19 +0000 (13:40 +1000)]
Use `elem` instead of `bit` consistently for arguments.

5 years agoAuto merge of #53900 - davidtwco:issue-53771, r=nikomatsakis
bors [Tue, 18 Sep 2018 06:24:56 +0000 (06:24 +0000)]
Auto merge of #53900 - davidtwco:issue-53771, r=nikomatsakis

NLL regresses diagnostic for impl-trait/static-return-lifetime-infered.rs

Fixes #53771.

r? @nikomatsakis
cc @pnkfelix @estebank

5 years agoAuto merge of #54286 - nnethercote:BitSet, r=pnkfelix
bors [Tue, 18 Sep 2018 03:52:39 +0000 (03:52 +0000)]
Auto merge of #54286 - nnethercote:BitSet, r=pnkfelix

Merge `bitvec.rs` and `indexed_set.rs`

Because it's not good to have two separate implementations. Also, I will combine the best parts of each to improve NLL memory usage on some benchmarks significantly.

5 years agoOsStr: Document that it's not NUL terminated
Colin Walters [Tue, 18 Sep 2018 01:10:36 +0000 (21:10 -0400)]
OsStr: Document that it's not NUL terminated

I somehow got confused into thinking this was the case, but
it's definitely not.  Let's help the common case of people who
have an `OsStr` and need to call e.g. Unix APIs.

5 years agoRemove REAMDE with now-out-of-date docs about docs.
Corey Farwell [Tue, 18 Sep 2018 00:11:29 +0000 (20:11 -0400)]
Remove REAMDE with now-out-of-date docs about docs.

5 years agoCleanup and fix method resolution issue
Taylor Cramer [Sat, 15 Sep 2018 00:40:52 +0000 (17:40 -0700)]
Cleanup and fix method resolution issue

5 years agoAuto merge of #52036 - collin5:b50509-2, r=collin5
bors [Mon, 17 Sep 2018 21:15:12 +0000 (21:15 +0000)]
Auto merge of #52036 - collin5:b50509-2, r=collin5

Clean up dependency tracking in Rustbuild [2/2]

Make `clear_if_dirty` calls in `Builder::cargo` with stamp dependencies for the given Mode.

Continuation of #50904
Ref issue #50509
r? @Mark-Simulacrum

5 years agoSome "word"-related improvements.
Nicholas Nethercote [Mon, 17 Sep 2018 04:39:59 +0000 (14:39 +1000)]
Some "word"-related improvements.

- Rename `BitSet::data` and `BitMatrix::vector` as `words`, because that's
  what they are.

- Remove `BitSet::words_mut()`, which is no longer necessary.

- Better distinguish multiple meanins of "word", i.e. "word index" vs
  "word ref" vs "word" (i.e. the value itself).

5 years agoEliminate `BitwiseOperator`.
Nicholas Nethercote [Mon, 17 Sep 2018 03:52:35 +0000 (13:52 +1000)]
Eliminate `BitwiseOperator`.

`BitwiseOperator` is an unnecessarily low-level thing. This commit
replaces it with `BitSetOperator`, which works on `BitSet`s instead of
words. Within `bit_set.rs`, the commit eliminates `Intersect`, `Union`,
and `Subtract` by instead passing a function to `bitwise()`.

5 years agoMerge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.
Nicholas Nethercote [Fri, 14 Sep 2018 05:07:25 +0000 (15:07 +1000)]
Merge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.

Currently we have two files implementing bitsets (and 2D bit matrices).
This commit combines them into one, taking the best features from each.

This involves renaming a lot of things. The high level changes are as
follows.
- bitvec.rs              --> bit_set.rs
- indexed_set.rs         --> (removed)
- BitArray + IdxSet      --> BitSet (merged, see below)
- BitVector              --> GrowableBitSet
- {,Sparse,Hybrid}IdxSet --> {,Sparse,Hybrid}BitSet
- BitMatrix              --> BitMatrix
- SparseBitMatrix        --> SparseBitMatrix

The changes within the bitset types themselves are as follows.

```
OLD             OLD             NEW
BitArray<C>     IdxSet<T>       BitSet<T>
--------        ------          ------
grow            -               grow
new             -               (remove)
new_empty       new_empty       new_empty
new_filled      new_filled      new_filled
-               to_hybrid       to_hybrid
clear           clear           clear
set_up_to       set_up_to       set_up_to
clear_above     -               clear_above
count           -               count
contains(T)     contains(&T)    contains(T)
contains_all    -               superset
is_empty        -               is_empty
insert(T)       add(&T)         insert(T)
insert_all      -               insert_all()
remove(T)       remove(&T)      remove(T)
words           words           words
words_mut       words_mut       words_mut
-               overwrite       overwrite
merge           union           union
-               subtract        subtract
-               intersect       intersect
iter            iter            iter
```

In general, when choosing names I went with:
- names that are more obvious (e.g. `BitSet` over `IdxSet`).
- names that are more like the Rust libraries (e.g. `T` over `C`,
  `insert` over `add`);
- names that are more set-like (e.g. `union` over `merge`, `superset`
  over `contains_all`, `domain_size` over `num_bits`).

Also, using `T` for index arguments seems more sensible than `&T` --
even though the latter is standard in Rust collection types -- because
indices are always copyable. It also results in fewer `&` and `*`
sigils in practice.

5 years agoAuto merge of #54277 - petrochenkov:afterder, r=alexcrichton
bors [Mon, 17 Sep 2018 18:13:26 +0000 (18:13 +0000)]
Auto merge of #54277 - petrochenkov:afterder, r=alexcrichton

Temporarily prohibit proc macro attributes placed after derives

... and also proc macro attributes used together with `#[test]`/`#[bench]`.

Addresses item 6 from https://github.com/rust-lang/rust/pull/50911#issuecomment-411605393.

The end goal is straightforward predictable left-to-right expansion order for attributes.
Right now derives are expanded last regardless of their relative ordering with macro attributes and right now it's simpler to temporarily prohibit macro attributes placed after derives than changing the expansion order.
I'm not sure whether the new beta is already released or not, but if it's released, then this patch needs to be backported, so the solution needs to be minimal.

How to fix broken code (derives):
- Move macro attributes above derives. This won't change expansion order, they are expanded before derives anyway.

Using attribute macros on same items with `#[test]` and `#[bench]` is prohibited for similar expansion order reasons, but this one is going to be reverted much sooner than restrictions on derives.

How to fix broken code (test/bench):
- Enable `#![feature(plugin)]` (don't ask why).

r? @ghost

5 years agoWhitespace fix again.
Vitaly _Vi Shukela [Mon, 17 Sep 2018 17:13:08 +0000 (20:13 +0300)]
Whitespace fix again.

5 years agoInspect parents paths when checking for moves
Santiago Pastorino [Sat, 15 Sep 2018 15:29:29 +0000 (12:29 -0300)]
Inspect parents paths when checking for moves

5 years agolibsyntax: add optional help message for deprecated features
Alva Snædís [Mon, 17 Sep 2018 03:40:31 +0000 (03:40 +0000)]
libsyntax: add optional help message for deprecated features

5 years agoAuto merge of #54293 - flip1995:clippyup, r=Manishearth
bors [Mon, 17 Sep 2018 15:39:00 +0000 (15:39 +0000)]
Auto merge of #54293 - flip1995:clippyup, r=Manishearth

Update Clippy

Fix Clippy test-fail due to #53910

r? @Manishearth @SimonSapin

5 years agoUpdate Clippy
flip1995 [Mon, 17 Sep 2018 13:37:19 +0000 (15:37 +0200)]
Update Clippy

5 years agoBetter trick for allowing trailing comma at forward!
Vitaly _Vi Shukela [Mon, 17 Sep 2018 13:33:37 +0000 (16:33 +0300)]
Better trick for allowing trailing comma at forward!

5 years agoAdd -Z dont-buffer-diagnostics, a way to force NLL to immediately emit its diagnostics.
Felix S. Klock II [Sat, 15 Sep 2018 04:27:55 +0000 (06:27 +0200)]
Add -Z dont-buffer-diagnostics, a way to force NLL to immediately emit its diagnostics.

This is mainly intended for `rustc` developers who want to see a
diagnostic in its original context in the control flow.  Two uses
cases for that are:

 * `-Z treat-err-as-bug` which then allows extraction of a stack-trace to the origin of the error
   (a case that is so important that we make that flag imply this one, effectively).

 * `RUST_LOG=... rustc`, in which case it is often useful to see the logging statements that
   occurred immediately prior to the point where the diagnostic was signalled.

Drive-by: Added some documentation pointing future devs at
HandlerFlags, and documented the fields of `HandlerFlags` itself.

5 years agolibsyntax: fix casing in error message
Alva Snædís [Mon, 17 Sep 2018 03:38:15 +0000 (03:38 +0000)]
libsyntax: fix casing in error message

5 years agoOn nightly with NLL, suggest `#![feature(bind_by_move_pattern_guards)]` when it might...
Felix S. Klock II [Mon, 10 Sep 2018 09:47:28 +0000 (11:47 +0200)]
On nightly with NLL, suggest `#![feature(bind_by_move_pattern_guards)]` when it might fix the code.

5 years agoTests for `feature(bind_by_move_pattern_guards)`.
Felix S. Klock II [Fri, 7 Sep 2018 15:52:49 +0000 (17:52 +0200)]
Tests for `feature(bind_by_move_pattern_guards)`.

Apparently copyright notices are no longer necessary apparently.
(See #43498 and #53654.)

5 years agoAdd `feature(bind_by_move_pattern_guards)`.
Felix S. Klock II [Fri, 7 Sep 2018 15:52:27 +0000 (17:52 +0200)]
Add `feature(bind_by_move_pattern_guards)`.

Note it requires MIR-borrowck to be enabled to actually do anything.

Note also that it implicitly turns off our AST-based check for
mutation in guards.

5 years agorefactor Builder::cargo, clean deps for cmd!=test
Collins Abitekaniza [Mon, 17 Sep 2018 11:19:44 +0000 (14:19 +0300)]
refactor Builder::cargo, clean deps for cmd!=test

5 years agoFixed some remaining whitespace issues.
Vitaly _Vi Shukela [Mon, 17 Sep 2018 09:52:08 +0000 (12:52 +0300)]
Fixed some remaining whitespace issues.

(Not sure if it is correct although).

5 years agoAuto merge of #54249 - RalfJung:miri, r=eddyb
bors [Mon, 17 Sep 2018 08:59:11 +0000 (08:59 +0000)]
Auto merge of #54249 - RalfJung:miri, r=eddyb

Update miri

5 years agoupdate miri
Ralf Jung [Mon, 17 Sep 2018 07:20:03 +0000 (09:20 +0200)]
update miri

5 years agoAuto merge of #54260 - maxdeviant:public-scope-fields, r=petrochenkov
bors [Mon, 17 Sep 2018 06:34:29 +0000 (06:34 +0000)]
Auto merge of #54260 - maxdeviant:public-scope-fields, r=petrochenkov

Make rustc::middle::region::Scope's fields public

This PR makes the following changes to `rustc::middle::region::Scope`:

- [x] Makes `region::Scope`'s fields public
- [x] Removes the `impl Scope` block with constructors (as per [this comment](https://github.com/rust-lang/rust/pull/54032#discussion_r216618208))
- [x] Updates call sites throughout the compiler

Closes #54122.

5 years agoadd test for float/integer
csmoe [Mon, 17 Sep 2018 01:29:57 +0000 (09:29 +0800)]
add test for float/integer

5 years agomerge into/literal suggestion for DRY
csmoe [Mon, 17 Sep 2018 01:24:33 +0000 (09:24 +0800)]
merge into/literal suggestion for DRY

5 years agoAuto merge of #54254 - RalfJung:miri-dangling, r=eddyb
bors [Mon, 17 Sep 2018 03:58:41 +0000 (03:58 +0000)]
Auto merge of #54254 - RalfJung:miri-dangling, r=eddyb

miri engine: keep around some information for dead allocations

We use it to test if a dangling ptr is aligned and non-NULL. This makes some code pass that should pass (writing a ZST to a properly aligned dangling pointer), and makes some code fail that should fail (writing a ZST to a pointer obtained via pointer arithmetic from a real location, but ouf-of-bounds -- that pointer could be NULL, so we cannot allow writing to it).

CTFE does not allow these operations; tests are added to miri with https://github.com/solson/miri/pull/453.

5 years agoAuto merge of #54247 - Munksgaard:better-error-message-in-no_lookup_host_duplicates...
bors [Mon, 17 Sep 2018 01:36:58 +0000 (01:36 +0000)]
Auto merge of #54247 - Munksgaard:better-error-message-in-no_lookup_host_duplicates, r=alexcrichton

Improve output if no_lookup_host_duplicates test fails

If the test fails, output the offending addresses and a helpful error message.
Also slightly improve legibility of the preceding line that puts the addresses
into a HashMap.

5 years agoFill in suggestions Applicability according to @estebank
Vitaly _Vi Shukela [Mon, 17 Sep 2018 00:16:08 +0000 (03:16 +0300)]
Fill in suggestions Applicability according to @estebank

Also fix some formatting along the way.

5 years agoFix tidy's too long lines.
Vitaly _Vi Shukela [Sun, 16 Sep 2018 23:51:50 +0000 (02:51 +0300)]
Fix tidy's too long lines.

5 years agoChange diagnostic_builder's forward! macro to enforce trailing argument comma
Vitaly _Vi Shukela [Sun, 16 Sep 2018 23:50:00 +0000 (02:50 +0300)]
Change diagnostic_builder's forward! macro to enforce trailing argument comma

5 years agoFix style according to review comments.
Vitaly _Vi Shukela [Sun, 16 Sep 2018 23:40:44 +0000 (02:40 +0300)]
Fix style according to review comments.

5 years agoAuto merge of #53910 - IsaacWoods:unify_cvoid, r=SimonSapin
bors [Sun, 16 Sep 2018 23:13:30 +0000 (23:13 +0000)]
Auto merge of #53910 - IsaacWoods:unify_cvoid, r=SimonSapin

Move std::os::raw::c_void into libcore and re-export in libstd

Implements the first part of [RFC 2521](https://github.com/rust-lang/rfcs/pull/2521).

cc #53856

5 years agoAuto merge of #53461 - petrochenkov:pmu, r=alexcrichton
bors [Sun, 16 Sep 2018 20:28:21 +0000 (20:28 +0000)]
Auto merge of #53461 - petrochenkov:pmu, r=alexcrichton

resolve: Do not error on access to proc macros imported with `#[macro_use]`

This error is artificial, but previously, when `#[macro_use] extern crate x;` was stable, but non-derive proc macros were not, it worked like kind of a feature gate. Now both features are stable, so the error is no longer necessary.

This PR simplifies how `#[macro_use] extern crate x;` works - it takes all items from macro namespace of `x`'s root and puts them into macro prelude from which they all can now be accessed.

5 years agoFixup inaccurate rebase
Vitaly _Vi Shukela [Sun, 16 Sep 2018 19:13:41 +0000 (22:13 +0300)]
Fixup inaccurate rebase

5 years agotrailing whitespace fix
Vitaly _Vi Shukela [Sat, 15 Sep 2018 13:12:17 +0000 (16:12 +0300)]
trailing whitespace fix

5 years agoDeprecate *_suggestion* that are without explicit applicability
Vitaly _Vi Shukela [Sat, 15 Sep 2018 11:58:25 +0000 (14:58 +0300)]
Deprecate *_suggestion* that are without explicit applicability

5 years agoAttach Applicability to multipart_suggestion and span_suggestions
Vitaly _Vi Shukela [Sat, 15 Sep 2018 12:03:02 +0000 (15:03 +0300)]
Attach Applicability to multipart_suggestion and span_suggestions

5 years agoAdd multipart_suggestion_with_applicability
Vitaly _Vi Shukela [Sat, 15 Sep 2018 11:44:28 +0000 (14:44 +0300)]
Add multipart_suggestion_with_applicability

5 years agoRemove usages of span_suggestion without Applicability
Vitaly _Vi Shukela [Sat, 15 Sep 2018 00:18:29 +0000 (03:18 +0300)]
Remove usages of span_suggestion without Applicability

Use Applicability::Unspecified for all of them instead.

5 years agoresolve: Do not error on access to proc macros imported with `#[macro_use]`
Vadim Petrochenkov [Fri, 17 Aug 2018 23:04:50 +0000 (02:04 +0300)]
resolve: Do not error on access to proc macros imported with `#[macro_use]`

5 years agoAuto merge of #53804 - RalfJung:ptr-invalid, r=nagisa
bors [Sun, 16 Sep 2018 18:03:39 +0000 (18:03 +0000)]
Auto merge of #53804 - RalfJung:ptr-invalid, r=nagisa

fix some uses of pointer intrinsics with invalid pointers

[Found by miri](https://github.com/solson/miri/pull/446):

* `Vec::into_iter` calls `ptr::read` (and the underlying `copy_nonoverlapping`) with an unaligned pointer to a ZST. [According to LLVM devs](https://bugs.llvm.org/show_bug.cgi?id=38583), this is UB because it contradicts the metadata we are attaching to that pointer.
* `HashMap` creation calls `ptr:.write_bytes` on a NULL pointer with a count of 0. This is likely not currently UB *currently*, but it violates the rules we are setting in https://github.com/rust-lang/rust/pull/53783, and we might want to exploit those rules later (e.g. with more `nonnull` attributes for LLVM).

    Probably what `HashMap` really should do is use `NonNull::dangling()` instead of 0 for the empty case, but that would require a more careful analysis of the code.

It seems like ideally, we should do a review of usage of such intrinsics all over libstd to ensure that they use valid pointers even when the size is 0. Is it worth opening an issue for that?

5 years agoTemporarily prohibit proc macro attributes placed after derives
Vadim Petrochenkov [Sun, 16 Sep 2018 14:15:07 +0000 (17:15 +0300)]
Temporarily prohibit proc macro attributes placed after derives

... and also proc macro attributes used together with test/bench.

5 years agoAuto merge of #54270 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 16 Sep 2018 15:42:02 +0000 (15:42 +0000)]
Auto merge of #54270 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 5 pull requests

Successful merges:

 - #53941 (rustdoc: Sort implementors)
 - #54181 (Suggest && and || instead of 'and' and 'or')
 - #54209 (Partially revert 674a5db "Fix undesirable fallout [from macro modularization]")
 - #54213 (De-overlap the lifetimes of `flow_inits` and `flow_{un,ever_}inits`.)
 - #54244 (Add a small search box to seach Rust's standary library)

Failed merges:

r? @ghost

5 years agotrim type numeric literal suffix
csmoe [Sun, 16 Sep 2018 15:13:17 +0000 (23:13 +0800)]
trim type numeric literal suffix

5 years agoadd test for numeric literal cast
csmoe [Sun, 16 Sep 2018 13:13:11 +0000 (21:13 +0800)]
add test for numeric literal cast

5 years agoreplace old literal in expr
csmoe [Sun, 16 Sep 2018 13:12:23 +0000 (21:12 +0800)]
replace old literal in expr

5 years agouse mem::zeroed to make up ZST values
Ralf Jung [Sun, 16 Sep 2018 12:26:27 +0000 (14:26 +0200)]
use mem::zeroed to make up ZST values

5 years agolint to change numeric literal instead of into
csmoe [Sun, 16 Sep 2018 12:03:44 +0000 (20:03 +0800)]
lint to change numeric literal instead of into

5 years agoRollup merge of #54244 - kzys:search-box, r=GuillaumeGomez
Guillaume Gomez [Sun, 16 Sep 2018 10:25:46 +0000 (12:25 +0200)]
Rollup merge of #54244 - kzys:search-box, r=GuillaumeGomez

Add a small search box to seach Rust's standary library

This change partially addresses #14572. No CSS doesn't look fancy
but at least it is functional.

5 years agoRollup merge of #54213 - nnethercote:keccak-flow_inits-memory, r=nikomatsakis
Guillaume Gomez [Sun, 16 Sep 2018 10:25:45 +0000 (12:25 +0200)]
Rollup merge of #54213 - nnethercote:keccak-flow_inits-memory, r=nikomatsakis

De-overlap the lifetimes of `flow_inits` and `flow_{un,ever_}inits`.

This reduces `max-rss` for an `nll-check` build by 27% for `keccak`, and
by 8% for `inflate`.

r? @nikomatsakis

5 years agoRollup merge of #54209 - petrochenkov:mexpr, r=pnkfelix
Guillaume Gomez [Sun, 16 Sep 2018 10:25:43 +0000 (12:25 +0200)]
Rollup merge of #54209 - petrochenkov:mexpr, r=pnkfelix

Partially revert 674a5db "Fix undesirable fallout [from macro modularization]"

Partially revert https://github.com/rust-lang/rust/commit/674a5db1a50e25dd60a8ee6669edee9a366c9fab

~~Closes~~ (see pnkfelix comments below) https://github.com/rust-lang/rust/issues/53675

5 years agoRollup merge of #54181 - vi:hint_and_or, r=estebank
Guillaume Gomez [Sun, 16 Sep 2018 10:25:42 +0000 (12:25 +0200)]
Rollup merge of #54181 - vi:hint_and_or, r=estebank

Suggest && and || instead of 'and' and 'or'

Resolves #54109.

Note: competing pull reqeust: #54179

r? @csmoe

5 years agoRollup merge of #53941 - kzys:sort-impls, r=GuillaumeGomez
Guillaume Gomez [Sun, 16 Sep 2018 10:25:41 +0000 (12:25 +0200)]
Rollup merge of #53941 - kzys:sort-impls, r=GuillaumeGomez

rustdoc: Sort implementors

Fixes #53812

5 years agoAuto merge of #54157 - euclio:structured-suggestion, r=estebank
bors [Sun, 16 Sep 2018 09:47:05 +0000 (09:47 +0000)]
Auto merge of #54157 - euclio:structured-suggestion, r=estebank

use structured suggestion for "missing mut" label

Fixes #54133 for both NLL and non-NLL.

r? @estebank

I'm not super happy with the existing wording here, since it's now a suggestion. I wonder if the message would work better as something like "help: make binding mutable: `mut foo`"?

Also, are the `HELP` and `SUGGESTION` comments necessary?

5 years agoCheck the remaining nodes
Kazuyoshi Kato [Sun, 16 Sep 2018 07:39:12 +0000 (00:39 -0700)]
Check the remaining nodes

5 years agoAuto merge of #53754 - RalfJung:slice_align_to, r=alexcrichton
bors [Sun, 16 Sep 2018 07:22:24 +0000 (07:22 +0000)]
Auto merge of #53754 - RalfJung:slice_align_to, r=alexcrichton

stabilize slice_align_to

This is very hard to implement correctly, and leads to [serious bugs](https://github.com/llogiq/bytecount/pull/42) when done incorrectly. Moreover, this is needed to be able to run code that opportunistically exploits alignment on miri. So code using `align_to`/`align_to_mut` gets the benefit of a well-tested implementation *and* of being able to run in miri to test for (some kinds of) UB.

This PR also clarifies the guarantee wrt. the middle part being as long as possible.  Should the docs say under which circumstances the middle part could be shorter? Currently, that can only happen when running in miri.

5 years agoAuto merge of #54116 - eddyb:extern-prelude, r=petrochenkov
bors [Sat, 15 Sep 2018 19:50:26 +0000 (19:50 +0000)]
Auto merge of #54116 - eddyb:extern-prelude, r=petrochenkov

rustc_resolve: allow only core, std, meta and --extern in Rust 2018 paths.

As per https://github.com/rust-lang/rust/issues/53166#issuecomment-419265401:
* Rust 2018 imports can no longer refer to crates not in "extern prelude"
  * `::foo` won't load a crate named `foo` unless `foo` is in the "extern prelude"
  * `extern crate foo;`, however, remains unchanged (can load arbitrary crates)
* `--extern crate_name` is added (note the lack of `=path`) as an unstable option
  * adds `crate_name` to the "extern prelude" (see above)
  * crate is searched in sysroot & library paths, just like `extern crate crate_name`.
  * `Cargo` support will be added later
* `core`, `std` and ~~`proc_macro`~~ `meta` are *always* available in the extern prelude
  * warning for interaction with `no_std` / `no_core` will be added later
  * **EDIT**: `proc_macro` was replaced by `meta`, see https://github.com/rust-lang/rust/issues/53166#issuecomment-421137230
    * note that there is no crate named `meta` being added, so `use meta::...;` will fail, we're only whitelisting it so we can start producing `uniform_paths` compatibility errors

Fixes #54006 (as the example now requires `--extern alloc`, which is unstable).
Fixes #54253 (hit during fixing RLS).

r? @petrochenkov cc @aturon @alexcrichton @Centril @joshtriplett

5 years agoRevert "Auto merge of #53527 - Emerentius:test_all, r=nrc"
Eduard-Mihai Burtescu [Sat, 15 Sep 2018 19:48:38 +0000 (22:48 +0300)]
Revert "Auto merge of #53527 - Emerentius:test_all, r=nrc"

This reverts commit 9f53c87b4b1f097e111c9525d60470ed22631018, reversing
changes made to cba0fdf43c22795822e1d7c751a69e6c85007221.

5 years agoUpdate submodules to include rust-lang-nursery/rust-clippy#3189 and rust-lang-nursery...
Eduard-Mihai Burtescu [Sat, 15 Sep 2018 08:40:25 +0000 (11:40 +0300)]
Update submodules to include rust-lang-nursery/rust-clippy#3189 and rust-lang-nursery/rls#1054.

5 years agorustc_resolve: use `continue` instead of `return` to "exit" a loop iteration.
Eduard-Mihai Burtescu [Sat, 15 Sep 2018 14:52:59 +0000 (17:52 +0300)]
rustc_resolve: use `continue` instead of `return` to "exit" a loop iteration.

5 years agorustc_resolve: always include core, std and meta in the extern prelude.
Eduard-Mihai Burtescu [Mon, 10 Sep 2018 16:41:30 +0000 (19:41 +0300)]
rustc_resolve: always include core, std and meta in the extern prelude.

5 years agorustc_resolve: don't allow `::crate_name` to bypass `extern_prelude`.
Eduard-Mihai Burtescu [Fri, 24 Aug 2018 15:51:32 +0000 (18:51 +0300)]
rustc_resolve: don't allow `::crate_name` to bypass `extern_prelude`.