Commit Graph

79116 Commits

Author SHA1 Message Date
Mark Rousskov
efb30d7695
Rollup merge of #51436 - Mark-Simulacrum:doc-stage1, r=QuietMisdreavus
Do not require stage 2 compiler for rustdoc

r? @QuietMisdreavus

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

I *think* this is correct; though I'm not certain. If it passes CI though I expect that to be good enough...
2018-06-08 17:21:09 -06:00
Mark Rousskov
4a2c1c294f
Rollup merge of #51427 - FelixMcFelix:nll-stderr-remover, r=oli-obk
compiletest: autoremove duplicate .nll.* files (#51204)

UI tests in bless mode should now check to see if `.nll.*` files have a
matching `.*` file. If a match is found, it will be deleted.
This should be extensible to other modes (i.e., Polonius).
On running with `--bless`, the two files removed in #51186 are, in turn,
removed automatically.

fixes #51204
2018-06-08 17:21:08 -06:00
Mark Rousskov
8ac351c209
Rollup merge of #51412 - nnethercote:pending_obligations, r=estebank
Avoid useless Vec clones in pending_obligations().

The only instance of `ObligationForest` in use has an obligation type of
`PendingPredicateObligation`, which contains a `PredicateObligation` and a
`Vec<Ty>`.

`FulfillmentContext::pending_obligations()` calls
`ObligationForest::pending_obligations()`, which clones all the
`PendingPredicateObligation`s. But the `Vec<Ty>` field of those cloned
obligations is never touched.

This patch changes `ObligationForest::pending_obligations()` to
`map_pending_obligations` -- which gives callers control about which part
of the obligation to clone -- and takes advantage of the change to avoid
cloning the `Vec<Ty>`. The change speeds up runs of a few rustc-perf
benchmarks, the best by 1%.
2018-06-08 17:21:07 -06:00
Mark Rousskov
898bb78024
Rollup merge of #51401 - estebank:warn-repr, r=cramertj
Warn on `repr` without hints

Fix #51376.
2018-06-08 17:21:05 -06:00
Mark Rousskov
b1a6db2833
Rollup merge of #51396 - SimonSapin:option-nonzero-layout, r=SimonSapin
Make the size of Option<NonZero*> a documented guarantee.

Closes #49137, the tracking issue for `NonZero*`, as this was the last remaining open question.

Note that `ptr::NonNull<T>` already documents a similar guarantee.
2018-06-08 17:21:04 -06:00
Mark Rousskov
6abaf4e703
Rollup merge of #51394 - nnethercote:NCA-depths, r=nikomatsakis
Use scope tree depths to speed up `nearest_common_ancestor`.

This patch adds depth markings to all entries in the `ScopeTree`'s
`parent_map`. This change increases memory usage somewhat, but permits a
much faster algorithm to be used:

- If one scope has a greater depth than the other, the deeper scope is
  moved upward until they are at equal depths.

- Then we move the two scopes upward in lockstep until they match.

This avoids the need to keep track of which scopes have already been
seen, which was the major part of the cost of the old algorithm. It also
reduces the number of child-to-parent moves (which are hash table
lookups) when the scopes start at different levels, because it never
goes past the nearest common ancestor the way the old algorithm did.

Finally, the case where one of the scopes is the root is now handled in
advance, because that is moderately common and lets us skip everything.

This change speeds up runs of several rust-perf benchmarks, the best by
6%.

A selection of the bigger improvements:
```
clap-rs-check
        avg: -2.6%      min: -6.6%      max: 0.0%
syn-check
        avg: -2.2%      min: -5.0%      max: 0.0%
style-servo-check
        avg: -2.9%?     min: -4.8%?     max: 0.0%?
cargo-check
        avg: -1.3%      min: -2.8%      max: 0.0%
sentry-cli-check
        avg: -1.0%      min: -2.1%      max: 0.0%
webrender-check
        avg: -0.9%      min: -2.0%      max: 0.0%
style-servo
        avg: -0.9%?     min: -1.8%?     max: -0.0%?
ripgrep-check
        avg: -0.7%      min: -1.8%      max: 0.1%
clap-rs
        avg: -0.9%      min: -1.6%      max: -0.2%
regex-check
        avg: -0.2%      min: -1.3%      max: 0.1%
syn
        avg: -0.6%      min: -1.3%      max: 0.1%
hyper-check
        avg: -0.5%      min: -1.1%      max: 0.0%
```
The idea came from multiple commenters on my blog and on Reddit. Thank you!

r? @nikomatsakis
2018-06-08 17:21:03 -06:00
Mark Rousskov
32ed5acf98
Rollup merge of #51391 - estebank:docspan, r=GuillaumeGomez
Use spans pointing at the inside of a rustdoc attribute

Follow up to #51111.

Point to the link in a rustdoc attribute where intralink resolution failed, instead of the full rustdoc attribute's span.

r? @GuillaumeGomez cc @kennytm
2018-06-08 17:21:02 -06:00
Mark Rousskov
4b176b2ce2
Rollup merge of #51360 - estebank:braces-around-literal-structs, r=nikomatsakis
Suggest parentheses when a struct literal needs them

When writing a struct literal in an expression that expects a block to
be started afterwards (like an `if` statement), do not suggest using the
same struct literal:

```
did you mean `S { /* fields * /}`?
```

Instead, suggest surrounding the expression with parentheses:

```
did you mean `(S { /* fields * /})`?
```

Fix #47360, #50090. Leaving #42982 open to come back to this problem with a better solution.
2018-06-08 17:21:00 -06:00
Mark Rousskov
d68098a43e
Rollup merge of #51298 - Dylan-DPC:stabilise/termination-test, r=nikomatsakis
Stabilize unit tests with non-`()` return type

References #48854
2018-06-08 17:20:59 -06:00
Mark Rousskov
b370f0e646
Rollup merge of #51276 - Havvy:dyn-trait-send-send, r=nikomatsakis
Dedup auto traits in trait objects.

Fixes #47010

Note that the test file `run-pass/trait-object-auto-dedup.rs` passes before and after this change. It's the `ui` test that changed from compiling to not compiling. Which does make this a breaking change, but I cannot imagine anybody actually being broken by it.
2018-06-08 17:20:58 -06:00
Mark Rousskov
71865fb947
Rollup merge of #51099 - Crazycolorz5:expectedcloseparen, r=estebank
Fix Issue 38777

When looking through for a closing bracket in the loop condition, adds them to expecteds.
https://github.com/rust-lang/rust/issues/38777
2018-06-08 17:20:57 -06:00
Mark Rousskov
91b6842dc9
Rollup merge of #50143 - petrochenkov:mexuniq, r=nikomatsakis
Add deprecation lint for duplicated `macro_export`s

cc https://github.com/rust-lang/rust/issues/35896#issuecomment-381370556
2018-06-08 17:20:55 -06:00
Crazycolorz5
df0c6a97b4 Built, corrected, and run tests. Added expected stderr files. 2018-06-08 17:25:53 -04:00
bors
c40275b34f Auto merge of #51410 - oli-obk:cargo_bump, r=nikomatsakis
Update the cargo submodule

This allows the next nightly to publish crates that are on the 2018 edition (in an unstable way)
2018-06-08 17:04:14 +00:00
Mark Simulacrum
721f2e789a Do not require stage 2 compiler for rustdoc 2018-06-08 08:29:15 -06:00
Kyle Simpson
ec08622192 compiletest: autoremove duplicate .nll.* files (#51204)
UI tests in bless mode should now check to see if `.nll.*` files have a
matching `.*` file. If a match is found, it will be deleted.
This should be extensible to other modes (i.e., Polonius).
On running with `--bless`, the two files removed in #51186 are, in turn,
removed automatically.
2018-06-08 01:10:34 +01:00
bors
1b4c921103 Auto merge of #51426 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests

Successful merges:

 - #51186 (Remove two redundant .nll.stderr files)
 - #51283 (Deny #[cfg] and #[cfg_attr] on generic parameters.)
 - #51368 (Fix the use of closures within #[panic_implementation])
 - #51380 (Remove dependency on fmt_macros from typeck)
 - #51389 (rustdoc: Fix missing stability and src links for inlined external macros)
 - #51399 (NLL performance boost)
 - #51407 (Update RLS and Rustfmt)
 - #51417 (Revert #49719)
 - #51420 (Tries to address the recent network issues)

Failed merges:
2018-06-07 23:06:39 +00:00
kennytm
34cd36e2f2
Rollup merge of #51420 - kennytm:some-network-issues, r=Mark-Simulacrum
Tries to address the recent network issues

1. Set the DNS server to 8.8.8.8/8.8.4.4/1.1.1.1/1.0.0.1 to workaround the daily "Cannot resolve host" error these two weeks.
2. Remove the unnecessary command `gem update --system` (originally added as experiment of the "Could not find a valid gem" error, which turns out to be useless).
2018-06-08 07:05:48 +08:00
kennytm
e46ef1bb86
Rollup merge of #51417 - pietroalbini:revert-49719, r=nikomatsakis
Revert #49719

This also needs to be backported into beta.

Fixes #51416.
r? @nikomatsakis
2018-06-08 07:05:47 +08:00
kennytm
c843607bcc
Rollup merge of #51407 - nrc:update, r=Mark-Simulacrum
Update RLS and Rustfmt

r? @Mark-Simulacrum

Fixes tests
2018-06-08 07:05:45 +08:00
kennytm
326331c34f
Rollup merge of #51399 - ngg:nll-performance, r=nikomatsakis
NLL performance boost

This makes compilation of the [inflate](https://github.com/rust-lang-nursery/rustc-perf/tree/master/collector/benchmarks/inflate) benchmark compile 2 times faster on my computer when NLL is enabled.
This does not fix the #51377 perfectly, it's still 4-5 times slower than without NLL, but it's a start.
2018-06-08 07:05:44 +08:00
kennytm
d5759daf64
Rollup merge of #51389 - ollie27:rustdoc_cross_macro_src_stab, r=QuietMisdreavus
rustdoc: Fix missing stability and src links for inlined external macros

Fixes #38951

r? @QuietMisdreavus
2018-06-08 07:05:43 +08:00
kennytm
b94b89b2ee
Rollup merge of #51380 - Mark-Simulacrum:remove-fmt-macros, r=oli-obk
Remove dependency on fmt_macros from typeck

None
2018-06-08 07:05:42 +08:00
kennytm
6c73943001
Rollup merge of #51368 - varkor:panic_implementation-closures, r=eddyb
Fix the use of closures within #[panic_implementation]

Fixes #51365.
2018-06-08 07:05:41 +08:00
kennytm
26a9d589c8
Rollup merge of #51283 - kennytm:fix-51279-preempt-the-warning-song-and-dance, r=nikomatsakis
Deny #[cfg] and #[cfg_attr] on generic parameters.

Fix #51279.

Attributes on generic parameters are not expanded, meaning `#[cfg]`, `#[cfg_attr]` and attribute proc macros are entirely ignored on them.

This PR makes using the first two attributes an error, because if they are correctly expanded will affect the AST and change code behavior.

I'm beta-nominating this, because generic parameter attributes are stabilizing in 1.27, and if we did not reserve their usage, we may never be able to repurpose the meaning of these attributes in the Rust 2015 edition.
2018-06-08 07:05:39 +08:00
kennytm
0bc15ed7c0
Rollup merge of #51186 - pnkfelix:remove-unneccessary-nll-stderr-files, r=oli-obk
Remove two redundant .nll.stderr files

It turns out that the diagnostics generated from NLL for these cases are now exactly the same as that produced by AST borrowck, and thus we can just fallback on those `.stderr` files that already exist for AST-borrowck.

Bravo!

(it is a good idea to remove these files, because it slightly reduces the amount of time humans will spend reviewing the .nll.stderr fileset...)

((it *might* be worthwhile trying to change the `compiletest` code to even issue a warning when two such files have equivalent contents... but I am not going so far as to try to implement that right now...))
2018-06-08 07:05:38 +08:00
Nicholas Nethercote
b0440d359b Avoid useless Vec clones in pending_obligations().
The only instance of `ObligationForest` in use has an obligation type of
`PendingPredicateObligation`, which contains a `PredicateObligation` and a
`Vec<Ty>`.

`FulfillmentContext::pending_obligations()` calls
`ObligationForest::pending_obligations()`, which clones all the
`PendingPredicateObligation`s. But the `Vec<Ty>` field of those cloned
obligations is never touched.

This patch changes `ObligationForest::pending_obligations()` to
`map_pending_obligations` -- which gives callers control about which part
of the obligation to clone -- and takes advantage of the change to avoid
cloning the `Vec<Ty>`. The change speeds up runs of a few rustc-perf
benchmarks, the best by 1%.
2018-06-08 09:00:17 +10:00
kennytm
32e8bda4e3
Use public DNS server instead of 169.254.169.254 on CI.
Tries to workaround travis-ci/travis-ci#9696.
2018-06-08 05:15:50 +08:00
kennytm
6e7affffac
Remove the gem update from .travis.yml
It has no effect on deployment error and may cause further network issues.
2018-06-08 04:31:30 +08:00
Esteban Küber
31bb50b6b9 Use from_inner_byte_pos for cleaner code 2018-06-07 09:47:09 -07:00
Pietro Albini
1df7817122
Revert "Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov"
This reverts commit d6ba1b9b02, reversing
changes made to 8de5353f75.
2018-06-07 17:07:05 +02:00
Oliver Schneider
0288ab03a9 Update the cargo submodule 2018-06-07 11:51:43 +02:00
Havvy
eccd2ede3c Use Ord::cmp for auto traits since stable sort not needed 2018-06-06 22:11:37 -07:00
Nick Cameron
acd4fe8974 Update RLS and Rustfmt 2018-06-07 15:14:49 +12:00
Esteban Küber
0e3f19d3f1 Do not account for inner/outer attr 2018-06-06 17:39:58 -07:00
Esteban Küber
3cc09c8380 Use consistent span for repr attr suggestion 2018-06-06 17:36:28 -07:00
bors
c131bdcaff Auto merge of #50699 - Zoxc:blocking-queries, r=mw
Blocking Rayon queries

r? @michaelwoerister
2018-06-06 22:24:07 +00:00
Esteban Küber
b3810f61da Add i/u size 2018-06-06 14:34:07 -07:00
Esteban Küber
9a80c2b994 Change repr documentation link 2018-06-06 14:33:07 -07:00
Esteban Küber
451eb66a53 Expand (fix) u* and i* repr hints 2018-06-06 14:25:57 -07:00
Esteban Küber
48e45eec30 Add transparent as valid repr hint 2018-06-06 14:25:50 -07:00
Esteban Küber
3580de8c6d Turn warning into lint 2018-06-06 14:11:48 -07:00
Felix S. Klock II
50224ec1a9 It turns out that the diagnostics generated from NLL for these cases are now exactly the same as that produced by AST borrowck. Bravo! 2018-06-06 22:41:00 +02:00
bors
19d0b539aa Auto merge of #51263 - cramertj:futures-in-core, r=aturon
Add Future and task system to the standard library

This adds preliminary versions of the `std::future` and `std::task` modules in order to unblock development of async/await (https://github.com/rust-lang/rust/issues/50547). These shouldn't be considered as final forms of these libraries-- design questions about the libraries should be left on https://github.com/rust-lang/rfcs/pull/2418. Once that RFC (or a successor) is merged, these APIs will be adjusted as necessary.

r? @aturon
2018-06-06 19:42:19 +00:00
Esteban Küber
2c7099baeb Expand output and suggestions, fix tests 2018-06-06 12:31:43 -07:00
Taylor Cramer
a6055c8859 Add Future and task system to the standard library 2018-06-06 10:41:52 -07:00
Esteban Küber
36381fabaf Warn on repr without hints 2018-06-06 10:02:09 -07:00
bors
cb8ab33ed2 Auto merge of #51333 - GuillaumeGomez:reexport-fmt-alignment, r=SimonSapin
Reexport fmt::Alignment into std

Follow-up of #51078.
2018-06-06 17:01:56 +00:00
Esteban Küber
7d0b6b75f0 When unable to sinthesize link span, fallback to previous behavior 2018-06-06 09:38:47 -07:00
Esteban Küber
507dfd2148 Use spans pointing at the inside of a rustdoc attribute 2018-06-06 08:49:42 -07:00