Commit Graph

151878 Commits

Author SHA1 Message Date
Aaron Hill
a2ae191295
Rename known_attrs to expanded_inert_attrs and move to rustc_expand
There's no need for this to be (untracked) global state.
2021-07-23 17:03:07 -05:00
bors
4a1f419e64 Auto merge of #87345 - Xanewok:update-rls, r=Mark-Simulacrum
Unbreak and update RLS

Closes #86905
Closes #86606
Closes #86607

This also prunes old mio 0.6 thanks to Tokio 1.0 bump, so this should now build on aarch64 Windows.

r? `@Mark-Simulacrum`
2021-07-23 17:40:13 +00:00
bors
0443424954 Auto merge of #87400 - JohnTitor:rollup-zbwyuxi, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #87034 (DOC: fix hypothetical Rust code in `step_by()` docstring)
 - #87298 (memorialize Anna Harren in the bastion of the turbofish)
 - #87332 (Don't hide fields of enum struct variants)
 - #87362 (Make `x.py d` an alias for `x.py doc`)
 - #87372 (Move calls to test_main into one function)
 - #87373 (Extend HIR WF checking to fields)
 - #87376 (Change rustdoc logo to use the full container size)
 - #87383 (Add regression tests for the impl_trait_in_bindings ICEs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-07-23 12:33:58 +00:00
Mark Rousskov
a44abe58ea Add missing winapi feature to workspace hack 2021-07-23 08:15:40 -04:00
Yuki Okushi
7c0c329635
Rollup merge of #87383 - Alexendoo:impl_trait_in_bindings-tests, r=oli-obk
Add regression tests for the impl_trait_in_bindings ICEs

Closes #54600, closes #54840, closes #58504, closes #58956, closes #70971, closes #79099, closes #84919, closes #86201, closes #86642, closes #87295

r? ``@oli-obk``
2021-07-23 19:27:51 +09:00
Yuki Okushi
fe5799c399
Rollup merge of #87376 - Thomasdezeeuw:rustdoc-large-logo, r=GuillaumeGomez
Change rustdoc logo to use the full container size

We have a logo in svg that scales nicely to large sizes, but by default
is only 5px large, i.e. very small. With the change the logo expands to
the full size. By only setting the height to 100% we ensure that the
width-height ratio isn't changed.
2021-07-23 19:27:49 +09:00
Yuki Okushi
1e33d13d39
Rollup merge of #87373 - Aaron1011:hir-wf-field, r=estebank
Extend HIR WF checking to fields

r? ``@estebank``
2021-07-23 19:27:48 +09:00
Yuki Okushi
7c2436ad34
Rollup merge of #87372 - GuillaumeGomez:move-test_main-calls, r=jyn514
Move calls to test_main into one function

Fixes #86254.

cc ``@jyn514``
r? ``@camelid``
2021-07-23 19:27:47 +09:00
Yuki Okushi
a247257955
Rollup merge of #87362 - inquisitivecrystal:bootstrap-doc, r=jyn514
Make `x.py d` an alias for `x.py doc`

In rust-lang/cargo#9680, `d` was added to Cargo as an alias for `doc`. This PR adds the same alias to `x.py`. The same considerations of convenience that applied to Cargo also apply to `x.py`, and in any case, the two should be kept symmetrical.
2021-07-23 19:27:46 +09:00
Yuki Okushi
377bb73989
Rollup merge of #87332 - camelid:dont-hide-fields, r=GuillaumeGomez
Don't hide fields of enum struct variants

* The toggle adds visual clutter
* It's easy to miss that there are fields
* Tuple variant fields are always shown, so it is inconsistent to hide
  struct variant fields
* It's annoying to have to click the toggle every time
2021-07-23 19:27:45 +09:00
Yuki Okushi
0faf5e0451
Rollup merge of #87298 - boringcactus:patch-2, r=steveklabnik
memorialize Anna Harren in the bastion of the turbofish

this seems fitting, at least to me.
2021-07-23 19:27:44 +09:00
Yuki Okushi
ba6957c9fb
Rollup merge of #87034 - mgeier:doc-step_by, r=JohnTitor
DOC: fix hypothetical Rust code in `step_by()` docstring

I don't know how important that is, but if I'm not mistaken, the hypothetical code in the docstring of `step_by()` (see https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.step_by) isn't correct.

I guess writing `next()` instead of `self.next()` isn't a biggie, but this would also imply that `advance_n_and_return_first()` is a method, which AFAICT it isn't.

I've also done some re-formatting in a separate commit and a parameter renaming in yet another commit.

Feel free to take or leave any combination of those commits.
2021-07-23 19:27:43 +09:00
bors
b2b7c859c1 Auto merge of #87287 - oli-obk:fixup_fixup_fixup_opaque_types, r=spastorino
Make mir borrowck's use of opaque types independent of the typeck query's result

fixes #87218
fixes #86465

we used to use the typeck results only to generate an obligation for the mir borrowck type to be equal to the typeck result.

When i removed the `fixup_opaque_types` function in #87200, I exposed a bug that showed that mir borrowck can't doesn't get enough information from typeck in order to build the correct lifetime mapping from opaque type usage to the actual concrete type. We therefor now fully compute the information within mir borrowck (we already did that, but we only used it to verify the typeck result) and stop using the typeck information.

We will likely be able to remove most opaque type information from the borrowck results in the future and just have all current callers use the mir borrowck result instead.

r? `@spastorino`
2021-07-23 03:40:26 +00:00
Noah Lev
97623bf051 Don't hide fields of enum struct variants
* The toggle adds visual clutter
* It's easy to miss that there are fields
* Tuple variant fields are always shown, so it is inconsistent to hide
  struct variant fields
* It's annoying to have to click the toggle every time
2021-07-22 12:52:33 -07:00
Alex Macleod
470d378646 Add regression tests for the impl_trait_in_bindings ICEs 2021-07-22 19:43:29 +01:00
bors
027187094e Auto merge of #86212 - pnkfelix:mainline-targetted-revert-81473-warn-write-only-fields, r=simulacrum
Revert PR 81473 to resolve (on mainline) issues 81626 and 81658.

This is a nightly-targetted variant of PR #83171

The intent is to just address issue #81658 on all release channels, rather that keep repeatedly reverting PR #83171 on beta.

However, our intent is *also* to reland PR #83171 after we have addressed issue #81658 , most likely by coupling the re-landing of PR #83171 with an enhancement like PR #83004
2021-07-22 18:41:27 +00:00
Thomas de Zeeuw
49b1be2c32 Change rustdoc logo to use the full container size
We have a logo in svg that scales nicely to large sizes, but by default
is only 5px large, i.e. very small. With the change the logo expands to
the full size. By only setting the height to 100% we ensure that the
width-height ratio isn't changed.
2021-07-22 18:05:06 +02:00
Aaron Hill
0ebd6e4891
Extend HIR WF checking to fields 2021-07-22 10:22:00 -05:00
bors
e742158ef5 Auto merge of #87371 - ehuss:update-cargo, r=ehuss
Update cargo

2 commits in 4e143fd131e0c16cefd008456e974236ca54e62e..cebef2951ee69617852844894164b54ed478a7da
2021-07-20 21:55:45 +0000 to 2021-07-22 13:01:52 +0000
- Changes rustc argument from `--force-warns` to `--force-warn` (rust-lang/cargo#9714)
- Display registry name instead of registry URL when possible (rust-lang/cargo#9632)
2021-07-22 15:10:19 +00:00
Guillaume Gomez
ef953b096e Move calls to test_main into one function 2021-07-22 17:01:12 +02:00
Eric Huss
9c40255e48 Update cargo 2021-07-22 07:58:45 -07:00
bors
1158367a6d Auto merge of #87366 - GuillaumeGomez:rollup-7muueab, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #87270 (Don't display <table> in item summary)
 - #87281 (Normalize generic_ty before checking if bound is met)
 - #87288 (rustdoc: Restore --default-theme, etc, by restoring varname escaping)
 - #87307 (Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC.)
 - #87343 (Regression fix to avoid further beta backports: Remove unsound TrustedRandomAccess implementations)
 - #87357 (Update my name/email in .mailmap)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-07-22 12:29:30 +00:00
Guillaume Gomez
ab9ea543f8
Rollup merge of #87357 - lilyball:mailmap, r=jyn514
Update my name/email in .mailmap

I should have done this years ago.

My name is also scattered across many other rust-lang repos, but none of the other repos I've looked at have a `.mailmap`. Is there any particular reason for this, or any process for updating my name/email everywhere?
2021-07-22 13:39:25 +02:00
Guillaume Gomez
aece3df81e
Rollup merge of #87343 - steffahn:fix_unsound_zip_optimization_only_regression_fix, r=cuviper
Regression fix to avoid further beta backports: Remove unsound TrustedRandomAccess implementations

Removes the implementations that depend on the user-definable trait `Copy`.

Only fix regressions to ensure merge in 1.55: Does not modify `vec::IntoIter`.

<hr>

This PR applies the beta-`1.53` backport #86222 (merged as part of #86225), a reduced version of #85874 that only fixes regressions, to `master` in order to avoid the need for further backports from `1.55` onwards. Beta-`1.54` backport already happened with #87136. In case that #85874 gets merged quickly (within a week), this PR would be unnecessary.

r? `@cuviper`
2021-07-22 13:39:24 +02:00
Guillaume Gomez
90d6d3327d
Rollup merge of #87307 - michaelwoerister:pgo-unwind-msvc, r=nagisa
Allow combining -Cprofile-generate and -Cpanic=unwind when targeting MSVC.

The LLVM limitation that previously prevented this has been fixed in LLVM 9 which is older than the oldest LLVM version we currently support.

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

r? ``@nagisa`` (or anyone else from ``@rust-lang/wg-llvm)``
2021-07-22 13:39:23 +02:00
Guillaume Gomez
8dba89823a
Rollup merge of #87288 - ijackson:rustdoc-theme, r=GuillaumeGomez
rustdoc: Restore --default-theme, etc, by restoring varname escaping

In #86157

    cd0f93193c
    Use Tera templates for rustdoc.

dropped the following transformation from the keys of the default settings element's `data-` attribute names:

    .map(|(k, v)| format!(r#" data-{}="{}""#, k.replace('-', "_"), Escape(v)))

The `Escape` part is indeed no longer needed, because Tera does that for us.  But the massaging of `-` to `_` is needed, for the (bizarre) reasons explained in the new comments.

I have tested that the default theme function works again for me.  I have also verified that passing (in shell syntax)

    '--default-theme="zork&"'

escapes the value in the HTML.

Closes #87263
2021-07-22 13:39:22 +02:00
Guillaume Gomez
e16d023a5e
Rollup merge of #87281 - rust-lang:issue-81487, r=nikomatsakis
Normalize generic_ty before checking if bound is met

Fixes #81487

r? `@nikomatsakis`
2021-07-22 13:39:21 +02:00
Guillaume Gomez
aa3d64ef90
Rollup merge of #87270 - GuillaumeGomez:item-summary-table, r=notriddle
Don't display <table> in item summary

Fixes #87231.

r? `@notriddle`
2021-07-22 13:39:20 +02:00
Oli Scherer
d10385242d bless nll tests 2021-07-22 11:26:42 +00:00
Oli Scherer
f2d2fd38eb Add a regression test 2021-07-22 11:20:29 +00:00
Oli Scherer
9f09a5eb8b Resolve nested inference variables.
I attempted that with the previous code, but I misunderstdood how
`shallow_resolve` works.
2021-07-22 11:20:29 +00:00
Oli Scherer
a8551abd47 Remove an unnecessary variable 2021-07-22 11:20:29 +00:00
Oli Scherer
bdc20e372b Use instrument debugging for more readable logs 2021-07-22 11:20:29 +00:00
Oli Scherer
6d76002baf Make mir borrowck's use of opaque types independent of the typeck query's result 2021-07-22 11:20:29 +00:00
Oli Scherer
d693a98f4e Fix VecMap::iter_mut
It used to allow you to mutate the key, even though that can invalidate the map by creating duplicate keys.
2021-07-22 11:20:29 +00:00
Guillaume Gomez
df6bdd764a Move implementors directly into lib2 2021-07-22 12:58:59 +02:00
Guillaume Gomez
174728d045 Add tests for default-settings 2021-07-22 12:58:59 +02:00
bors
f913a4fe90 Auto merge of #86619 - rylev:incr-hashing-profiling, r=wesleywiser
Profile incremental compilation hashing fingerprints

Adds profiling instrumentation for the hashing of incremental compilation fingerprints per query.

This will eventually feed into the `measureme` and `rustc-perf` infrastructure for tracking if computing hashes changes over time.

TODOs:
* [x] Address the FIXME where we are including node interning in the hash timing.
* [ ] Update measureme/summarize to handle this new data: https://github.com/rust-lang/measureme/pull/166
* [ ] ~Update rustc-perf to handle the new data from measureme~ (will be done at a later time)

r? `@ghost`

cc `@michaelwoerister`
2021-07-22 10:04:44 +00:00
bors
7c89e389d0 Auto merge of #87265 - Aaron1011:hir-wf-fn, r=estebank
Support HIR wf checking for function signatures

During function type-checking, we normalize any associated types in
the function signature (argument types + return type), and then
create WF obligations for each of the normalized types. The HIR wf code
does not currently support this case, so any errors that we get have
imprecise spans.

This commit extends `ObligationCauseCode::WellFormed` to support
recording a function parameter, allowing us to get the corresponding
HIR type if an error occurs. Function typechecking is modified to
pass this information during signature normalization and WF checking.
The resulting code is fairly verbose, due to the fact that we can
no longer normalize the entire signature with a single function call.

As part of the refactoring, we now perform HIR-based WF checking
for several other 'typed items' (statics, consts, and inherent impls).

As a result, WF and projection errors in a function signature now
have a precise span, which points directly at the responsible type.
If a function signature is constructed via a macro, this will allow
the error message to point at the code 'most responsible' for the error
(e.g. a user-supplied macro argument).
2021-07-22 07:21:45 +00:00
inquisitivecrystal
a60f6275fd Make x.py d an alias for x.py doc 2021-07-21 23:44:09 -07:00
bors
7db08eeb00 Auto merge of #87250 - robojumper:87199-sized-relaxation, r=nikomatsakis
Fix implicit Sized relaxation when attempting to relax other, unsupported trait

Fixes #87199.

Do note that this bug fix causes code like the `ref_arg::<[i32]>(&[5]);` line in the test case in combination with an affected function to no longer compile.
2021-07-22 05:02:50 +00:00
Felix S. Klock II
ee2bb1f338 temporarily ignore a test until we reland PR 83171. 2021-07-21 23:03:06 -04:00
Felix S. Klock II
b6e9d069eb Allow some temporarily dead code.
I expect these two methods to come back very soon; noise of removing them to satisfy lint seems wrong.
2021-07-21 22:57:10 -04:00
Felix S. Klock II
cf337d1119 Revert PR 81473 to resolve (on mainline) issues 81626 and 81658.
Revert "Add missing brace"

This reverts commit 85ad773049.

Revert "Simplify base_expr"

This reverts commit 899aae465e.

Revert "Warn write-only fields"

This reverts commit d3c69a4c0d.
2021-07-21 22:49:52 -04:00
bors
8024983ea7 Auto merge of #87246 - rust-lang:placeholder-pretty, r=nikomatsakis
When pretty printing, name placeholders as bound regions

Split from #85499

When we see a placeholder that we are going to print, treat it as a bound var (and add it to a `for<...>`
2021-07-22 02:22:02 +00:00
Lily Ballard
4f98d51f98 Update my name/email in .mailmap 2021-07-21 16:53:19 -07:00
bors
602150f21f Auto merge of #86946 - Aaron1011:eval-proj-obligation, r=nikomatsakis
Improve caching during trait evaluation

Previously, we would 'forget' that we had `'static` regions in some
place during trait evaluation. This lead to us producing
`EvaluatedToOkModuloRegions` when we could have produced
`EvaluatedToOk`, causing us to perform unnecessary work.

This PR preserves `'static` regions when we canonicalize a predicate for
`evaluate_obligation`, and when we 'freshen' a predicate during trait
evaluation. Thie ensures that evaluating a predicate containing
`'static` regions can produce `EvaluatedToOk` (assuming that we
don't end up introducing any region dependencies during evaluation).

Building off of this improved caching, we use
`predicate_must_hold_considering_regions` during fulfillment of
projection predicates to see if we can skip performing additional work.
We already do this for trait predicates, but doing this for projection
predicates lead to mixed performance results without the above caching
improvements.
2021-07-21 23:18:19 +00:00
Aaron Hill
3291218f47
Improve caching during trait evaluation
Previously, we would 'forget' that we had `'static` regions in some
place during trait evaluation. This lead to us producing
`EvaluatedToOkModuloRegions` when we could have produced
`EvaluatedToOk`, causing us to perform unnecessary work.

This PR preserves `'static` regions when we canonicalize a predicate for
`evaluate_obligation`, and when we 'freshen' a predicate during trait
evaluation. Thie ensures that evaluating a predicate containing
`'static` regions can produce `EvaluatedToOk` (assuming that we
don't end up introducing any region dependencies during evaluation).

Building off of this improved caching, we use
`predicate_must_hold_considering_regions` during fulfillment of
projection predicates to see if we can skip performing additional work.
We already do this for trait predicates, but doing this for projection
predicates lead to mixed performance results without the above caching
improvements.
2021-07-21 17:54:05 -05:00
bors
32c9b7b091 Auto merge of #87351 - ehuss:rollup-pga85az, r=ehuss
Rollup of 5 pull requests

Successful merges:

 - #81864 (docs: GlobalAlloc: completely replace example with one that works)
 - #87024 (rustdoc: show count of item contents when hidden)
 - #87278 (⬆️ rust-analyzer)
 - #87326 (Update cargo)
 - #87346 (Rename force-warns to force-warn)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-07-21 19:50:10 +00:00
Igor Matuszewski
5fcb726f6c Fix formatting in tidy exception list 2021-07-21 21:08:39 +02:00