Commit Graph

209208 Commits

Author SHA1 Message Date
Matthias Krüger
61c6cdb5f4
Rollup merge of #103915 - chenyukang:yukang/fix-103874, r=lcnr
Improve use of ErrorGuaranteed and code cleanup

Part of #103874
2022-11-04 06:40:32 +01:00
Matthias Krüger
47bf74302b
Rollup merge of #103912 - flba-eb:doc_adding_tier3_target, r=davidtwco
Add howto for adding new targets

When new targets are added, often a reviewer finds out that e.g. the target-3-tier-policy is not filled out (missing), there is no description etc.
This change adds a description of what I've learned while working on #102701. It should make reviews easier in the future with less rework.

r? compiler-team
2022-11-04 06:40:32 +01:00
Matthias Krüger
a81a531210
Rollup merge of #103905 - notriddle:notriddle/sidebar-elems-background, r=GuillaumeGomez
rustdoc: remove redundant mobile CSS `.sidebar-elems { background }`

The exact same background is already set for its parent, the `nav.sidebar`.
2022-11-04 06:40:31 +01:00
Matthias Krüger
6e582cadc3
Rollup merge of #103892 - compiler-errors:afit-rustdoc, r=GuillaumeGomez
Properly render asyncness for trait fns without default body

We weren't properly desugaring async fns in traits unless they had default bodies (in which case rustdoc treats them much like they came from an impl).

cc ```@yoshuawuyts``` should help with https://rust-lang.zulipchat.com/#narrow/stream/330606-wg-async.2Fasync-fn-in-trait-impl/topic/type.20inside.20.60async.20fn.60.20body.20must.20be.20known.20in.20this.20context/near/306894869
2022-11-04 06:40:31 +01:00
Matthias Krüger
14fdfcb38c
Rollup merge of #103884 - spastorino:visit-fn-ret-ty-intravisit, r=compiler-errors
Add visit_fn_ret_ty to hir intravisit

I'm working on some RPITIT changes and I need to specialize `visit_fn_ret_ty` in my visitor impl. So I guess it's better to land it separately.

r? `@compiler-errors`
2022-11-04 06:40:31 +01:00
Matthias Krüger
a5efeb3ea7
Rollup merge of #103825 - Mark-Simulacrum:fix-relnotes, r=pietroalbini
Remove let_underscore_must_use from list of uplifted lints

Per https://internals.rust-lang.org/t/rust-1-65-0-pre-release-testing/17660/2

We probably won't backport this (not worth rebuilding stable artifacts over it) but still should be fixed.
2022-11-04 06:40:30 +01:00
bors
6718ea1cff Auto merge of #101834 - compiler-errors:super-deduce-closure-sig, r=lcnr
Elaborate supertrait obligations when deducing closure signatures

We elaborate the supertrait obligations of any registered predicates for a closure to see if we can infer a closure signature.

This is not as general of a fix as it *could* be, since we just elaborate supertrait bounds instead of doing a theoretical walk of _all_ registered predicates that might cause us to deduce `Fn` trait information for a closure infer var. I don't even know how to come up with an example that fails here but would work with a more general system.

Fixes #23012
Also fixes the existing compile failure in #57611

r? `@ghost` for now until I do a perf run
cc `@nikomatsakis` since you commented on https://github.com/rust-lang/rust/issues/23012#issuecomment-1152397290
2022-11-04 00:51:37 +00:00
bors
215e3cd218 Auto merge of #103922 - Mark-Simulacrum:revert-cargo, r=Mark-Simulacrum
Revert "Update cargo"

This reverts commit 331aa45093.

This Cargo upgrade introduced a regression into dependency resolution, so reverting the upgrade until we can fix that.

cc https://github.com/rust-lang/rust/pull/103860,
https://rust-lang.zulipchat.com/#narrow/stream/247081-t-compiler.2Fperformance/topic/cargo.20and.20rustc.20benchmarks.20broken
2022-11-03 21:37:05 +00:00
Michael Goulet
bc3516d474 reverse obligations for better diagnostics on multiple conflicting fn bounds 2022-11-03 15:52:39 +00:00
Michael Goulet
caa701e3c1 Elaborate supertrait obligations when deducing closure signature 2022-11-03 15:52:38 +00:00
Michael Goulet
060d4392b1 Make obligations_for_self_ty only return an obligation 2022-11-03 15:52:38 +00:00
Santiago Pastorino
ba18f16e81
Add visit_fn_ret_ty to hir intravisit 2022-11-03 10:41:22 -03:00
Mark Rousskov
634b9f8867 Revert "Update cargo"
This reverts commit 331aa45093.

This Cargo upgrade introduced a regression into dependency resolution,
so reverting the upgrade until we can fix that.
2022-11-03 08:37:45 -04:00
Florian Bartels
87b2110f25 Add howto for adding new targets 2022-11-03 12:10:35 +01:00
bors
160b194295 Auto merge of #103904 - JakobDegen:mir-opt-dash, r=oli-obk
Ban dashes in miropt test file names

Dashes in miropt test file names are annoying - specifically, they cause the test files to not be sorted next to their outputs, which makes it very difficult to tell what goes with what. This PR changes all files to use underscores and adds a blessable tidy check that enforces this.

r? `@jyn514`

This PR is obviously going to bitrot very quickly. Because of this, I'm going to wait at least 48 hours and until review comes back to allow people from `@rust-lang/wg-mir-opt` or elsewhere to lodge complaints if there are any. If not, I'll rebase the branch on Friday afternoon PST and ask that it be `r+`'d with `p=1` at that time.
2022-11-03 09:24:28 +00:00
bors
432b1a4277 Auto merge of #103860 - weihanglo:update-cargo, r=ehuss
Update cargo

14 commits in 7e484fc1a766f56dbc95380f45719698e0c82749..810cbad9a123ad4ee0a55a96171b8f8478ff1c03
2022-10-27 15:20:57 +0000 to 2022-11-02 21:04:31 +0000
- Update curl-sys (rust-lang/cargo#11326)
- Mention fix on build script deadlock (rust-lang/cargo#11325)
- Make cargo forward pre-existing CARGO if set (rust-lang/cargo#11285)
- Clean up workspace dependencies after cargo remove (rust-lang/cargo#11242)
- Update the outdated link for rust-semverver (rust-lang/cargo#11322)
- Fix broken link to compilation entry point (rust-lang/cargo#11317)
- Only remove fingerprints and build script artifacts of the requested package (rust-lang/cargo#10621)
- Newer anyhow features are required (rust-lang/cargo#11316)
- Clean stale git temp files (rust-lang/cargo#11308)
- Report crate size on package and publish (rust-lang/cargo#11270)
- add a note that some warnings (and/or errors) can be auto-fixed (rust-lang/cargo#10989)
- Update libcurl (rust-lang/cargo#11307)
- artifact deps shoud works when target field specified coexists with `optional = true` (rust-lang/cargo#11183)
- Fix singular verb in tests page (rust-lang/cargo#11300)

r? `@ghost`
2022-11-03 06:11:58 +00:00
bors
ce1a7e41f9 Auto merge of #103455 - BlackHoleFox:apple-sim-abi-consistency, r=davidtwco
Fixed consistency of Apple simulator target's ABI

Currently there's a few Apple device simulator targets that are inconsistent since some set `target_abi = "sim"` (the correct thing to do) while a bunch of others don't set anything (`""`). Due to this its very hard to reliability check if some Rust code is running inside a simulator. This changes all of them to do the same thing and set `sim` as their `target_abi`.

The new way to identity a simulator during compilation is as simple as `cfg(all(target_vendor="apple", target_abi = "sim"))` or even `cfg(target_abi = "sim")` being less pedantic about it.

The issues with the current form (and inspiration for this) are also summarized in `@thomcc's` [Tweet](https://twitter.com/at_tcsc/status/1576685244702691328).
2022-11-03 03:07:31 +00:00
yukang
c6d23bdd32 code cleanup 2022-11-03 09:42:34 +08:00
yukang
a21a055ca6 remove 'delay_span_bug' following 'references_error' 2022-11-03 09:22:08 +08:00
bors
96787c45ac Auto merge of #103903 - matthiaskrgr:rollup-r5xcvrp, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #99801 (fix(generic_const_exprs): Fix predicate inheritance for children of opaque types)
 - #103610 (Allow use of `-Clto=thin` with `-Ccodegen-units=1` in general)
 - #103870 (Fix `inferred_kind` ICE)
 - #103875 (Simplify astconv item def id handling)
 - #103886 (rustdoc: Fix merge of attributes for reexports of local items)
 - #103890 (rustdoc: remove unused mobile CSS `.rustdoc { padding-top: 0 }`)

Failed merges:

 - #103884 (Add visit_fn_ret_ty to hir intravisit)

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-03 00:20:08 +00:00
Weihang Lo
331aa45093
Update cargo
14 commits in 7e484fc1a766f56dbc95380f45719698e0c82749..810cbad9a123ad4ee0a55a96171b8f8478ff1c03
2022-10-27 15:20:57 +0000 to 2022-11-02 21:04:31 +0000
- Update curl-sys (rust-lang/cargo#11326)
- Mention fix on build script deadlock (rust-lang/cargo#11325)
- Make cargo forward pre-existing CARGO if set (rust-lang/cargo#11285)
- Clean up workspace dependencies after cargo remove (rust-lang/cargo#11242)
- Update the outdated link for rust-semverver (rust-lang/cargo#11322)
- Fix broken link to compilation entry point (rust-lang/cargo#11317)
- Only remove fingerprints and build script artifacts of the requested package (rust-lang/cargo#10621)
- Newer anyhow features are required (rust-lang/cargo#11316)
- Clean stale git temp files (rust-lang/cargo#11308)
- Report crate size on package and publish (rust-lang/cargo#11270)
- add a note that some warnings (and/or errors) can be auto-fixed (rust-lang/cargo#10989)
- Update libcurl (rust-lang/cargo#11307)
- artifact deps shoud works when target field specified coexists with `optional = true` (rust-lang/cargo#11183)
- Fix singular verb in tests page (rust-lang/cargo#11300)
2022-11-02 23:17:17 +00:00
Jakob Degen
0bd4f76944 Ban dashes in miropt test file names 2022-11-02 15:54:46 -07:00
Michael Howell
68e19aa4ac rustdoc: remove redundant mobile CSS .sidebar-elems { background }
The exact same background is already set for its parent, the `nav.sidebar`.
2022-11-02 15:33:36 -07:00
Matthias Krüger
36d813498c
Rollup merge of #103890 - notriddle:notriddle/mobile-rustdoc-padding-top, r=GuillaumeGomez
rustdoc: remove unused mobile CSS `.rustdoc { padding-top: 0 }`

When this rule was added in dd437ee6ed, as `body { padding-top: 0 }`, the desktop body tag had non-zero top padding. This padding was removed in 135281ed15.

This rule no longer overrides a rule in rustdoc's desktop styles, and also doesn't override the UA stylesheet, since the [HTML standard] has only margin, not padding, on the page body.

[HTML standard]: https://html.spec.whatwg.org/multipage/rendering.html#the-page
2022-11-02 22:06:29 +01:00
Matthias Krüger
88f9f49b47
Rollup merge of #103886 - GuillaumeGomez:local-reexport-doc, r=notriddle
rustdoc: Fix merge of attributes for reexports of local items

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

The problem was that we didn't merge attributes between the the reexport and the item.

r? `@notriddle`
2022-11-02 22:06:28 +01:00
Matthias Krüger
bb201b5d95
Rollup merge of #103875 - oli-obk:ast_conv_simplification, r=spastorino
Simplify astconv item def id handling
2022-11-02 22:06:28 +01:00
Matthias Krüger
5784a038fb
Rollup merge of #103870 - TaKO8Ki:fix-103790, r=fee1-dead
Fix `inferred_kind` ICE

Fixes #103790
2022-11-02 22:06:27 +01:00
Matthias Krüger
0f72a6d617
Rollup merge of #103610 - wesleywiser:thinlto_cgu1, r=michaelwoerister
Allow use of `-Clto=thin` with `-Ccodegen-units=1` in general

The current logic to ignore ThinLTO when `-Ccodegen-units=1` makes sense for local ThinLTO but even in this scenario, a user may still want (non-local) ThinLTO for the purpose of optimizing dependencies into the final crate which is being compiled with 1 CGU.

The previous behavior was even more confusing because if you were generating a binary (`--emit=link`), then you would get ThinLTO but if you asked for LLVM IR or bytecode, then it would silently change to using regular LTO.

With this change, we only override the defaults for local ThinLTO if you ask for a single output such as LLVM IR or bytecode and in all other cases honor the requested LTO setting.

r? `@michaelwoerister`
2022-11-02 22:06:26 +01:00
Matthias Krüger
214d6b6836
Rollup merge of #99801 - Neo-Zhixing:fix/generic_const_exprs_parent_opaque_predicates, r=oli-obk
fix(generic_const_exprs): Fix predicate inheritance for children of opaque types

Fixes #99705

We currently have a special case to perform predicate inheritance when the const item is in the generics. I think we're also going to need this for opaque return types. When evaluating the predicates applied to the associated item, it'll inherit from its parent, the opaque type, which will never have predicates applied. This PR bypass the opaque typed parent and inherit predicates directly from the function itself.
2022-11-02 22:06:26 +01:00
yukang
ab22f5521b change error_reported to use Result instead of an option 2022-11-03 04:57:44 +08:00
bors
5b1304a03b Auto merge of #103846 - Kobzol:revert-103295-ninja, r=cuviper
Revert "ci: Bring back ninja for dist builders"

Reverts rust-lang/rust#103295 because of the perf regression.

r? `@cuviper`
2022-11-02 20:49:03 +00:00
bors
edf0182213 Auto merge of #103888 - Dylan-DPC:rollup-p7gubqj, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #103275 (Update tinystr)
 - #103703 (Gate some parser recovery behind the check)
 - #103774 (Format `dyn Trait` better in `type_name` intrinsic)
 - #103807 (Add tracking issue for `string_extend_from_within`)
 - #103855 (rustdoc: simplify mobile item-table CSS)
 - #103862 (Use `ObligationCtxt` in `fully_normalize`)
 - #103864 (Reorder `walk_` functions in intravisit.rs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-02 17:35:23 +00:00
Michael Goulet
59be515128 Properly render asyncness for traits without default body 2022-11-02 17:33:25 +00:00
Michael Howell
deb6538348 rustdoc: remove unused mobile CSS .rustdoc { padding-top: 0 }
When this rule was added in dd437ee6ed, as
`body { padding-top: 0 }`, the desktop body tag had non-zero top padding.
This padding was removed in 135281ed15.

This rule no longer overrides a rule in rustdoc's desktop styles, and also
doesn't override the UA stylesheet, since the [HTML standard] has only
margin, not padding, on the page body.

[HTML standard]: https://html.spec.whatwg.org/multipage/rendering.html#the-page
2022-11-02 10:10:44 -07:00
Dylan DPC
5a288dc112
Rollup merge of #103864 - smoelius:reorder-walk-functions, r=fee1-dead
Reorder `walk_` functions in intravisit.rs

Reorder the `walk_` functions to match the order of the `visit_` methods. This is a follow up to https://github.com/rust-lang/rust/pull/103692.

Note that there are some oddballs. I put them where I thought made the most sense:
```diff
$ diff \
<(sed -n 's/^.*\<fn visit_\([^(]*\).*$/\1/;T;p' compiler/rustc_hir/src/intravisit.rs) \
<(sed -n 's/^.*\<fn walk_\([^<]*\).*$/\1/;T;p' compiler/rustc_hir/src/intravisit.rs)
1,5d0
< nested_item
< nested_trait_item
< nested_impl_item
< nested_foreign_item
< nested_body
9,10d3
< id
< name
20c13
< array_length
---
> array_len
30a24
> fn_ret_ty
31a26
> fn_kind
41c36
< variant_data
---
> struct_def
46c41
< infer
---
> inf
54d48
< attribute
```

Also, as some weak evidence that i did things correctly, I get the following before and after the change:
```sh
$ sort compiler/rustc_hir/src/intravisit.rs | openssl sha256
SHA256(stdin)= cac13d2545731ef442f318e2b4286490d7ac5494f4ad10c4cf4c5d4f50d21641
```

r? `@fee1-dead`
2022-11-02 22:32:06 +05:30
Dylan DPC
0312935473
Rollup merge of #103862 - compiler-errors:ocx-in-fully-normalize, r=spastorino
Use `ObligationCtxt` in `fully_normalize`

Simplifies the implementation a bit
2022-11-02 22:32:05 +05:30
Dylan DPC
cd9173ec40
Rollup merge of #103855 - notriddle:notriddle/mobile-item-table, r=GuillaumeGomez
rustdoc: simplify mobile item-table CSS

Using flexbox in column direction is needlessly complicated, since no special flex powers are being used here. Just use regular block layout.

This should result in no visible changes.
2022-11-02 22:32:05 +05:30
Dylan DPC
68db106366
Rollup merge of #103807 - H4x5:string-extend-from-within-tracking-issue, r=Dylan-DPC
Add tracking issue for `string_extend_from_within`

Tracking issue: #103806

The original PR didn't create a tracking issue.
2022-11-02 22:32:04 +05:30
Dylan DPC
bbd3a10663
Rollup merge of #103774 - compiler-errors:dyn-trait-in-type-name, r=eholk
Format `dyn Trait` better in `type_name` intrinsic

Noticed this in #103764 (though not related to that PR at all!)

```rust
trait Foo {
    type Bar;
}

fn main() {
    println!(
        "`dyn Fn(i32, i32) -> i32` => `{}`",
        std::any::type_name::<dyn Fn(i32, i32) -> i32>()
    );
    println!(
        "`dyn Foo<Bar = i32> + Send + Sync` => `{}`",
        std::any::type_name::<dyn Foo<Bar = i32> + Send + Sync>()
    );
}
```

```
`dyn Fn(i32, i32) -> i32` => `dyn core::ops::function::Fn<(i32, i32)>+Output = i32`
`dyn Foo<Bar = i32> + Send + Sync` => `dyn playground::Foo+Bar = i32+core::marker::Sync+core::marker::Send`
```

Just reuse `pretty_print_dyn_existential` which already makes an attempt to make its output stable.
2022-11-02 22:32:03 +05:30
Dylan DPC
109f887bf5
Rollup merge of #103703 - Nilstrieb:flag-recovery-1, r=compiler-errors
Gate some parser recovery behind the check

Mainly in `expr.rs`. `may_recover` doesn't do anything useful yet until I implement that on top of #103439.

r? `@compiler-errors`
2022-11-02 22:32:03 +05:30
Dylan DPC
f7110e14b8
Rollup merge of #103275 - Manishearth:tinystrup, r=pnkfelix
Update tinystr

Tinystr has changed a ton since the old version and is much less unsafe, updated some of the dependencies that use it.
2022-11-02 22:32:02 +05:30
Guillaume Gomez
c983bb162c Add regression test for doc of reexport of local items 2022-11-02 17:36:35 +01:00
Guillaume Gomez
1123852d08 Fix merge of attributes for reexports of local items 2022-11-02 17:36:35 +01:00
yukang
7df9d818ab deprecate DelaySpanBugEmitted and use ErrorGuaranteed directly 2022-11-02 23:15:49 +08:00
Oli Scherer
ecea616052 Simplify astconv item def id handling 2022-11-02 12:03:59 +00:00
bors
c0a7612728 Auto merge of #103690 - GuillaumeGomez:visibility-on-demand, r=notriddle
Make rustdoc Item::visibility computed on-demand

This is a take-over of https://github.com/rust-lang/rust/pull/91408.

Helps with https://github.com/rust-lang/rust/issues/90852 (needs to use `ty::Visibility` directly too).

cc `@camelid`
r? `@notriddle`
2022-11-02 10:32:08 +00:00
bors
822f8c22f5 Auto merge of #103649 - petrochenkov:docnotrait, r=GuillaumeGomez
rustdoc: Do not add external traits to the crate in `register_res`

It's not clear why it was done, and apparently it's no longer necessary now.
Such additions are unpredictable for early doc link resolution and would force us to collect all doc links from all external traits.

Fixes https://github.com/rust-lang/rust/issues/103463
2022-11-02 07:47:10 +00:00
Takayuki Maeda
b96ad1c096 return const_error when ty has errors 2022-11-02 14:47:48 +09:00
bors
a876a4df32 Auto merge of #103857 - Manishearth:rollup-709fui6, r=Manishearth
Rollup of 8 pull requests

Successful merges:

 - #103072 (compiletest: set the dylib path when gathering target cfg)
 - #103084 (Derive `Eq` and `Hash` for `ControlFlow`)
 - #103575 (Change #[suggestion_*] attributes to use style="...")
 - #103637 (Use stdio in UWP apps)
 - #103638 (Add `multivalue` target feature to WASM target)
 - #103781 (Detect unused files in `src/test/mir-opt` and error on them in tidy.)
 - #103837 (Migrate sidebar-links-color GUI test to functions)
 - #103839 (Print valid `--print` requests if request is invalid)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-02 04:27:48 +00:00
Michael Goulet
a9881f5213 Use ObligationCtxt in fully_normalize 2022-11-02 00:48:58 +00:00