Commit Graph

99942 Commits

Author SHA1 Message Date
BO41
cabcd99476 Mention keyword closing policy 2019-10-02 17:55:06 +02:00
bors
f2023ac599 Auto merge of #64981 - tmandry:rollup-slfkhay, r=tmandry
Rollup of 11 pull requests

Successful merges:

 - #64649 (Avoid ICE on return outside of fn with literal array)
 - #64722 (Make all alt builders produce parallel-enabled compilers)
 - #64801 (Avoid `chain()` in `find_constraint_paths_between_regions()`.)
 - #64805 (Still more `ObligationForest` improvements.)
 - #64840 (SelfProfiler API refactoring and part one of event review)
 - #64885 (use try_fold instead of try_for_each to reduce compile time)
 - #64942 (Fix clippy warnings)
 - #64952 (Update cargo.)
 - #64974 (Fix zebra-striping in generic dataflow visualization)
 - #64978 (Fully clear `HandlerInner` in `Handler::reset_err_count`)
 - #64979 (Update books)

Failed merges:

 - #64959 (syntax: improve parameter without type suggestions)

r? @ghost
2019-10-02 06:08:24 +00:00
Tyler Mandry
0878ca51f0
Rollup merge of #64979 - ehuss:update-books, r=ehuss
Update books

## reference

3 commits in fa5dfb832ef8a7568e17dabf612f486d641ff4ac..320d232b206edecb67489316f71a14e31dbc6c08
2019-09-16 20:42:56 +0200 to 2019-10-01 17:05:35 +0200
- Update async/await keywords to real keywords. (rust-lang-nursery/reference#687)
- Remove the warning that appears on every page. (rust-lang-nursery/reference#685)
- Eschew fp lit pattern (rust-lang-nursery/reference#683)

## book

9 commits in 871416b85c1a73717d65d6f4a9ea29e5aef3db0e..04806c80be0f54b1290287e3f85e84bdfc0b6ec7
2019-09-16 09:46:20 -0400 to 2019-10-01 20:20:22 -0400
- Fix tidy error. (rust-lang/book#2104)
- Fancy quotes
- Commit autogenerated cargo content
- Move all scripts into tools
- We can start lines with numbers without creating ordered lists
- ci: validate that all used references are defined (rust-lang/book#2032)
- Remove the check for unstable features
- Specify the rustc version we're using in a rust-toolchain file
- Fix broken link to Chapter 13-01 in Chapter 12-04 (rust-lang/book#2025)

## rust-by-example

9 commits in 67cfbf31df880728dcf7cb35b15b028ec92caf31..a6288e7407a6c4c19ea29de6d43f40c803883f21
2019-09-18 09:36:40 -0300 to 2019-10-01 10:09:14 -0300
- Add reference to lifetime in structs (rust-lang/rust-by-example#1274)
- Rectangle ambiguity (rust-lang/rust-by-example#1270)
- Make Parsing a String code editable (rust-lang/rust-by-example#1268)
- Fix match range pattern usage (rust-lang/rust-by-example#1269)
- Added type alias enum variant rfc (rust-lang/rust-by-example#1267)
- Chapter 9.2.5: impl FnOnce() works in 1.35 (rust-lang/rust-by-example#1266)
- Move chapters from folder "traits" to "trait" (rust-lang/rust-by-example#1263)
- Capturing changes (rust-lang/rust-by-example#1265)
- Fix rust-lang/rust-by-example#1261: document Iterator::position (rust-lang/rust-by-example#1262)

r? @ghost
2019-10-01 23:06:25 -07:00
Tyler Mandry
4e2bfe2852
Rollup merge of #64978 - AnthonyMikh:librustc_errors/lib__fully_clear_inner_handler, r=Mark-Simulacrum
Fully clear `HandlerInner` in `Handler::reset_err_count`

Address [`FIXME`](702b45e409/src/librustc_errors/lib.rs (L472)) for `Handler::reset_err_count` in the way suggested by @Mark-Simulacrum, i. e. clear all the fields of `HandlerInner`.

cc @estebank
2019-10-01 23:06:24 -07:00
Tyler Mandry
643ae957d2
Rollup merge of #64974 - ecstatic-morse:generic-graphviz-zebra, r=petrochenkov
Fix zebra-striping in generic dataflow visualization

A small formatting improvement to #64828.

Prior to this, the background color of the first row of the table for each basic block changed seemingly at random. You can see this in [basic block #5](https://github.com/rust-lang/rust/pull/64828#issuecomment-536690047) under "New table". Now it is always light.

This also updates the example table to match the current output.
2019-10-01 23:06:22 -07:00
Tyler Mandry
2f29548cb4
Rollup merge of #64952 - michaelwoerister:update-cargo, r=alexcrichton
Update cargo.

Pulls f3c92ed52e into nightly Rust.

r? @alexcrichton
2019-10-01 23:06:20 -07:00
Tyler Mandry
73aa2bd707
Rollup merge of #64942 - JohnTitor:fix-clippy, r=eddyb
Fix clippy warnings

* Use `match` instead of `if` chain
* Remove redundant `into_iter()`
* Use `copied()` instead of `map()`

etc.
2019-10-01 23:06:19 -07:00
Tyler Mandry
76fb91be84
Rollup merge of #64885 - andjo403:iter, r=scottmcm
use try_fold instead of try_for_each to reduce compile time

as it was stated in #64572 that the biggest gain was due to less code was generated I tried to reduce the number of functions to inline by using try_fold direct instead of calling try_for_each that calls try_fold.

as there is some gains with using the try_fold function this is maybe a way forward.
when I tried to compile the clap-rs benchmark I get times gains only some % from #64572

there is more function that use eg. fold that calls try_fold that also can be changed but the question is how mush "duplication" that is tolerated in std to give faster compile times

can someone start a perf run?

cc @nnethercote @scottmcm @bluss
r? @ghost
2019-10-01 23:06:17 -07:00
Tyler Mandry
8f5f92a07a
Rollup merge of #64840 - michaelwoerister:self-profiling-raii-refactor, r=wesleywiser
SelfProfiler API refactoring and part one of event review

This PR refactors the `SelfProfiler` a little bit so that most profiling methods are RAII-based. The codegen backend code already had something similar, this refactoring pulls this functionality up into `SelfProfiler` itself, for general use.

The second commit of this PR is a review and update of the existing events we are already recording. Names have been made more consistent. CGU names have been removed from event names. They will be added back in when function parameter recording is implemented.

There is still some work to be done for adding new events, especially around trait resolution and the incremental system.

r? @wesleywiser
2019-10-01 23:06:16 -07:00
Tyler Mandry
0e88e56a9a
Rollup merge of #64805 - nnethercote:ObligForest-still-more, r=nikomatsakis
Still more `ObligationForest` improvements.

Following on from #64627, more readability improvements, but negligible effects on speed.

r? @nikomatsakis
2019-10-01 23:06:14 -07:00
Tyler Mandry
bd9d843ae4
Rollup merge of #64801 - nnethercote:improve-find_constraint_paths_between_regions, r=estebank
Avoid `chain()` in `find_constraint_paths_between_regions()`.

This iterator can be hot, and chained iterators are slow. The second
half of the chain is almost always empty, so this commit specializes the
code to avoid the chained iteration.

This change reduces instruction counts for the `wg-grammar` benchmark by
up to 1.5%.
2019-10-01 23:06:12 -07:00
Tyler Mandry
65a050fddc
Rollup merge of #64722 - Mark-Simulacrum:alt-parallel, r=alexcrichton
Make all alt builders produce parallel-enabled compilers

We're not quite ready to ship parallel compilers by default, but the alt
builders are not used too much (in theory), so we believe that shipping
a possibly-broken compiler there is not too problematic.

r? @nikomatsakis
2019-10-01 23:06:11 -07:00
Tyler Mandry
c11cb25262
Rollup merge of #64649 - estebank:returnator, r=varkor
Avoid ICE on return outside of fn with literal array

Do not ICE when encountering `enum E { A = return [0][0] }`.

Fix #64638.
2019-10-01 23:06:09 -07:00
Eric Huss
04427b159d Update books 2019-10-01 19:35:13 -07:00
bors
ff191b54cc Auto merge of #64963 - Manishearth:clippyup, r=Manishearth
Update clippy

r? @ghost
2019-10-02 02:01:20 +00:00
AnthonyMikh
bd7cd80299
Fully clear HandlerInner in Handler::reset_err_count 2019-10-02 04:13:02 +03:00
Manish Goregaokar
56b269af74 Update clippy 2019-10-01 17:53:57 -07:00
Dylan MacKenzie
ffc52a7fe6 Update example table to match current output 2019-10-01 15:23:04 -07:00
Dylan MacKenzie
161123898f Reset row background for each block
Now the first row of each basic block is always light instead of
changing seemingly at random.
2019-10-01 15:21:58 -07:00
bors
7130fc54e0 Auto merge of #64972 - Centril:rollup-gcawast, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #63416 (apfloat: improve doc comments)
 - #64820 (BTreeSet intersection, is_subset & difference optimizations)
 - #64910 (syntax: cleanup param, method, and misc parsing)
 - #64912 (Remove unneeded `fn main` blocks from docs)
 - #64933 (Fixes #64919. Suggest fix based on operator precendence.)
 - #64943 (Add lower bound doctests for `saturating_{add,sub}` signed ints)
 - #64950 (Simplify interners)

Failed merges:

r? @ghost
2019-10-01 22:04:23 +00:00
Alex Crichton
8d9abcd870 Update rls submodule 2019-10-01 15:03:25 -07:00
Alex Crichton
4447388f17 Update Cargo.lock for cargo update 2019-10-01 15:02:45 -07:00
Mazdak Farrokhzad
adc0dc5871
Rollup merge of #64950 - nnethercote:simplify-interners, r=varkor,spastorino
Simplify interners

Some code readability improvements.
2019-10-01 23:56:27 +02:00
Mazdak Farrokhzad
66148f6393
Rollup merge of #64943 - lzutao:doc-saturating, r=shepmaster
Add lower bound doctests for `saturating_{add,sub}` signed ints

Closes #64940
2019-10-01 23:56:26 +02:00
Mazdak Farrokhzad
67cbeee9ee
Rollup merge of #64933 - sam09:master, r=estebank
Fixes #64919. Suggest fix based on operator precendence.

Fixes https://github.com/rust-lang/rust/issues/64919
2019-10-01 23:56:24 +02:00
Mazdak Farrokhzad
7628cada4f
Rollup merge of #64912 - lzutao:unneeded-main-doc, r=jonas-schievink
Remove unneeded `fn main` blocks from docs

## [No whitespace diff](https://github.com/rust-lang/rust/pull/64912/files?w=1)
2019-10-01 23:56:23 +02:00
Mazdak Farrokhzad
db9689333a
Rollup merge of #64910 - Centril:params-cleanup, r=petrochenkov
syntax: cleanup param, method, and misc parsing

Do some misc cleanup of the parser:
- Method and parameter parsing is refactored.
- A parser for `const | mut` is introduced that https://github.com/rust-lang/rust/pull/64588 can reuse.
- Some other misc parsing.

Next up in a different PR:
- ~Implementing https://github.com/rust-lang/rust/issues/64252.~ -- maybe some other time...
- Heavily restructuring up `item.rs` which is a mess (hopefully, no promises ^^).

r? @petrochenkov
2019-10-01 23:56:21 +02:00
Mazdak Farrokhzad
69028ae85b
Rollup merge of #64820 - ssomers:master, r=bluss
BTreeSet intersection, is_subset & difference optimizations

...based on the range of values contained; in particular, a massive improvement when these ranges are disjoint (or merely touching), like in the neg-vs-pos benchmarks already in liballoc. Inspired by #64383 but none of the ideas there worked out.

I introduced another variant in IntersectionInner and in DifferenceInner, because I couldn't find a way to initialize these iterators as empty if there's no empty set around.

Also, reduced the size of "large" sets in test cases - if Miri can't handle it, it was needlessly slowing down everyone.
2019-10-01 23:56:20 +02:00
Mazdak Farrokhzad
baba6284bf
Rollup merge of #63416 - RalfJung:apfloat, r=eddyb
apfloat: improve doc comments

r? @eddyb @nagisa
2019-10-01 23:56:16 +02:00
Yuki Okushi
f10d2e2d23 Fix clippy warnings 2019-10-01 23:15:47 +09:00
Stein Somers
d132a70bf4 BTreeSet intersection, difference & is_subnet optimizations 2019-10-01 15:50:11 +02:00
Lzu Tao
6c1b447f2e Remove unneeded fn main blocks from docs 2019-10-01 11:55:46 +00:00
Michael Woerister
e1d9f82605 Update cargo. 2019-10-01 13:53:17 +02:00
Sam Radhakrishnan
9e4eb46790 Change to use exprPrecedence instead of exprKind. 2019-10-01 05:00:22 -04:00
bors
702b45e409 Auto merge of #64946 - Centril:rollup-66mj5o0, r=Centril
Rollup of 10 pull requests

Successful merges:

 - #63674 (syntax: Support modern attribute syntax in the `meta` matcher)
 - #63931 (Stabilize macros in some more positions)
 - #64887 (syntax: recover trailing `|` in or-patterns)
 - #64895 (async/await: improve not-send errors)
 - #64896 (Remove legacy grammar)
 - #64907 (A small amount of tidying-up factored out from PR #64648)
 - #64928 (Add tests for some issues)
 - #64930 (Silence unreachable code lint from await desugaring)
 - #64935 (Improve code clarity)
 - #64937 (Deduplicate closure type errors)

Failed merges:

r? @ghost
2019-10-01 07:56:52 +00:00
Mazdak Farrokhzad
46bf6ad416
Rollup merge of #64937 - estebank:dedup-closure-err, r=Centril
Deduplicate closure type errors

Closure typing obligations flow in both direcitons to properly infer
types. Because of this, we will get 2 type errors whenever there's
an unfulfilled obligation. To avoid this, we deduplicate them in the
`InferCtxt`.
2019-10-01 09:55:39 +02:00
Mazdak Farrokhzad
5c6a8ee9dd
Rollup merge of #64935 - AnthonyMikh:librustc_errors/emmiter__code-clarity, r=estebank
Improve code clarity

No commit except 55b54285c8 address performance, just making the existing code more clear.

r? @estebank
2019-10-01 09:55:38 +02:00
Mazdak Farrokhzad
f4aa29fb1e
Rollup merge of #64930 - davidtwco:issue-61798-diverging-await, r=petrochenkov
Silence unreachable code lint from await desugaring

Fixes #61798.

This PR silences the unreachable code lint when it originates from within an await desugaring.
2019-10-01 09:55:37 +02:00
Mazdak Farrokhzad
dc1c1fe456
Rollup merge of #64928 - JohnTitor:add-some-tests, r=Centril
Add tests for some issues

Closes #50571
Closes #58022
Closes #58344
2019-10-01 09:55:35 +02:00
Mazdak Farrokhzad
24a84fae34
Rollup merge of #64907 - alexreg:tidy-up, r=Mark-Simulacrum
A small amount of tidying-up factored out from PR #64648

As requested by @Mark-Simulacrum, I put this in a separate commit to make it easier to review. (As far as I can tell, no violations of the policy here, and they are simply in a separate PR because they're not directly related to the import of that PR.)

r? @Mark-Simulacrum
2019-10-01 09:55:34 +02:00
Mazdak Farrokhzad
b8c5d3a427
Rollup merge of #64896 - XAMPPRocky:remove-grammar, r=Centril
Remove legacy grammar

Revival of #50835 & #55545

On the #wg-grammar discord there was agreement that enough progress has been made to be able to remove the legacy grammar.

r? @Centril @qmx

cc @rust-lang/wg-grammar
2019-10-01 09:55:33 +02:00
Mazdak Farrokhzad
25f774a4cf
Rollup merge of #64895 - davidtwco:issue-64130-async-error-definition, r=nikomatsakis
async/await: improve not-send errors

cc #64130.

```
note: future does not implement `std::marker::Send` because this value is used across an await
  --> $DIR/issue-64130-non-send-future-diags.rs:15:5
   |
LL |     let g = x.lock().unwrap();
   |         - has type `std::sync::MutexGuard<'_, u32>`
LL |     baz().await;
   |     ^^^^^^^^^^^ await occurs here, with `g` maybe used later
LL | }
   | - `g` is later dropped here
```

r? @nikomatsakis
2019-10-01 09:55:31 +02:00
Mazdak Farrokhzad
f45de9a690
Rollup merge of #64887 - Centril:recover-trailing-vert, r=estebank
syntax: recover trailing `|` in or-patterns

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

For example (this also shows that we are sensitive to the typo `||`):

```
error: a trailing `|` is not allowed in an or-pattern
  --> $DIR/remove-leading-vert.rs:33:11
   |
LL |         A || => {}
   |         - ^^ help: remove the `||`
   |         |
   |         while parsing this or-pattern starting here
   |
   = note: alternatives in or-patterns are separated with `|`, not `||`
```

r? @estebank
2019-10-01 09:55:29 +02:00
Mazdak Farrokhzad
3bd34e04e3
Rollup merge of #63931 - petrochenkov:stabmac, r=Centril
Stabilize macros in some more positions

- Fn-like macros and attribute macros in `extern` blocks
- Fn-like procedural macros in type positions
- ~Attribute macros on inline modules~ (moved to https://github.com/rust-lang/rust/pull/64273)

Stabilization report: https://github.com/rust-lang/rust/pull/63931#issuecomment-526362396.

Closes https://github.com/rust-lang/rust/issues/49476
cc https://github.com/rust-lang/rust/issues/54727
2019-10-01 09:55:28 +02:00
Mazdak Farrokhzad
64130fd2c4
Rollup merge of #63674 - petrochenkov:meta2, r=Centril
syntax: Support modern attribute syntax in the `meta` matcher

Where "modern" means https://github.com/rust-lang/rust/pull/57367:
```
PATH
PATH `(` TOKEN_STREAM `)`
PATH `[` TOKEN_STREAM `]`
PATH `{` TOKEN_STREAM `}`
```

Unfortunately, `meta` wasn't future-proofed using the `FOLLOW` token set like other matchers (https://github.com/rust-lang/rust/issues/34011), so code like `$meta:meta {` or `$meta:meta [` may break, and we need a crater run to find out how often this happens in practice.

Closes https://github.com/rust-lang/rust/issues/49629 (by fully supporting `meta` rather than removing it.)
2019-10-01 09:55:26 +02:00
Nicholas Nethercote
b2ae3f2a6b Remove the $lt_tcx parameter from direct_interners!.
It's not necessary.
2019-10-01 16:07:57 +10:00
Nicholas Nethercote
475e131b3e Inline and remove intern_method!.
It's only used in two places, and the code is shorter and more readable
with it gone.
2019-10-01 16:06:38 +10:00
Andreas Jonson
8737061cb5 replace try_for_each with try_fold to generate less code
removes two functions to inline by combining the check functions and extra call to try_for_each
2019-10-01 07:56:18 +02:00
Nicholas Nethercote
3724e37b5a Remove special treatment for _intern_canonical_var_infos.
This is a leftover from when there were global and thread-local arenas.
2019-10-01 15:50:51 +10:00
Nicholas Nethercote
e9d54e1860 Reorder the slice interners.
So the order matches the order in `CtxtInterners`.
2019-10-01 15:48:25 +10:00