Commit Graph

80673 Commits

Author SHA1 Message Date
bors
4f3c7a472b 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.
2018-07-17 19:28:23 +00:00
bors
1c84d81873 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)
2018-07-17 15:39:33 +00:00
bors
4bff385fda 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
2018-07-17 13:31:35 +00:00
Felix Rabe
88e9af0375 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.)
2018-07-17 14:10:11 +02:00
bors
025e04e1bc 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
2018-07-17 11:31:53 +00:00
kennytm
c0db1aafea
Rollup merge of #52385 - GuillaumeGomez:pass-edition-to-parser, r=QuietMisdreavus
Pass edition flags to compiler from rustdoc as expected

Fixes #52357.
2018-07-17 19:24:57 +08:00
kennytm
c052a491f1
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.
2018-07-17 19:24:55 +08:00
kennytm
9ea0a8533e
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.
2018-07-17 19:24:53 +08:00
kennytm
a07f213974
Rollup merge of #52338 - RalfJung:miri, r=oli-obk
update miri
2018-07-17 19:24:50 +08:00
kennytm
6af3e2d707
Rollup merge of #52435 - ljedrz:misc_capacity, r=estebank
Calculate the exact capacity for 2 HashMaps
2018-07-17 19:24:48 +08:00
kennytm
2d1880893f
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`.
2018-07-17 19:24:47 +08:00
kennytm
b086b09ef8
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`.
2018-07-17 19:24:44 +08:00
kennytm
68b292887d
Rollup merge of #52430 - RalfJung:nomicon, r=kennytm
update nomicon

Will this trigger a website update automatically or is that a separate step?
2018-07-17 19:24:42 +08:00
Ralf Jung
9e10b12f33 update miri 2018-07-17 11:40:57 +02:00
Ralf Jung
114dc69166 update miri (Windows tests fixed) 2018-07-17 11:40:57 +02:00
Ralf Jung
f684f80e95 update miri 2018-07-17 11:40:57 +02:00
bors
2ddc0cbd56 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
2018-07-17 09:26:22 +00:00
bors
9d6f4e5eea Auto merge of #52409 - estebank:move-cfail-ui, r=oli-obk
Move some `compile-fail` tests to `ui`

Re: #44844.
2018-07-17 06:52:20 +00:00
David Wood
8b94d1605b 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.
2018-07-16 23:46:14 -04:00
Esteban Küber
82fd8d74cd Return tests that have platform dependant output 2018-07-16 20:26:32 -07:00
bors
31263f3204 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`.
2018-07-17 02:50:14 +00:00
bors
55c04babb8 Auto merge of #52448 - Manishearth:clippyup, r=Mark-Simulacrum
Update clippy

Fixes test failures caused by https://github.com/rust-lang/rust/pull/52081
2018-07-17 00:10:17 +00:00
Manish Goregaokar
536005aefc Update clippy
Fixes test failures caused by https://github.com/rust-lang/rust/pull/52081
2018-07-16 16:30:15 -07:00
kennytm
a9bcbb27b8
Block beta if clippy breaks.
Don't fail master pull request when an unrelated tool is not test-pass.
2018-07-17 05:35:19 +08:00
bors
1ecf6929dc 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
2018-07-16 20:54:47 +00:00
Michael Lamparski
0467ae0cf5 cleanup unnecessary else 2018-07-16 16:15:34 -04:00
kennytm
bc2f1093d8
Rollup merge of #52392 - heycam:patch-1, r=steveklabnik
AsRef doc wording tweaks
2018-07-17 02:12:32 +08:00
ljedrz
d85bcef467 Calculate the exact capacity for 2 HashMaps 2018-07-16 18:38:33 +02:00
Mark Rousskov
827f656ebb 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).
2018-07-16 10:33:45 -06:00
kennytm
f2f6cea105
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`.
2018-07-16 23:11:30 +08:00
Alex Crichton
65f3007fa8 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
2018-07-16 07:58:06 -07:00
Ralf Jung
21a179649f update nomicon 2018-07-16 16:36:32 +02:00
bors
50702b2838 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
2018-07-16 14:05:19 +00:00
Oliver Schneider
c692816eaf Update the clippy submodule 2018-07-16 15:43:53 +02:00
Oliver Schneider
5cd68d5a26 Update a debug string 2018-07-16 15:09:17 +02:00
csmoe
19730cc996 Fix tidy 2018-07-16 15:09:17 +02:00
csmoe
5b0cf56f32 ItemKind 2018-07-16 15:09:17 +02:00
csmoe
7e5d224472 ForeignItemKind 2018-07-16 15:09:17 +02:00
csmoe
f12eca47e0 TyKind 2018-07-16 15:09:17 +02:00
csmoe
6a16b38198 ExprKind 2018-07-16 15:09:16 +02:00
csmoe
1d19e0c809 VariantKind 2018-07-16 15:09:16 +02:00
csmoe
14893ba96b DeclKind 2018-07-16 15:09:16 +02:00
csmoe
114314c920 StmtKind 2018-07-16 15:09:16 +02:00
csmoe
fe8955bd58 BinOpKind 2018-07-16 15:09:16 +02:00
bors
3d5753fda1 Auto merge of #52422 - michaelwoerister:revert-52266, r=oli-obk
Revert #52266

Reverts #52266 until the performance issues with that PR are ironed out.
2018-07-16 09:41:54 +00:00
bors
1fa76a4502 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
2018-07-16 07:35:49 +00:00
Michael Woerister
d992090a70 Revert "Provide a way of accessing the ThinLTO module import map in rustc."
This reverts commit 9df56ca0ee.
2018-07-16 08:59:10 +02:00
Michael Woerister
5c0110f44b Revert "Persist ThinLTO import data in incr. comp. session directory."
This reverts commit 8dc7ddb976.
2018-07-16 08:58:56 +02:00
Michael Woerister
6064efe928 Revert "Clean up CodegenUnit name generation."
This reverts commit 2c5cd9ce53.
2018-07-16 08:58:40 +02:00
Michael Woerister
0830cc92bd Revert "Clean up LLVM module naming (just use CodegenUnit names)."
This reverts commit f6894ebe66.
2018-07-16 08:58:29 +02:00