]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #52375 - oli-obk:the_early_lint_pass_gets_the_worm, r=Manishearth
bors [Wed, 18 Jul 2018 15:04:17 +0000 (15:04 +0000)]
Auto merge of #52375 - oli-obk:the_early_lint_pass_gets_the_worm, r=Manishearth

Lint `async` identifiers in 2018 preparation mode

r? @Manishearth

fixes https://github.com/rust-lang/rust/issues/49716

6 years agoAuto merge of #52364 - ljedrz:mir_remove_clone, r=RalfJung
bors [Wed, 18 Jul 2018 11:49:38 +0000 (11:49 +0000)]
Auto merge of #52364 - ljedrz:mir_remove_clone, r=RalfJung

Remove a clone in mir/transform/add_validation

Remove a clone of `mir.local_decls`.

6 years agoMake `async_idents` allow-by-default
Oliver Schneider [Wed, 18 Jul 2018 08:55:41 +0000 (10:55 +0200)]
Make `async_idents` allow-by-default

6 years agoAuto merge of #52426 - ljedrz:#28273_cleanup, r=nikomatsakis
bors [Wed, 18 Jul 2018 09:10:16 +0000 (09:10 +0000)]
Auto merge of #52426 - ljedrz:#28273_cleanup, r=nikomatsakis

Enable default inlining in platform intrinsics

Since [#28273](https://github.com/rust-lang/rust/issues/28273) has been fixed for quite some time, it might be a good idea to return to default inlining in platform intrinsics.

6 years agoAuto merge of #52353 - alexcrichton:wasm-custom-section, r=eddyb
bors [Wed, 18 Jul 2018 03:05:27 +0000 (03:05 +0000)]
Auto merge of #52353 - alexcrichton:wasm-custom-section, r=eddyb

rustc: Use link_section, not wasm_custom_section

This commit transitions definitions of custom sections on the wasm target from
the unstable `#[wasm_custom_section]` attribute to the
already-stable-for-other-targets `#[link_section]` attribute. Mostly the same
restrictions apply as before, except that this now applies only to statics.

Closes #51088

6 years agoAuto merge of #52342 - nnethercote:CanonicalVar, r=nikomatsakis
bors [Wed, 18 Jul 2018 00:45:57 +0000 (00:45 +0000)]
Auto merge of #52342 - nnethercote:CanonicalVar, r=nikomatsakis

Avoid most allocations in `Canonicalizer`.

Extra allocations are a significant cost of NLL, and the most common
ones come from within `Canonicalizer`. In particular, `canonical_var()`
contains this code:

    indices
.entry(kind)
.or_insert_with(|| {
    let cvar1 = variables.push(info);
    let cvar2 = var_values.push(kind);
    assert_eq!(cvar1, cvar2);
    cvar1
})
.clone()

`variables` and `var_values` are `Vec`s. `indices` is a `HashMap` used
to track what elements have been inserted into `var_values`. If `kind`
hasn't been seen before, `indices`, `variables` and `var_values` all get
a new element. (The number of elements in each container is always the
same.) This results in lots of allocations.

In practice, most of the time these containers only end up holding a few
elements. This PR changes them to avoid heap allocations in the common
case, by changing the `Vec`s to `SmallVec`s and only using `indices`
once enough elements are present. (When the number of elements is small,
a direct linear search of `var_values` is as good or better than a
hashmap lookup.)

The changes to `variables` are straightforward and contained within
`Canonicalizer`. The changes to `indices` are more complex but also
contained within `Canonicalizer`. The changes to `var_values` are more
intrusive because they require defining a new type
`SmallCanonicalVarValues` -- which is to `CanonicalVarValues` as
`SmallVec` is to `Vec -- and passing stack-allocated values of that type
in from outside.

All this speeds up a number of NLL "check" builds, the best by 2%.

r? @nikomatsakis

6 years agoAuto merge of #52145 - ExpHP:drop-it-like-its-eof, r=nikomatsakis
bors [Tue, 17 Jul 2018 19:28:23 +0000 (19:28 +0000)]
Auto merge of #52145 - ExpHP:drop-it-like-its-eof, r=nikomatsakis

Fix macro parser quadratic complexity in small repeating groups

Observed in #51754, and more easily demonstrated with the following:

```rust
macro_rules! stress {
    ($($t:tt)+) => { };
}

fn main() {
    stress!{
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        //    ... 65536 copies of "a" total ...
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    }
}
```
which takes 50 seconds to compile prior to the fix and <1s after.

I hope this has a visible impact on the compile times for real code.  (I think it is most likely to affect incremental TT munchers that deal with large inputs, though it depends on how they are written)

For a fuller description of the performance issue:  https://github.com/rust-lang/rust/issues/51754#issuecomment-403242159

---

There is no test (yet) because I'm not sure how easily to measure this for regressions.

6 years agoMake `async_idents` an edition incompat lint
Oliver Schneider [Tue, 17 Jul 2018 17:56:41 +0000 (19:56 +0200)]
Make `async_idents` an edition incompat lint

6 years agoAuto merge of #52404 - felixrabe:doc-link-ch19-04-typo, r=GuillaumeGomez
bors [Tue, 17 Jul 2018 15:39:33 +0000 (15:39 +0000)]
Auto merge of #52404 - felixrabe:doc-link-ch19-04-typo, r=GuillaumeGomez

Fix doc link

Result of first searching via:

    find src -type f -exec fgrep -l dynamically-sized-types--sized {} \;

and then replacing all relevant occurrences via:

    find src/{libcore,test/ui} -type f -exec sed -i.bak \
      s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g {} \;
    find src -type f -name '*.bak' -exec rm {} \;

(Note: Commands run on macOS 10.13 (BSD).  `sed -i.bak` should work on
GNU/Linux as well, but not tested.)

EDIT: Did not compile / test Rust for this change at all.

Clickable links for comparison:
https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken)
https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed)

6 years agoAuto merge of #52433 - kennytm:rollup, r=kennytm
bors [Tue, 17 Jul 2018 13:31:35 +0000 (13:31 +0000)]
Auto merge of #52433 - kennytm:rollup, r=kennytm

Rollup of 9 pull requests

Successful merges:

 - #52286 (Deny bare trait objects in src/librustc_errors)
 - #52306 (Reduce the number of clone()s needed in obligation_forest)
 - #52338 (update miri)
 - #52385 (Pass edition flags to compiler from rustdoc as expected)
 - #52392 (AsRef doc wording tweaks)
 - #52430 (update nomicon)
 - #52434 (Enable incremental independent of stage)
 - #52435 (Calculate the exact capacity for 2 HashMaps)
 - #52446 (Block beta if clippy breaks.)

r? @ghost

6 years agoFix doc link
Felix Rabe [Sun, 15 Jul 2018 17:10:47 +0000 (19:10 +0200)]
Fix doc link

The link for comparison:

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken)

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed)

This commit is the result of (first) searching via:

    find src -type f -print0 | xargs -0 fgrep -l dynamically-sized-types--sized

and then replacing all relevant occurrences via:

    find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \
      s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g
    find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm

(Note: Commands run on macOS 10.13 (BSD).  `sed -i.bak` should work on
GNU/Linux as well, but not tested.)

6 years agoAuto merge of #52190 - davidtwco:issue-52028, r=nikomatsakis
bors [Tue, 17 Jul 2018 11:31:53 +0000 (11:31 +0000)]
Auto merge of #52190 - davidtwco:issue-52028, r=nikomatsakis

html5ever in the rustc-perf repository is memory-intensive

Part of #52028. Rebased atop of #51987.

r? @nikomatsakis

6 years agoRollup merge of #52385 - GuillaumeGomez:pass-edition-to-parser, r=QuietMisdreavus
kennytm [Tue, 17 Jul 2018 10:16:09 +0000 (18:16 +0800)]
Rollup merge of #52385 - GuillaumeGomez:pass-edition-to-parser, r=QuietMisdreavus

Pass edition flags to compiler from rustdoc as expected

Fixes #52357.

6 years agoRollup merge of #52446 - kennytm:block-beta-on-clippy, r=nrc
kennytm [Tue, 17 Jul 2018 10:15:37 +0000 (18:15 +0800)]
Rollup merge of #52446 - kennytm:block-beta-on-clippy, r=nrc

Block beta if clippy breaks.

Also, don't fail master pull request when an unrelated tool is not test-pass.

6 years agoRollup merge of #52434 - Mark-Simulacrum:incremental-keep-stage, r=alexcrichton
kennytm [Tue, 17 Jul 2018 10:15:10 +0000 (18:15 +0800)]
Rollup merge of #52434 - Mark-Simulacrum:incremental-keep-stage, r=alexcrichton

Enable incremental independent of stage

Previously we'd only do so for stage 0 but with keep-stage
improvements it seems likely that we'll see more developers working in
the stage 1, so we should allow enabling incremental for them.

6 years agoRollup merge of #52338 - RalfJung:miri, r=oli-obk
kennytm [Tue, 17 Jul 2018 10:13:38 +0000 (18:13 +0800)]
Rollup merge of #52338 - RalfJung:miri, r=oli-obk

update miri

6 years agoRollup merge of #52435 - ljedrz:misc_capacity, r=estebank
kennytm [Mon, 16 Jul 2018 18:19:02 +0000 (02:19 +0800)]
Rollup merge of #52435 - ljedrz:misc_capacity, r=estebank

Calculate the exact capacity for 2 HashMaps

6 years agoRollup merge of #52306 - ljedrz:obligation_forest_clone, r=varkor
kennytm [Mon, 16 Jul 2018 18:18:15 +0000 (02:18 +0800)]
Rollup merge of #52306 - ljedrz:obligation_forest_clone, r=varkor

Reduce the number of clone()s needed in obligation_forest

Some can be avoided by using `remove_entry` instead of `remove`.

6 years agoRollup merge of #52286 - ljedrz:dyn_librustc_errors, r=varkor
kennytm [Mon, 16 Jul 2018 18:17:53 +0000 (02:17 +0800)]
Rollup merge of #52286 - ljedrz:dyn_librustc_errors, r=varkor

Deny bare trait objects in src/librustc_errors

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_errors`.

6 years agoRollup merge of #52430 - RalfJung:nomicon, r=kennytm
kennytm [Mon, 16 Jul 2018 15:11:35 +0000 (23:11 +0800)]
Rollup merge of #52430 - RalfJung:nomicon, r=kennytm

update nomicon

Will this trigger a website update automatically or is that a separate step?

6 years agoupdate miri
Ralf Jung [Tue, 17 Jul 2018 07:13:47 +0000 (09:13 +0200)]
update miri

6 years agoupdate miri (Windows tests fixed)
Ralf Jung [Mon, 16 Jul 2018 10:06:26 +0000 (12:06 +0200)]
update miri (Windows tests fixed)

6 years agoupdate miri
Ralf Jung [Fri, 13 Jul 2018 08:34:50 +0000 (10:34 +0200)]
update miri

6 years agoAuto merge of #52335 - nnethercote:BitSlice-fixes, r=nikomatsakis
bors [Tue, 17 Jul 2018 09:26:22 +0000 (09:26 +0000)]
Auto merge of #52335 - nnethercote:BitSlice-fixes, r=nikomatsakis

`BitSlice` fixes

`propagate_bits_into_entry_set_for` and `BitSlice::bitwise` are hot for some benchmarks under NLL. I tried and failed to speed them up. (Increasing the size of `bit_slice::Word` from `usize` to `u128` caused a slowdown, even though decreasing the size of `bitvec::Word` from `u128` to `u64` also caused a slowdown. Weird.)

Anyway, along the way I fixed up several problems in and around the `BitSlice` code.

r? @nikomatsakis

6 years agoAuto merge of #52409 - estebank:move-cfail-ui, r=oli-obk
bors [Tue, 17 Jul 2018 06:52:20 +0000 (06:52 +0000)]
Auto merge of #52409 - estebank:move-cfail-ui, r=oli-obk

Move some `compile-fail` tests to `ui`

Re: #44844.

6 years agoGenerate region values directly to reduce memory usage.
David Wood [Mon, 9 Jul 2018 20:26:20 +0000 (21:26 +0100)]
Generate region values directly to reduce memory usage.

Also modify `SparseBitMatrix` so that it does not require knowing the
dimensions in advance, but instead grows on demand.

6 years agoAvoid most allocations in `Canonicalizer`.
Nicholas Nethercote [Thu, 12 Jul 2018 23:57:33 +0000 (09:57 +1000)]
Avoid most allocations in `Canonicalizer`.

Extra allocations are a significant cost of NLL, and the most common
ones come from within `Canonicalizer`. In particular, `canonical_var()`
contains this code:

    indices
.entry(kind)
.or_insert_with(|| {
    let cvar1 = variables.push(info);
    let cvar2 = var_values.push(kind);
    assert_eq!(cvar1, cvar2);
    cvar1
})
.clone()

`variables` and `var_values` are `Vec`s. `indices` is a `HashMap` used
to track what elements have been inserted into `var_values`. If `kind`
hasn't been seen before, `indices`, `variables` and `var_values` all get
a new element. (The number of elements in each container is always the
same.) This results in lots of allocations.

In practice, most of the time these containers only end up holding a few
elements. This PR changes them to avoid heap allocations in the common
case, by changing the `Vec`s to `SmallVec`s and only using `indices`
once enough elements are present. (When the number of elements is small,
a direct linear search of `var_values` is as good or better than a
hashmap lookup.)

The changes to `variables` are straightforward and contained within
`Canonicalizer`. The changes to `indices` are more complex but also
contained within `Canonicalizer`. The changes to `var_values` are more
intrusive because they require defining a new type
`SmallCanonicalVarValues` -- which is to `CanonicalVarValues` as
`SmallVec` is to `Vec -- and passing stack-allocated values of that type
in from outside.

All this speeds up a number of NLL "check" builds, the best by 2%.

6 years agoReturn tests that have platform dependant output
Esteban Küber [Mon, 16 Jul 2018 21:11:37 +0000 (14:11 -0700)]
Return tests that have platform dependant output

6 years agoAuto merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis
bors [Tue, 17 Jul 2018 02:50:14 +0000 (02:50 +0000)]
Auto merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis

Deny bare trait objects in librustc_driver

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_driver`.

6 years agoAuto merge of #52448 - Manishearth:clippyup, r=Mark-Simulacrum
bors [Tue, 17 Jul 2018 00:10:17 +0000 (00:10 +0000)]
Auto merge of #52448 - Manishearth:clippyup, r=Mark-Simulacrum

Update clippy

Fixes test failures caused by https://github.com/rust-lang/rust/pull/52081

6 years agoUpdate clippy
Manish Goregaokar [Mon, 16 Jul 2018 23:30:15 +0000 (16:30 -0700)]
Update clippy

Fixes test failures caused by https://github.com/rust-lang/rust/pull/52081

6 years agoBlock beta if clippy breaks.
kennytm [Mon, 16 Jul 2018 21:35:19 +0000 (05:35 +0800)]
Block beta if clippy breaks.

Don't fail master pull request when an unrelated tool is not test-pass.

6 years agoAuto merge of #52081 - alexcrichton:proc-macro-stable, r=petrochenkov
bors [Mon, 16 Jul 2018 20:54:47 +0000 (20:54 +0000)]
Auto merge of #52081 - alexcrichton:proc-macro-stable, r=petrochenkov

rustc: Stabilize the `proc_macro` feature

This commit stabilizes some of the `proc_macro` language feature as well as a
number of APIs in the `proc_macro` crate as [previously discussed][1]. This
means that on stable Rust you can now define custom procedural macros which
operate as attributes attached to items or `macro_rules!`-like bang-style
invocations. This extends the suite of currently stable procedural macros,
custom derives, with custom attributes and custom bang macros.

Note though that despite the stabilization in this commit procedural macros are
still not usable on stable Rust. To stabilize that we'll need to stabilize at
least part of the `use_extern_macros` feature. Currently you can define a
procedural macro attribute but you can't import it to call it!

A summary of the changes made in this PR (as well as the various consequences)
is:

* The `proc_macro` language and library features are now stable.
* Other APIs not stabilized in the `proc_macro` crate are now named under a
  different feature, such as `proc_macro_diagnostic` or `proc_macro_span`.
* A few checks in resolution for `proc_macro` being enabled have switched over
  to `use_extern_macros` being enabled. This means that code using
  `#![feature(proc_macro)]` today will likely need to move to
  `#![feature(use_extern_macros)]`.

It's intended that this PR, once landed, will be followed up with an attempt to
stabilize a small slice of `use_extern_macros` just for procedural macros to
make this feature 100% usable on stable.

[1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252

6 years agocleanup unnecessary else
Michael Lamparski [Mon, 16 Jul 2018 18:03:35 +0000 (14:03 -0400)]
cleanup unnecessary else

6 years agoRollup merge of #52392 - heycam:patch-1, r=steveklabnik
kennytm [Mon, 16 Jul 2018 15:11:32 +0000 (23:11 +0800)]
Rollup merge of #52392 - heycam:patch-1, r=steveklabnik

AsRef doc wording tweaks

6 years agorustc: Use link_section, not wasm_custom_section
Alex Crichton [Fri, 13 Jul 2018 18:30:47 +0000 (11:30 -0700)]
rustc: Use link_section, not wasm_custom_section

This commit transitions definitions of custom sections on the wasm target from
the unstable `#[wasm_custom_section]` attribute to the
already-stable-for-other-targets `#[link_section]` attribute. Mostly the same
restrictions apply as before, except that this now applies only to statics.

Closes #51088

6 years agoCalculate the exact capacity for 2 HashMaps
ljedrz [Mon, 16 Jul 2018 14:01:29 +0000 (16:01 +0200)]
Calculate the exact capacity for 2 HashMaps

6 years agoEnable incremental independent of stage
Mark Rousskov [Mon, 16 Jul 2018 15:22:15 +0000 (09:22 -0600)]
Enable incremental independent of stage

Previously we'd only do so for stage 0 but with keep-stage
improvements it seems likely that we'll see more developers working in
the stage 1, so we should allow enabling incremental for them.

Ideally, the check we probably want is to only enable incremental for
the last compiler build scheduled, but there's no good way to do so
today. Just enabling incremental in all stages should be sufficient;
we may be doing extra work that's needles -- compiling incrementally
something that will never be recompiled in-place -- but that should be
sufficiently unlikely (i.e., users either don't care or won't be
compiling the compiler twice).

6 years agoRollup merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis
kennytm [Mon, 16 Jul 2018 15:11:30 +0000 (23:11 +0800)]
Rollup merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis

Deny bare trait objects in librustc_driver

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_driver`.

6 years agorustc: Stabilize much of the `proc_macro` feature
Alex Crichton [Tue, 3 Jul 2018 22:36:31 +0000 (15:36 -0700)]
rustc: Stabilize much of the `proc_macro` feature

This commit stabilizes some of the `proc_macro` language feature as well as a
number of APIs in the `proc_macro` crate as [previously discussed][1]. This
means that on stable Rust you can now define custom procedural macros which
operate as attributes attached to items or `macro_rules!`-like bang-style
invocations. This extends the suite of currently stable procedural macros,
custom derives, with custom attributes and custom bang macros.

Note though that despite the stabilization in this commit procedural macros are
still not usable on stable Rust. To stabilize that we'll need to stabilize at
least part of the `use_extern_macros` feature. Currently you can define a
procedural macro attribute but you can't import it to call it!

A summary of the changes made in this PR (as well as the various consequences)
is:

* The `proc_macro` language and library features are now stable.
* Other APIs not stabilized in the `proc_macro` crate are now named under a
  different feature, such as `proc_macro_diagnostic` or `proc_macro_span`.
* A few checks in resolution for `proc_macro` being enabled have switched over
  to `use_extern_macros` being enabled. This means that code using
  `#![feature(proc_macro)]` today will likely need to move to
  `#![feature(use_extern_macros)]`.

It's intended that this PR, once landed, will be followed up with an attempt to
stabilize a small slice of `use_extern_macros` just for procedural macros to
make this feature 100% usable on stable.

[1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252

6 years agoupdate nomicon
Ralf Jung [Mon, 16 Jul 2018 14:36:32 +0000 (16:36 +0200)]
update nomicon

6 years agoAuto merge of #52264 - csmoe:kind, r=oli-obk
bors [Mon, 16 Jul 2018 14:05:19 +0000 (14:05 +0000)]
Auto merge of #52264 - csmoe:kind, r=oli-obk

Rename spanned HIR node enums from Foo_ to FooKind

Closes https://github.com/rust-lang/rust/issues/51968
r? @oli-obk

6 years agoUpdate the clippy submodule
Oliver Schneider [Mon, 16 Jul 2018 13:09:04 +0000 (15:09 +0200)]
Update the clippy submodule

6 years agoUpdate a debug string
Oliver Schneider [Mon, 16 Jul 2018 12:20:10 +0000 (14:20 +0200)]
Update a debug string

6 years agoFix tidy
csmoe [Thu, 12 Jul 2018 00:20:31 +0000 (08:20 +0800)]
Fix tidy

6 years agoItemKind
csmoe [Wed, 11 Jul 2018 15:36:06 +0000 (23:36 +0800)]
ItemKind

6 years agoForeignItemKind
csmoe [Wed, 11 Jul 2018 14:56:44 +0000 (22:56 +0800)]
ForeignItemKind

6 years agoTyKind
csmoe [Wed, 11 Jul 2018 14:41:03 +0000 (22:41 +0800)]
TyKind

6 years agoExprKind
csmoe [Wed, 11 Jul 2018 12:05:29 +0000 (20:05 +0800)]
ExprKind

6 years agoVariantKind
csmoe [Wed, 11 Jul 2018 11:18:57 +0000 (19:18 +0800)]
VariantKind

6 years agoDeclKind
csmoe [Wed, 11 Jul 2018 10:59:17 +0000 (18:59 +0800)]
DeclKind

6 years agoStmtKind
csmoe [Wed, 11 Jul 2018 10:54:37 +0000 (18:54 +0800)]
StmtKind

6 years agoBinOpKind
csmoe [Wed, 11 Jul 2018 10:44:53 +0000 (18:44 +0800)]
BinOpKind

6 years agoEnable default inlining in platform intrinsics
ljedrz [Mon, 16 Jul 2018 12:36:00 +0000 (14:36 +0200)]
Enable default inlining in platform intrinsics

6 years agoAuto merge of #52422 - michaelwoerister:revert-52266, r=oli-obk
bors [Mon, 16 Jul 2018 09:41:54 +0000 (09:41 +0000)]
Auto merge of #52422 - michaelwoerister:revert-52266, r=oli-obk

Revert #52266

Reverts #52266 until the performance issues with that PR are ironed out.

6 years agoAuto merge of #52395 - zackmdavis:and_the_case_of_the_renamed_lint, r=estebank
bors [Mon, 16 Jul 2018 07:35:49 +0000 (07:35 +0000)]
Auto merge of #52395 - zackmdavis:and_the_case_of_the_renamed_lint, r=estebank

structured suggestion for renamed-and-removed-lints

![lint_renamed](https://user-images.githubusercontent.com/1076988/42730470-f74688dc-87a9-11e8-8dfd-b3e1d70b0af8.png)

r? @estebank

6 years agoRevert "Provide a way of accessing the ThinLTO module import map in rustc."
Michael Woerister [Mon, 16 Jul 2018 06:59:10 +0000 (08:59 +0200)]
Revert "Provide a way of accessing the ThinLTO module import map in rustc."

This reverts commit 9df56ca0eea1a8f5af945df25ce23e276b1d48a7.

6 years agoRevert "Persist ThinLTO import data in incr. comp. session directory."
Michael Woerister [Mon, 16 Jul 2018 06:58:56 +0000 (08:58 +0200)]
Revert "Persist ThinLTO import data in incr. comp. session directory."

This reverts commit 8dc7ddb9763f28b83de7bf3b3025f8042ea9e830.

6 years agoRevert "Clean up CodegenUnit name generation."
Michael Woerister [Mon, 16 Jul 2018 06:58:40 +0000 (08:58 +0200)]
Revert "Clean up CodegenUnit name generation."

This reverts commit 2c5cd9ce53d2d25041db0cb02b40ba460ffa8908.

6 years agoRevert "Clean up LLVM module naming (just use CodegenUnit names)."
Michael Woerister [Mon, 16 Jul 2018 06:58:29 +0000 (08:58 +0200)]
Revert "Clean up LLVM module naming (just use CodegenUnit names)."

This reverts commit f6894ebe664d111259a91a2b5fcc1236ca413436.

6 years agoRevert "Adapt codegen-unit tests to new CGU naming scheme."
Michael Woerister [Mon, 16 Jul 2018 06:58:15 +0000 (08:58 +0200)]
Revert "Adapt codegen-unit tests to new CGU naming scheme."

This reverts commit 94b32adb71a75a3f5b53a39c52c62c2ce1a7cc56.

6 years agoRevert "Fix some run-make tests after object file naming has changed."
Michael Woerister [Mon, 16 Jul 2018 06:58:05 +0000 (08:58 +0200)]
Revert "Fix some run-make tests after object file naming has changed."

This reverts commit dd3f445ed264ffc09ea42bd8d89853242e3a26f4.

6 years agoRevert "Use callback-based interface to load ThinLTO import data into rustc."
Michael Woerister [Mon, 16 Jul 2018 06:57:49 +0000 (08:57 +0200)]
Revert "Use callback-based interface to load ThinLTO import data into rustc."

This reverts commit e045a6cd8c0235a26ef11e6cd9a13ebd817f1265.

6 years agoFix tests
Esteban Küber [Mon, 16 Jul 2018 05:36:05 +0000 (22:36 -0700)]
Fix tests

6 years agoAuto merge of #52386 - Manishearth:quote-clarify, r=petrochenkov
bors [Mon, 16 Jul 2018 04:40:21 +0000 (04:40 +0000)]
Auto merge of #52386 - Manishearth:quote-clarify, r=petrochenkov

Clarify how the quote macro is loaded

@QuietMisdreavus needed to figure this out for writing a testcase, this should be better documented.

r? @jseyfried

6 years agoAuto merge of #52373 - eonil:master, r=kennytm
bors [Mon, 16 Jul 2018 01:40:51 +0000 (01:40 +0000)]
Auto merge of #52373 - eonil:master, r=kennytm

Update lint plugin sample code.

The sample code is out of sync with latest test code and broken.
I just copied missing feature gates.

6 years agoMove some `compile-fail` tests to `ui`
Esteban Küber [Sun, 15 Jul 2018 21:11:54 +0000 (14:11 -0700)]
Move some `compile-fail` tests to `ui`

6 years agoAuto merge of #52401 - semarie:tidy-extdeps, r=alexcrichton
bors [Sun, 15 Jul 2018 23:39:28 +0000 (23:39 +0000)]
Auto merge of #52401 - semarie:tidy-extdeps, r=alexcrichton

tidy: add a new test for external dependencies

ensure all packages in Cargo.lock will be vendored, and fail if the
source packages isn't whitelisted.

the purpose is to avoid such kind of issues:
- #52029 Rustfmt isn't vendored correctly
- #42719 building beta with vendor=true fail due to network dependencies

as Rust comes with several external dependencies (clippy, miri, rustfmt, rls), it is important to have a way to catch some errors in the update of this submodules.

The new check in tidy quickly reads `Cargo.lock` to search for the `source` of all packages. This attribute is present when the package comes from external source (like `crates.io-index` or some `git` repository). Some sources are whitelisted (like `crates.io-index`) as the crates are vendored.

`Cargo.lock` extract with several cases (git, crates.io, and local).
```
[[package]]
name = "rustfmt-nightly"
version = "0.8.2"
source = "git+https://github.com/rust-lang-nursery/rustfmt?rev=5e5992517d3591e2708d4ca6b155dfcbdf3344b9#5e5992517d3591e2708d4ca6b155dfcbdf3344b9"
dependencies = [
...
]

[[package]]
name = "same-file"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
...
]

[[package]]
name = "rustdoc-themes"
version = "0.1.0"
```

r? @alexcrichton

6 years agoAuto merge of #52400 - RalfJung:match, r=oli-obk
bors [Sun, 15 Jul 2018 21:35:22 +0000 (21:35 +0000)]
Auto merge of #52400 - RalfJung:match, r=oli-obk

CTFE: use binary_op to compare integer with match disriminant

This is needed to unblock https://github.com/solson/miri/pull/401: There is code in the Windows initialization functions that uses `match` to test whether a pointer is NULL.

I will add a testcase in miri; I was not sure where to add a testcase in Rust itself.

r? @oli-obk

6 years agoAuto merge of #52383 - petrochenkov:pmns, r=alexcrichton
bors [Sun, 15 Jul 2018 19:35:06 +0000 (19:35 +0000)]
Auto merge of #52383 - petrochenkov:pmns, r=alexcrichton

resolve: Functions introducing procedural macros reserve a slot in the macro namespace as well

Similarly to https://github.com/rust-lang/rust/pull/52234, this gives us symmetry between internal and external views of a crate, but in this case it's always an error to call a procedural macro in the same crate in which it's defined.

Closes https://github.com/rust-lang/rust/issues/52225

6 years agofix line numbers
Ralf Jung [Sun, 15 Jul 2018 18:42:18 +0000 (20:42 +0200)]
fix line numbers

6 years agoAuto merge of #52399 - semarie:llvmtools, r=alexcrichton
bors [Sun, 15 Jul 2018 17:23:31 +0000 (17:23 +0000)]
Auto merge of #52399 - semarie:llvmtools, r=alexcrichton

Disable LlvmTools packaging with external LLVM

Fixes: #52102
6 years agoAuto merge of #52372 - KarolinePlum:Duration-rounding-documentation, r=joshtriplett
bors [Sun, 15 Jul 2018 15:18:33 +0000 (15:18 +0000)]
Auto merge of #52372 - KarolinePlum:Duration-rounding-documentation, r=joshtriplett

Document rounding down in std::time::Durations's subsec_millis etc.

Now also the documentations of `subsec_millis`, `subsec_micros`, `as_millis` and `as_micros` make clear that the fractional nanosecond component is rounded down to whole units.

Fixed #52263

6 years agoRemove a clone in mir/transform/add_validation.
ljedrz [Sun, 15 Jul 2018 14:17:15 +0000 (16:17 +0200)]
Remove a clone in mir/transform/add_validation.

6 years agoAuto merge of #52351 - mbrubeck:docs, r=apasel422
bors [Sun, 15 Jul 2018 13:12:39 +0000 (13:12 +0000)]
Auto merge of #52351 - mbrubeck:docs, r=apasel422

Fix link to RFC 1510

None

6 years agoadd license text
Ralf Jung [Sun, 15 Jul 2018 12:26:31 +0000 (14:26 +0200)]
add license text

6 years agoadd test case
Ralf Jung [Sun, 15 Jul 2018 11:55:17 +0000 (13:55 +0200)]
add test case

6 years agotidy: add a new test for external dependencies
Sébastien Marie [Sun, 15 Jul 2018 10:46:02 +0000 (12:46 +0200)]
tidy: add a new test for external dependencies

ensure all packages in Cargo.lock will be vendored, and fail if the
source packages isn't whitelisted.

6 years agoAuto merge of #52381 - oli-obk:ty_to_def_id, r=eddyb
bors [Sun, 15 Jul 2018 10:29:00 +0000 (10:29 +0000)]
Auto merge of #52381 - oli-obk:ty_to_def_id, r=eddyb

Remove `ty_to_def_id`

fixes https://github.com/rust-lang/rust/issues/52341

The uses were mostly convenience and generally "too powerful" (would also have worked for types that weren't interesting at the use site)

r? @eddyb

6 years agoCTFE: use binary_op to compare integer with match disriminant
Ralf Jung [Sun, 15 Jul 2018 09:35:18 +0000 (11:35 +0200)]
CTFE: use binary_op to compare integer with match disriminant

6 years agoAuto merge of #52361 - QuietMisdreavus:proc-macro-doc, r=ollie27
bors [Sun, 15 Jul 2018 08:30:36 +0000 (08:30 +0000)]
Auto merge of #52361 - QuietMisdreavus:proc-macro-doc, r=ollie27

rustdoc: don't panic when the cross-re-export handler sees a proc-macro

When i moved the macro cross-re-export inlining code into `clean::inline`, i thought that if a macro had a `Def` that said it was a bang macro, it wouldn't be a proc macro. I thought wrong. Turns out, the `quote!()` in `libproc_macro` is actually a proc-macro, and when the `quote!()` macro is re-exported, this proc-macro is accessed in its place. This causes any `proc_macro::*` glob re-export to pull in this proc-macro, causing the assertion i added to fire, leading to an ICE. This replaces that with an Option that ignores proc-macros for the time being.

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

6 years agotidy: avoid long line
Sébastien Marie [Sun, 15 Jul 2018 07:58:58 +0000 (09:58 +0200)]
tidy: avoid long line

6 years agoDisable LlvmTools packaging with external LLVM
Sébastien Marie [Sun, 15 Jul 2018 07:23:36 +0000 (09:23 +0200)]
Disable LlvmTools packaging with external LLVM

Fixes: #52102
6 years agoAuto merge of #52360 - Mark-Simulacrum:fix-keep-stage-for-cg-backends, r=alexcrichton
bors [Sun, 15 Jul 2018 06:31:24 +0000 (06:31 +0000)]
Auto merge of #52360 - Mark-Simulacrum:fix-keep-stage-for-cg-backends, r=alexcrichton

Do not attempt to recompile codegen backend(s) with --keep-stage

Previously we'd attempt to recompile them and that would fail since
we've essentially not built the entire compiler yet, or we're faking
that fact. This commit should make us ignore the codegen backend build
as well.

Unlike the other compile steps, there is no CodegenBackendLink step that
we run here, because that is done later as a part of assembling the
final compiler and as an explicit function call.

r? @alexcrichton

I think this may fix or at least assist with #52174.

cc @RalfJung @tinco -- if you can test this patch locally that'd be
amazing; I don't want to recompile for the next couple hours to test it
locally. I don't think it can make the situation worse, and in fact, if
I've interpreted the cause of the failure correctly then this will fix
your problem.

6 years agostructured suggestion for renamed-and-removed-lints
Zack M. Davis [Sun, 15 Jul 2018 03:52:40 +0000 (20:52 -0700)]
structured suggestion for renamed-and-removed-lints

6 years agoAuto merge of #52348 - oli-obk:bugfix, r=petrochenkov
bors [Sun, 15 Jul 2018 04:01:43 +0000 (04:01 +0000)]
Auto merge of #52348 - oli-obk:bugfix, r=petrochenkov

Reach the body of functions returning `impl Trait` but don't treat it as public

fixes #52128

r? @pnkfelix

cc @eddyb

6 years agoAuto merge of #52388 - oli-obk:clippy, r=Manishearth
bors [Sun, 15 Jul 2018 00:29:43 +0000 (00:29 +0000)]
Auto merge of #52388 - oli-obk:clippy, r=Manishearth

Update clippy and rls

r? @Manishearth

cc @kennytm @nrc

6 years agoAsRef doc wording tweaks
Cameron McCormack [Sun, 15 Jul 2018 00:16:36 +0000 (10:16 +1000)]
AsRef doc wording tweaks

6 years agoUpdate clippy and rls
Oliver Schneider [Sat, 14 Jul 2018 22:01:24 +0000 (00:01 +0200)]
Update clippy and rls

6 years agoUbsan this newly discovered dead code
Oliver Schneider [Sat, 14 Jul 2018 23:52:45 +0000 (01:52 +0200)]
Ubsan this newly discovered dead code

6 years agoAuto merge of #52318 - TheDarkula:master, r=oli-obk
bors [Sat, 14 Jul 2018 22:28:31 +0000 (22:28 +0000)]
Auto merge of #52318 - TheDarkula:master, r=oli-obk

Removed the promotable field from CheckCrateVisitor...

and replaced it with the custom enum Promotability.

r? @oli-obk

6 years agoRemoved the promotable field from CheckCrateVisitor and replaced it with the structs...
Meade Kincke [Sat, 7 Jul 2018 14:39:21 +0000 (15:39 +0100)]
Removed the promotable field from CheckCrateVisitor and replaced it with the structs Promotable and NotPromotable.

6 years agoAuto merge of #52326 - alexcrichton:tweak-proc-macro-expand, r=petrochenkov
bors [Sat, 14 Jul 2018 20:27:56 +0000 (20:27 +0000)]
Auto merge of #52326 - alexcrichton:tweak-proc-macro-expand, r=petrochenkov

rustc: Tweak expansion of #[proc_macro] for 2018

The syntactical expansion of `#[proc_macro]` and related attributes currently
contains absolute paths which conflicts with a lint for the 2018 edition,
causing issues like #52214. This commit puts a band-aid on the issue by ensuring
that procedural macros can also migrate to the 2018 edition for now by tweaking
the expansion based on what features are activated. A more long-term solution
would probably tweak the edition hygiene of spans, but this should do the trick
for now.

Closes #52214

6 years agoClarify how the quote macro is loaded
Manish Goregaokar [Sat, 14 Jul 2018 19:06:50 +0000 (12:06 -0700)]
Clarify how the quote macro is loaded

6 years agoPass edition flags to compiler from rustdoc as expected
Guillaume Gomez [Sat, 14 Jul 2018 18:45:44 +0000 (20:45 +0200)]
Pass edition flags to compiler from rustdoc as expected

6 years agoLint the use of async as an identifier
Oliver Schneider [Sat, 14 Jul 2018 14:40:17 +0000 (16:40 +0200)]
Lint the use of async as an identifier

6 years agoExpose a self-referential object
Oliver Schneider [Sat, 14 Jul 2018 18:34:32 +0000 (20:34 +0200)]
Expose a self-referential object

6 years agoAuto merge of #52379 - kennytm:revert-o3, r=rkruppe
bors [Sat, 14 Jul 2018 18:28:50 +0000 (18:28 +0000)]
Auto merge of #52379 - kennytm:revert-o3, r=rkruppe

Revert #52212 (revert set opt-level = 3)

Setting -O3 causes LLVM to spuriously segfault at least on Linux. This PR reverts to -O2.

cc #52378

6 years agoFunctions introducing procedural macros reserve a slot in the macro namespace as...
Vadim Petrochenkov [Thu, 12 Jul 2018 10:24:59 +0000 (13:24 +0300)]
Functions introducing procedural macros reserve a slot in the macro namespace as well

6 years agoChange keep-stage to only affect the passed stage
Mark Rousskov [Sat, 14 Jul 2018 16:58:10 +0000 (10:58 -0600)]
Change keep-stage to only affect the passed stage

The best way to build a stage 2 rustc is now probably
  ./x.py build --stage 2 src/rustc # once
  ./x.py build --stage 2 --keep-stage 1 src/rustc