Commit Graph

200027 Commits

Author SHA1 Message Date
Jack Huey
e09242d5b8 Final bits 2022-09-16 17:47:53 -04:00
Jack Huey
f1767dbb42 Add ExtraConstraintInfo 2022-09-16 17:33:12 -04:00
Jack Huey
9929c0ac76 Add AscribeUserTypeProvePredicate 2022-09-16 17:20:11 -04:00
Jack Huey
ec17be2656 Add outlives_constraint to BlameConstraint 2022-09-16 17:08:35 -04:00
Jack Huey
67653292be Add to_constraint_category to ObligationCause and SubregionOrigin 2022-09-16 17:00:11 -04:00
Jack Huey
6075877c89 Pass ConstraintCategory thorough a few more places 2022-09-16 16:44:18 -04:00
Jack Huey
a46376e247 Make QueryOutlivesConstraint contain a ConstraintCategory 2022-09-16 16:15:41 -04:00
bors
4d4e51e428 Auto merge of #101902 - jackh726:revert-static-hrtb-error, r=nikomatsakis
Partially revert #101433

reverts #101433 to fix #101844

We should get this into the beta cut, since the ICE is getting hit quite a bit.
2022-09-16 16:46:14 +00:00
Jack Huey
d97fdf16d9 Add test for #101844 2022-09-16 09:47:37 -04:00
Jack Huey
92b759f517 Revert "Better errors for implied static bound"
This reverts commit c75817b0a7.
2022-09-16 09:47:07 -04:00
Jack Huey
bba514b7b4 Revert "Use Predicate ConstraintCategory when normalizing"
This reverts commit aae37f8763.
2022-09-16 09:01:28 -04:00
bors
54f20bbb8a Auto merge of #101895 - GuillaumeGomez:rollup-ured85q, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #101494 (rustdoc mobile: move notable traits to return type)
 - #101813 (Extend CSS check to CSS variables)
 - #101825 (Fix back RPIT changes)
 - #101843 (Suggest associated const for incorrect use of let in traits)
 - #101859 (Slight vertical formatting)
 - #101868 (rustdoc: use more precise URLs for jump-to-definition links)
 - #101877 (rustdoc: remove no-op CSS `.block { padding: 0 }`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-16 12:43:22 +00:00
Guillaume Gomez
e284393c9e
Rollup merge of #101877 - notriddle:notriddle/block, r=Dylan-DPC
rustdoc: remove no-op CSS `.block { padding: 0 }`

This rule was changed in 8fb1250aba from the original version that had a non-zero padding. It's not needed, because it's not overriding anything that would've given `.block` a padding.
2022-09-16 13:07:19 +02:00
Guillaume Gomez
c21dcd7914
Rollup merge of #101868 - notriddle:notriddle/short-links-jump-to-definition, r=GuillaumeGomez
rustdoc: use more precise URLs for jump-to-definition links

As an example, this cuts down <https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/mod.rs.html> by about 11%.

    $ du -h new_mod.rs.html old_mod.rs.html
    296K	new_mod.rs.html
    332K	old_mod.rs.html

Like https://github.com/rust-lang/rust/pull/83237, but separate code since source links have a different URL structure.

Related to [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/RFC.20for.20.22jump.20to.20definition.22.20feature/near/299029786) and [the jump-to-definition pre-RFC](https://github.com/GuillaumeGomez/rfcs/pull/1).
2022-09-16 13:07:19 +02:00
Guillaume Gomez
9a72ded562
Rollup merge of #101859 - Rageking8:slight-vertical-formatting, r=compiler-errors
Slight vertical formatting
2022-09-16 13:07:18 +02:00
Guillaume Gomez
72d9e0821e
Rollup merge of #101843 - chenyukang:fix-101797, r=oli-obk
Suggest associated const for incorrect use of let in traits

Fixes #101797
2022-09-16 13:07:18 +02:00
Guillaume Gomez
8ba133fa7b
Rollup merge of #101825 - spastorino:fix-rpit-changes, r=oli-obk
Fix back RPIT changes

r? `@oli-obk`

cc `@compiler-errors`
2022-09-16 13:07:17 +02:00
Guillaume Gomez
6f8d41c6ba
Rollup merge of #101813 - GuillaumeGomez:check-css-variables, r=notriddle
Extend CSS check to CSS variables

This PR is a bit big because the first commit is a rewrite of the CSS parser to something a bit simpler which still allows to get easily access to CSS properties name.

The other two are about adding tests and adding the CSS variables check.

This check was missing because we are relying more and more on CSS variables rather than CSS selectors in themes.

r? `@notriddle`
2022-09-16 13:07:17 +02:00
Guillaume Gomez
e96abefe80
Rollup merge of #101494 - jsha:notable-traits-right, r=GuillaumeGomez
rustdoc mobile: move notable traits to return type

These were originally on the left, but were moved to the return type in c90fb7185a. The CSS rule for mobile did not get updated at the time, so updating it now.

r? `@notriddle`
2022-09-16 13:07:16 +02:00
bors
2d1aa57d1e Auto merge of #101860 - oli-obk:information_throwing, r=compiler-errors
Don't throw away information just to recompute it again

also allows making some functions private.
2022-09-16 09:57:32 +00:00
bors
22f6aec42d Auto merge of #101882 - Dylan-DPC:rollup-9lxwuwj, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #101722 (Rustdoc-Json: Fix Type docs.)
 - #101738 (Fix `#[link kind="raw-dylib"]` to respect `#[link_name]`)
 - #101753 (Prefer explict closure sig types over expected ones)
 - #101787 (cache `collect_trait_impl_trait_tys`)
 - #101802 (Constify impl Fn* &(mut) Fn*)
 - #101809 (Replace `check_missing_items.py` with `jsondoclint`)
 - #101864 (rustdoc: remove no-op CSS `h1-4 { color: --main-color }`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-16 07:14:29 +00:00
Dylan DPC
18d3063350
Rollup merge of #101864 - notriddle:notriddle/h1-h2-h3-h4, r=GuillaumeGomez
rustdoc: remove no-op CSS `h1-4 { color: --main-color }`

Headers already inherit the font color they need from their parents.

This rule dates back to earlier versions of the rustdoc theme, where headers and body had different text colors.

68c15be8b5/src/librustdoc/html/static/main.css (L72-L98)

Nowadays, since the two have exactly the same color (specified by the `--main-color` variable), this rule does nothing.
2022-09-16 11:17:03 +05:30
Dylan DPC
458555dbf6
Rollup merge of #101809 - aDotInTheVoid:jsondoclint, r=GuillaumeGomez
Replace `check_missing_items.py` with `jsondoclint`

[zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/check_missing_items.2Epy.20Replacement.2E)

check_missing_items.py was a python script that checked rustdoc json output to make sure all the Id's referenced existed in the JSON index. This PR replaces that with a rust binary (`jsondoclint`) that does the same thing.

### Motivation

1. Easier to change when `rustdoc-json-types` changes, as `jsondoclint` uses the types directly.
2. Better Errors:
    - Multiple Errors can be emited for a single crate
    - Errors can say where in JSON they occored
        ```
        2:2889:408 not in index or paths, but refered to at '.index."2:2888:104".inner.items[0]'
        2:2890:410 not in index or paths, but refered to at '.index."2:2888:104".inner.items[1]'
        ```
3. Catches more bugs.
    - Because matches are exaustive, all posible variants considered for enums
    - All Id's checked
    - Has already found #101770, #101199 and #100973
    - Id type is also checked, so the Id's in a structs fields can only be field items.
4. Allows the possibility of running from `rustdoc::json`, which we should do in a crator run at some point.

cc ``@CraftSpider``

r? ``@GuillaumeGomez``
2022-09-16 11:17:02 +05:30
Dylan DPC
cfef659d13
Rollup merge of #101802 - chriss0612:const_fn_trait_ref_impls, r=fee1-dead
Constify impl Fn* &(mut) Fn*

Tracking Issue: [101803](https://github.com/rust-lang/rust/issues/101803)

Feature gate: `#![feature(const_fn_trait_ref_impls)]`

This feature allows using references to Fn* Items as Fn* Items themself in a const context.
2022-09-16 11:17:02 +05:30
Dylan DPC
28b4c62382
Rollup merge of #101787 - compiler-errors:cache-rpitit, r=petrochenkov
cache `collect_trait_impl_trait_tys`

Micro-optimization for RPITITs
2022-09-16 11:17:01 +05:30
Dylan DPC
edf9e5eb63
Rollup merge of #101753 - oli-obk:tait_closure_args, r=compiler-errors
Prefer explict closure sig types over expected ones

fixes #100800

Previously we only checked that given closure arguments are equal to expected closure arguments, but now we choose the given closure arguments for the signature that is used when type checking the closure body, and keep the other signature for the type of the closure as seen outside of it.
2022-09-16 11:17:01 +05:30
Dylan DPC
61126d3611
Rollup merge of #101738 - dpaoliello:linkname, r=petrochenkov
Fix `#[link kind="raw-dylib"]` to respect `#[link_name]`

Issue Details:
When using `#[link kind="raw-dylib"]` (#58713), the Rust compiler ignored any `#[link_name]` attributes when generating the import library and so the resulting binary would fail to link due to missing symbols.

Fix Details:
Use the name from `#[link_name]` if present when generating the `raw-dylib` import library, otherwise default back to the actual symbol name.
2022-09-16 11:17:00 +05:30
Dylan DPC
b763cd53f4
Rollup merge of #101722 - aDotInTheVoid:rdy-ty-prim-docs, r=CraftSpider
Rustdoc-Json: Fix Type docs.

Primitive doesn't include Array/Slice/Tuple, as they are their own variants.

ResolvedPath doesn't include Traits, as they appear in the DynTrait variant.
2022-09-16 11:17:00 +05:30
Michael Howell
7c8e4ef49d rustdoc: remove no-op CSS .block { padding: 0 }
This rule was changed in 8fb1250aba from the
original version that had a non-zero padding. It's not needed, because
it's not overriding anything that would've given `.block` a padding.
2022-09-15 17:16:59 -07:00
bors
0ee5a1ac19 Auto merge of #101711 - chenyukang:fix-101691, r=jyn514
Copy stage0 binaries into stage0-sysroot

Fixes #101691
2022-09-16 00:02:46 +00:00
bors
cf9ed0dd58 Auto merge of #101831 - compiler-errors:issue-75899, r=jackh726
Normalize struct field types in `confirm_builtin_unsize_candidate`

Fixes #75899

---

edited to move the normalization into `confirm_builtin_unsize_candidate` instead of the coercion code.
2022-09-15 21:06:36 +00:00
Michael Howell
669498ca0a rustdoc: fix test cases 2022-09-15 13:14:30 -07:00
Michael Howell
ef24747703 rustdoc: use more precise URLs for jump-to-definition links
As an example, this cuts down
<https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/ty/mod.rs.html>
by about 11%.

    $ du -h new_mod.rs.html old_mod.rs.html
    296K	new_mod.rs.html
    332K	old_mod.rs.html
2022-09-15 13:03:04 -07:00
bors
df34db9b03 Auto merge of #101858 - oli-obk:lift_derive, r=lcnr
derive various impls instead of hand-rolling them

r? `@lcnr`

This may not have been what you asked for in 964b97e845 (r84051418) but I got carried away while following the compiler team meeting today.
2022-09-15 18:14:29 +00:00
yukang
4bf7d2ca91 tweak suggestion 2022-09-16 01:09:26 +08:00
Michael Howell
7f1734cd94 rustdoc: remove no-op CSS h1-4 { color: --main-color }
Headers already inherit the font color they need from their parents.

This rule dates back to earlier versions of the rustdoc theme, where headers
and body had different text colors.

68c15be8b5/src/librustdoc/html/static/main.css (L72-L98)

Nowadays, since the two have exactly the same color (specified by the
`--main-color` variable), this rule does nothing.
2022-09-15 09:59:27 -07:00
Oli Scherer
8aed75bee0 Don't throw away information just to recompute it again 2022-09-15 16:23:10 +00:00
Rageking8
6d7beafc87 slight vertical formatting 2022-09-15 23:51:43 +08:00
Oli Scherer
c6fcb1c6a3 Merge all TypeVisitable for &List<T> impls into one generic one 2022-09-15 15:33:46 +00:00
bors
35a0407814 Auto merge of #101410 - dingxiangfei2009:fix-let-else-scoping, r=jackh726
Reorder nesting scopes and declare bindings without drop schedule

Fix #99228
Fix #99975

Storages are previously not declared before entering the `else` block of a `let .. else` statement. However, when breaking out of the pattern matching into the `else` block, those storages are recorded as scheduled for drops. This is not expected.

This MR fixes this issue by not scheduling the drops for those storages.

cc `@est31`
2022-09-15 15:19:40 +00:00
Oli Scherer
9d9306828c Replace more manual TypeFoldable and TypeVisitable impls with derives 2022-09-15 15:05:03 +00:00
Oli Scherer
a5ab8da1e2 derive TypeVisitable and TypeFoldable for mir types 2022-09-15 14:42:43 +00:00
Oli Scherer
d376012a43 Derive TypeFoldable and TypeVisitable for mir::PlaceElement 2022-09-15 13:43:44 +00:00
Oli Scherer
10c0560cd2 Resolve a FIXME 2022-09-15 13:37:34 +00:00
Oli Scherer
d4e986c1f0 derive various Lift impl instead of hand rolling them 2022-09-15 13:32:43 +00:00
bors
294f0eef73 Auto merge of #101173 - jyn514:simplify-macro-arguments, r=cjgillot
Further simplify the macros generated by `rustc_queries`

This doesn't actually move anything outside the macros, but it makes them simpler to read.

- Add a new `rustc_query_names` macro. This allows a much simpler syntax for the matchers in the macros passed to it as a callback.
- Convert `define_dep_nodes` and `alloc_once` to use `rustc_query_names`. This is possible because they only use the names
  (despite the quite complicated matchers in `define_dep_nodes`, none of the other arguments are used).
- Get rid of `rustc_dep_node_append`.

r? `@cjgillot`
2022-09-15 11:54:03 +00:00
Guillaume Gomez
d3529ceb6c Correctly handle parens 2022-09-15 13:53:20 +02:00
bors
00fcc82df2 Auto merge of #101811 - flip1995:clippyup, r=flip1995
Clippy pre beta branch fix

Before beta is branched on Friday, I want to move the `unused_peekable` lint  that was added in this release cycle (1.65) to `nursery`. This lint was already reported twice (https://github.com/rust-lang/rust-clippy/issues/9456, https://github.com/rust-lang/rust-clippy/issues/9462) in a short time, so it is probably a good idea to fix it before it hits beta and then stable.

r? `@Manishearth`
2022-09-15 08:53:51 +00:00
yukang
98e20c097c fix #101797: Suggest associated const for incorrect use of let in traits 2022-09-15 16:15:38 +08:00
bors
0a27ac1611 Auto merge of #101838 - matthiaskrgr:rollup-d1nm6b3, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #100415 (Add BE8 support)
 - #101559 (Adding "backtrace off" option for fuchsia targets)
 - #101740 (Adding ignore-fuchsia arg to non-applicable compiler ui tests)
 - #101778 (rustdoc: clean up DOM by removing `.dockblock-short p`)
 - #101786 (Tidy will not check coding style in bootstrap/target)
 - #101810 (Constify `PartialEq` for `Ordering`)
 - #101812 (rustdoc: clean up CSS `#titles` using flexbox)
 - #101820 (rustdoc: remove no-op rule `a { background: transparent }`)
 - #101828 (Add test for #101743)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-15 06:12:39 +00:00