]> git.lizzy.rs Git - rust.git/log
rust.git
22 months agoRustdoc support
Michael Goulet [Wed, 31 Aug 2022 04:41:20 +0000 (04:41 +0000)]
Rustdoc support

22 months agoImplement projection for ImplTraitPlaceholder
Michael Goulet [Wed, 31 Aug 2022 04:41:16 +0000 (04:41 +0000)]
Implement projection for ImplTraitPlaceholder

22 months agoLower RPITIT to ImplTraitPlaceholder item
Michael Goulet [Wed, 31 Aug 2022 04:03:24 +0000 (04:03 +0000)]
Lower RPITIT to ImplTraitPlaceholder item

22 months agoRPITIT placeholder items
Michael Goulet [Wed, 31 Aug 2022 03:04:44 +0000 (03:04 +0000)]
RPITIT placeholder items

22 months agoAuto merge of #101592 - compiler-errors:rollup-d2fya7z, r=compiler-errors
bors [Thu, 8 Sep 2022 21:45:23 +0000 (21:45 +0000)]
Auto merge of #101592 - compiler-errors:rollup-d2fya7z, r=compiler-errors

Rollup of 7 pull requests

Successful merges:

 - #101423 (Fix hermit warnings)
 - #101499 (Introduce lowering_arena to avoid creating AST nodes on the fly)
 - #101530 (llvm-wrapper: adapt for LLVM API changes)
 - #101554 (rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`)
 - #101580 (rustdoc: remove unused CSS `div.impl-items > div`)
 - #101584 (rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`)
 - #101587 (Make `Debug` impl for `Term` useful)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoRollup merge of #101587 - BoxyUwU:term_debug, r=compiler-errors
Michael Goulet [Thu, 8 Sep 2022 21:41:13 +0000 (14:41 -0700)]
Rollup merge of #101587 - BoxyUwU:term_debug, r=compiler-errors

Make `Debug` impl for `Term` useful

because `Term { ptr: 78942378998734298342, maker: PhantomData, }` does not excel at communicating the necessary information

22 months agoRollup merge of #101584 - notriddle:notriddle/settings-menu, r=GuillaumeGomez
Michael Goulet [Thu, 8 Sep 2022 21:41:12 +0000 (14:41 -0700)]
Rollup merge of #101584 - notriddle:notriddle/settings-menu, r=GuillaumeGomez

rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`

This CSS was added in 5e01ba36c9f1037c4cf3e7421413fc6c41f85d05, and served to override CSS right above it that set a 5px padding for several kinds of buttons in the same toolbar:

https://github.com/rust-lang/rust/blob/5e01ba36c9f1037c4cf3e7421413fc6c41f85d05/src/librustdoc/html/static/css/rustdoc.css#L1400-L1409

The CSS that it overrode is still there, but now it only applies to `#settings-menu > a`, so there's nothing to override.

https://github.com/rust-lang/rust/blob/24d69920201563f0ee7b530f1cda0f171b205cc2/src/librustdoc/html/static/css/rustdoc.css#L1445-L1454

22 months agoRollup merge of #101580 - notriddle:notriddle/div-impl-items-div, r=GuillaumeGomez
Michael Goulet [Thu, 8 Sep 2022 21:41:11 +0000 (14:41 -0700)]
Rollup merge of #101580 - notriddle:notriddle/div-impl-items-div, r=GuillaumeGomez

rustdoc: remove unused CSS `div.impl-items > div`

This was added in 9077d540da944c41678a7129e04e7fc5d7e38582 to override the style on `<div>` tags that were acting as headers. These `<div>` tags were replaced with `<section>` tags in 32f62607c3142dfc9eb56a0bd72dee298ca43358, but this CSS was probably already redundant even then (the headers had already been replaced with real `<h3>` and `<h4>` tags in 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30).

22 months agoRollup merge of #101554 - notriddle:notriddle/implemenation-list-h3-span-in-band...
Michael Goulet [Thu, 8 Sep 2022 21:41:10 +0000 (14:41 -0700)]
Rollup merge of #101554 - notriddle:notriddle/implemenation-list-h3-span-in-band, r=Dylan-DPC

rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`

This was added in 51f26acaea46afd630fbab4ca441748802d20670 to help with the display of an `<h3>` tag that has a `<span class='in-band'>` inside.

The way implementation lists were rendered was changed in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to have `<code class='in-band'>`, making this CSS unused.

Then it was turned into a `<div>` in 9077d540da944c41678a7129e04e7fc5d7e38582 without issue.

Finally, the header itself acquired the `in-band` class in 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30.

22 months agoRollup merge of #101530 - krasimirgg:llvm-16-up, r=cuviper
Michael Goulet [Thu, 8 Sep 2022 21:41:09 +0000 (14:41 -0700)]
Rollup merge of #101530 - krasimirgg:llvm-16-up, r=cuviper

llvm-wrapper: adapt for LLVM API changes

No functional changes intended.

Adapts PassWrapper for a few recent LLVM API changes:
* https://github.com/llvm/llvm-project/commit/e7bac3b9fa739f8d167a390a547068aad1d424a7
* https://github.com/llvm/llvm-project/commit/93600eb50ceeec83c488ded24fa0fd25f997fec6
* https://github.com/llvm/llvm-project/commit/5e38b2a456df6e263a509af60a731cec57310498

Note that `ModuleMemorySanitizerPass` was renamed back to its pre-14 name, `MemorySanitizerPass`, hence the funky `#if LLVM_VERSION_GE(14, 0) && LLVM_VERSION_LT(16, 0)` guard.

Found via our experimental rust + llvm at HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/13290#018315e6-24e1-44c8-b56d-9aad9be11c29

22 months agoRollup merge of #101499 - spastorino:add-lowering-arena, r=oli-obk
Michael Goulet [Thu, 8 Sep 2022 21:41:08 +0000 (14:41 -0700)]
Rollup merge of #101499 - spastorino:add-lowering-arena, r=oli-obk

Introduce lowering_arena to avoid creating AST nodes on the fly

`@oli-obk` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? `@oli-obk` `@cjgillot`

22 months agoRollup merge of #101423 - mkroening:hermit-warnings, r=sanxiyn
Michael Goulet [Thu, 8 Sep 2022 21:41:08 +0000 (14:41 -0700)]
Rollup merge of #101423 - mkroening:hermit-warnings, r=sanxiyn

Fix hermit warnings

This fixes two `unused_imprt` and one `dead_code` warning for hermit.

22 months agoptr: 43276834268743978
Ellen [Thu, 8 Sep 2022 20:09:23 +0000 (21:09 +0100)]
ptr: 43276834268743978

22 months agoAuto merge of #101437 - compiler-errors:erase-normalize-ordering, r=tmandry
bors [Thu, 8 Sep 2022 19:01:39 +0000 (19:01 +0000)]
Auto merge of #101437 - compiler-errors:erase-normalize-ordering, r=tmandry

Normalize before erasing late-bound regions in `equal_up_to_regions`

Normalize erasing regions **first**, before passing the type through a `BottomUpFolder` which erases late-bound regions too.

The root cause of this issue is due to 96d4137deed6c52c6db2dd19568c37d1c160f1e7, which removes a `normalize_erasing_regions` that happens before this call to `equal_up_to_regions`. While reverting that commit might be a fix, I think it was suspicious to be erasing late-bound regions first _then_ normalizing types in the first place in `equal_up_to_regions`.

-----

I am tempted to ask the reviewer to review and `r+` this without a UI test, since the existing issues that I think this fixes are all incredibly difficult to minimize (anything hyper/warp related, given the nature of those libraries :sweat:) or impossible to reproduce locally (the miri test), namely:
* This recently reported issue with tokio + warp: #101430
* This issue from `@RalfJung` about Miri being broken: #101344
* This additional issue reported in a comment by `@tmandry` (issue with fuchsia + hyper): https://github.com/rust-lang/rust/issues/101344#issuecomment-1235974564

I have locally verified that the repro in #101430 is fixed with this PR, but after a couple of hours of attempting to minimize this error and either failing to actually repro the ICE, or being overwhelmed with the number of traits and functions I need to inline into a UI test, I have basically given up. Thoughts are appreciated on how best to handle this.

r? `@oli-obk` who is at the intersection of MIR and types-related stuff who may be able to give advice :sweat_smile:

22 months agorustdoc: remove no-op CSS `#settings-menu { padding: 0 }`
Michael Howell [Thu, 8 Sep 2022 17:33:15 +0000 (10:33 -0700)]
rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`

This CSS was added in 5e01ba36c9f1037c4cf3e7421413fc6c41f85d05, and served to
override CSS right above it that set a 5px padding for several kinds of
buttons in the same toolbar.

The CSS that it overrode is still there, but now it only applies to
`#settings-menu > a`, so there's nothing to override.

22 months agoIntroduce lowering_arena to avoid creating AST nodes on the fly
Santiago Pastorino [Tue, 6 Sep 2022 18:36:13 +0000 (15:36 -0300)]
Introduce lowering_arena to avoid creating AST nodes on the fly

22 months agoAuto merge of #101577 - Dylan-DPC:rollup-l9xw7i7, r=Dylan-DPC
bors [Thu, 8 Sep 2022 15:53:14 +0000 (15:53 +0000)]
Auto merge of #101577 - Dylan-DPC:rollup-l9xw7i7, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #98933 (Opaque types' generic params do not imply anything about their hidden type's lifetimes)
 - #101041 (translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2)
 - #101424 (Adjust and slightly generalize operator error suggestion)
 - #101496 (Allow lower_lifetime_binder receive a closure)
 - #101501 (Allow lint passes to be bound by `TyCtxt`)
 - #101515 (Recover from typo where == is used in place of =)
 - #101545 (Remove unnecessary `PartialOrd` and `Ord`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agorustdoc: remove unused CSS `div.impl-items > div`
Michael Howell [Thu, 8 Sep 2022 15:51:18 +0000 (08:51 -0700)]
rustdoc: remove unused CSS `div.impl-items > div`

This was added in 9077d540da944c41678a7129e04e7fc5d7e38582 to override the
style on `<div>` tags that were acting as headers. These `<div>` tags were
replaced with `<section>` tags in 32f62607c3142dfc9eb56a0bd72dee298ca43358,
but this CSS was probably already redundant even then (the headers had
already been replaced with real `<h3>` and `<h4>` tags in
76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30).

22 months agoRollup merge of #101545 - TaKO8Ki:remove-unnecessary-partialord-ord, r=oli-obk
Dylan DPC [Thu, 8 Sep 2022 15:18:38 +0000 (20:48 +0530)]
Rollup merge of #101545 - TaKO8Ki:remove-unnecessary-partialord-ord, r=oli-obk

Remove unnecessary `PartialOrd` and `Ord`

22 months agoRollup merge of #101515 - chenyukang:fix-101477, r=fee1-dead
Dylan DPC [Thu, 8 Sep 2022 15:18:37 +0000 (20:48 +0530)]
Rollup merge of #101515 - chenyukang:fix-101477, r=fee1-dead

Recover from typo where == is used in place of =

Fixes #101477

22 months agoRollup merge of #101501 - Jarcho:tcx_lint_passes, r=davidtwco
Dylan DPC [Thu, 8 Sep 2022 15:18:36 +0000 (20:48 +0530)]
Rollup merge of #101501 - Jarcho:tcx_lint_passes, r=davidtwco

Allow lint passes to be bound by `TyCtxt`

This will allow storing things like `Ty<'tcx>` inside late lint passes. It's already possible to store various id types so they're already implicitly bound to a specific `TyCtxt`.

r? rust-lang/compiler

22 months agoRollup merge of #101496 - spastorino:lower_lifetime_binder_api_changes, r=oli-obk
Dylan DPC [Thu, 8 Sep 2022 15:18:36 +0000 (20:48 +0530)]
Rollup merge of #101496 - spastorino:lower_lifetime_binder_api_changes, r=oli-obk

Allow lower_lifetime_binder receive a closure

``@oli-obk`` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? ``@oli-obk`` ``@cjgillot``

22 months agoRollup merge of #101424 - compiler-errors:operator-err-sugg, r=TaKO8Ki
Dylan DPC [Thu, 8 Sep 2022 15:18:34 +0000 (20:48 +0530)]
Rollup merge of #101424 - compiler-errors:operator-err-sugg, r=TaKO8Ki

Adjust and slightly generalize operator error suggestion

(in no particular order)
* Stop passing around a whole extra `ProjectionPredicate`
* Add spaces around `=` in `Trait<..., Output = Ty>` suggestion
* Some code clean-ups, including
    * add `lang_item_for_op` to turn a `Op` into a `DefId`
    * avoid `SourceMap` because we don't really need to render an expr
    * Remove `TypeParamVisitor` in favor of just checking `ty.has_param_types_or_consts` -- this acts a bit differently, but shouldn't cause erroneous suggestions (actually might generalize them a bit)
* We now suggest `Output = Ty` in the `where` clause suggestion when we fail to add `Struct<T>` and `T`.

I can split this out into more PRs if needed, but they're all just miscellaneous generalizations, changes, and nitpicks I saw when messing with this operator code.

22 months agoRollup merge of #101041 - LuisCardosoOliveira:translation-rename-attr-warning-pt2...
Dylan DPC [Thu, 8 Sep 2022 15:18:34 +0000 (20:48 +0530)]
Rollup merge of #101041 - LuisCardosoOliveira:translation-rename-attr-warning-pt2, r=davidtwco

translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2

# Description

This is the second part of the `rustc_session` [migration](https://github.com/rust-lang/rust/issues/100717#issuecomment-1220279883).

**Please only review this [commit](https://github.com/rust-lang/rust/pull/101041/commits/501858195734ec77f6b121ef753b03c40645df23) that belongs to the part 2. The other ones are from the PR [#100753](https://github.com/rust-lang/rust/pull/100753) that is not yet merged.**

In this PR, we migrate the files `session.rs` and `config.rs`.

Please not that we have to `allow` the lints rules in some functions from `session.rs` because they are (at least I believe) part of the diagnostic machinery.

22 months agoRollup merge of #98933 - oli-obk:opaque_type_late_bound_lifetimes, r=lcnr
Dylan DPC [Thu, 8 Sep 2022 15:18:34 +0000 (20:48 +0530)]
Rollup merge of #98933 - oli-obk:opaque_type_late_bound_lifetimes, r=lcnr

Opaque types' generic params do not imply anything about their hidden type's lifetimes

fixes #97104

cc ```@aliemjay```

22 months agoAuto merge of #101467 - nnethercote:shrink-hir-Ty-Pat, r=spastorino
bors [Thu, 8 Sep 2022 13:11:57 +0000 (13:11 +0000)]
Auto merge of #101467 - nnethercote:shrink-hir-Ty-Pat, r=spastorino

Shrink `hir::Ty` and `hir::Pat`

r? `@ghost`

22 months agoAuto merge of #98900 - lcnr:region-stuff, r=jackh726
bors [Thu, 8 Sep 2022 10:30:00 +0000 (10:30 +0000)]
Auto merge of #98900 - lcnr:region-stuff, r=jackh726

const_generics: correctly deal with bound variables

removes the hack in `resolve` which was needed because we evaluated constants without caring about their bound variables.

Each commit should be fairly self-contained, even if they build on each other

r? `@jackh726`

22 months agotranslations(rustc_session): migrates two diagnostics in session.rs
Luis Cardoso [Thu, 8 Sep 2022 06:15:37 +0000 (08:15 +0200)]
translations(rustc_session): migrates two diagnostics in session.rs

22 months agobound variables during ctfe are a bug
lcnr [Mon, 4 Jul 2022 17:13:53 +0000 (19:13 +0200)]
bound variables during ctfe are a bug

22 months agodon't evaluate with escaping bound vars
lcnr [Mon, 4 Jul 2022 16:38:35 +0000 (18:38 +0200)]
don't evaluate with escaping bound vars

22 months agostop evaluating constants in `Relate`
lcnr [Mon, 4 Jul 2022 16:25:37 +0000 (18:25 +0200)]
stop evaluating constants in `Relate`

22 months agogeneralize: no need to cache errors
lcnr [Mon, 4 Jul 2022 13:35:21 +0000 (15:35 +0200)]
generalize: no need to cache errors

22 months agoClarify some diagnostic messages
Oli Scherer [Thu, 25 Aug 2022 10:30:46 +0000 (10:30 +0000)]
Clarify some diagnostic messages

22 months agoUncomment unsound code example
Oli Scherer [Thu, 25 Aug 2022 10:23:22 +0000 (10:23 +0000)]
Uncomment unsound code example

22 months agoOpaque types' generic params do not imply anything about their hidden type's lifetimes
Oli Scherer [Tue, 5 Jul 2022 13:56:51 +0000 (13:56 +0000)]
Opaque types' generic params do not imply anything about their hidden type's lifetimes

22 months agoAuto merge of #101560 - Dylan-DPC:rollup-8m8yr89, r=Dylan-DPC
bors [Thu, 8 Sep 2022 08:00:57 +0000 (08:00 +0000)]
Auto merge of #101560 - Dylan-DPC:rollup-8m8yr89, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #101153 (Migrate another part of rustc_infer to session diagnostic)
 - #101399 (Shrink span for bindings with subpatterns.)
 - #101422 (Hermit: Add File::set_time stub)
 - #101455 (Avoid UB in the Windows filesystem code in... bootstrap?)
 - #101498 (rustc: Parameterize `ty::Visibility` over used ID)
 - #101549 (Use HashStable_Generic in rustc_type_ir)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agofixes #101477: Recover from typo where == is used in place of =
yukang [Wed, 7 Sep 2022 04:26:50 +0000 (12:26 +0800)]
fixes #101477: Recover from typo where == is used in place of =

22 months agotranslations(rustc_session): remove lint allow rule to the methods marked with rustc_...
Luis Cardoso [Mon, 5 Sep 2022 05:58:05 +0000 (07:58 +0200)]
translations(rustc_session): remove lint allow rule to the methods marked with rustc_lint_diagnostic

This commit removes the allows rules for the SessionDiagnostic lint
that were being used in the session.rs file.

Thanks to the PR #101230 we do not need to annotate the methods with
the allow rule as they are part of the diagnostic machinery.

22 months agotranslations(rustc_session): migrate TargetDataLayout::parse
Luis Cardoso [Fri, 2 Sep 2022 17:29:52 +0000 (19:29 +0200)]
translations(rustc_session): migrate TargetDataLayout::parse

22 months agotranslations(rustc_session): migrates session.rs and config.rs
Luis Cardoso [Fri, 26 Aug 2022 14:06:27 +0000 (16:06 +0200)]
translations(rustc_session): migrates session.rs and config.rs

22 months agoRollup merge of #101549 - eholk:type-ir-derive-hashstable_generic, r=jackh726
Dylan DPC [Thu, 8 Sep 2022 06:25:10 +0000 (11:55 +0530)]
Rollup merge of #101549 - eholk:type-ir-derive-hashstable_generic, r=jackh726

Use HashStable_Generic in rustc_type_ir

A lot of the types in this crate implemented HashStable directly to avoid circular dependencies. One way around that is to use HashStable_Generic. We adopt that here to avoid a lot of boilerplate.

This doesn't update all the types, because some would require `I: Interner + HashStable`.

r? `@cjgillot`

22 months agoRollup merge of #101498 - petrochenkov:visparam, r=cjgillot
Dylan DPC [Thu, 8 Sep 2022 06:25:09 +0000 (11:55 +0530)]
Rollup merge of #101498 - petrochenkov:visparam, r=cjgillot

rustc: Parameterize `ty::Visibility` over used ID

It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.

22 months agoRollup merge of #101455 - thomcc:why-is-this-here, r=jyn514
Dylan DPC [Thu, 8 Sep 2022 06:25:08 +0000 (11:55 +0530)]
Rollup merge of #101455 - thomcc:why-is-this-here, r=jyn514

Avoid UB in the Windows filesystem code in... bootstrap?

This basically a subset of the changes from https://github.com/rust-lang/rust/pull/101171. I didn't think to look in src/bootstrap for more windows filesystem API usage, which was apparently a mistake on my part. It's kinda goofy that stuff like this is in here, but what are you gonna do, computers are awful.

I also added `winbase` to the `winapi` dep -- I tested this in a tmp crate but needed to add this to your Cargo.toml -- you `use winapi::stuff::winbase` in this function, but are relying on something else turning on that feature.

22 months agoRollup merge of #101422 - mkroening:hermit-file-time, r=joshtriplett
Dylan DPC [Thu, 8 Sep 2022 06:25:07 +0000 (11:55 +0530)]
Rollup merge of #101422 - mkroening:hermit-file-time, r=joshtriplett

Hermit: Add File::set_time stub

This is not supported on hermit yet. This change is required for compiling std.

22 months agoRollup merge of #101399 - cjgillot:borrowck-binding-span, r=estebank
Dylan DPC [Thu, 8 Sep 2022 06:25:06 +0000 (11:55 +0530)]
Rollup merge of #101399 - cjgillot:borrowck-binding-span, r=estebank

Shrink span for bindings with subpatterns.

Bindings with nested patterns (`binding @ pat` syntax) currently point to the full pattern.  This PR proposes to shrink the span to stop before the ````@`.```  This makes the diagnostics for move/mutability conflicts clearer, as they not point to the `binding` only, instead of the full pat.

r? ```@estebank```

22 months agoRollup merge of #101153 - IntQuant:issue-100717-infer-2, r=davidtwco
Dylan DPC [Thu, 8 Sep 2022 06:25:06 +0000 (11:55 +0530)]
Rollup merge of #101153 - IntQuant:issue-100717-infer-2, r=davidtwco

Migrate another part of rustc_infer to session diagnostic

Probably will migrate another file before marking this one as ready-to-merge.

`@rustbot` label +A-translation
r? rust-lang/diagnostics
cc https://github.com/rust-lang/rust/issues/100717

22 months agoIntroduce `DotDotPos`.
Nicholas Nethercote [Thu, 1 Sep 2022 03:29:57 +0000 (13:29 +1000)]
Introduce `DotDotPos`.

This shrinks `hir::Pat` from 88 to 72 bytes.

22 months agoArena-allocate `hir::Lifetime`.
Nicholas Nethercote [Thu, 1 Sep 2022 02:06:48 +0000 (12:06 +1000)]
Arena-allocate `hir::Lifetime`.

This shrinks `hir::Ty` from 72 to 48 bytes.

`visit_lifetime` is added to the HIR stats collector because these types
are now stored in memory on their own, instead of being within other
types.

22 months agoAuto merge of #101504 - lqd:rust-lld-fix, r=petrochenkov
bors [Thu, 8 Sep 2022 05:02:32 +0000 (05:02 +0000)]
Auto merge of #101504 - lqd:rust-lld-fix, r=petrochenkov

Fix `-Zgcc-ld=lld`

`-Zgcc-ld=lld` is currently broken. CI is currently ignoring its tests.

cc `@Mark-Simulacrum` on the `compiletest` change: I'm not sure which of `bootstrap`'s test step or `compiletest` is currently incorrect wrt windows' `--compile-lib-path`. Since `sysroot/bin` is passed on windows, that means that `compiletest` can't find `rust-lld` on windows and tests are currently ignored: it's looking for something that is in `sysroot/lib` instead.

They are currently ignored on unixes for a different reason: the lld wrapper has a different name than what is checked.

(I've changed `compiletest` in this PR, just because I could make a very targeted change there, whereas completely changing the intentional lib path that is passed seemed it'd have wider reaching implications on all tests.)

And in both unix/win cases, I've changed the detection to look for `rust-lld` rather than the wrappers in `bin/gcc-ld/`. It seems like the more stable of all these executable names.

r? `@petrochenkov`

I've tested the `lld-wrapper` change on linux and osx, but couldn't test on windows gnu targets (I only have MSVC targets, and these can't use `rust-lld` via `-Zgcc-ld=lld`, nor do they use the lld wrapper IIUC).

I'd expect it to work whether or not the wrapper is called with or without an executable suffix. But at least now CI should test it in these targets.

Fixes #101370.

22 months agoAuto merge of #101303 - jyn514:jnelson/handle-cycle-enum, r=cjgillot
bors [Thu, 8 Sep 2022 02:21:16 +0000 (02:21 +0000)]
Auto merge of #101303 - jyn514:jnelson/handle-cycle-enum, r=cjgillot

Make `HandleCycleError` an enum instead of a macro-generated closure

Helps with https://github.com/rust-lang/rust/issues/96524. Based on https://github.com/rust-lang/rust/pull/100943 to avoid merge conflicts, so it looks larger than it is (only the last commit is relevant).

cc https://rust-lang.zulipchat.com/#narrow/stream/241847-t-compiler.2Fwg-incr-comp/topic/Moving.20.60Value.60.20to.20rustc_query_system.20.2396524

r? `@cjgillot`

22 months agoAdjust spacing in suggestion, add a test
Michael Goulet [Sun, 4 Sep 2022 22:38:12 +0000 (22:38 +0000)]
Adjust spacing in suggestion, add a test

22 months agoAdd associated item binding to non-param-ty where clause suggestions
Michael Goulet [Sun, 4 Sep 2022 22:21:15 +0000 (22:21 +0000)]
Add associated item binding to non-param-ty where clause suggestions

22 months agoRemove TypeParamVisitor
Michael Goulet [Sun, 4 Sep 2022 21:55:38 +0000 (21:55 +0000)]
Remove TypeParamVisitor

22 months agoSimplify printing operator lang item paths in error message
Michael Goulet [Sun, 4 Sep 2022 21:35:13 +0000 (21:35 +0000)]
Simplify printing operator lang item paths in error message

22 months agoAvoid source-map call in operator error
Michael Goulet [Sun, 4 Sep 2022 21:11:50 +0000 (21:11 +0000)]
Avoid source-map call in operator error

22 months agorustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`
Michael Howell [Thu, 8 Sep 2022 00:51:18 +0000 (17:51 -0700)]
rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`

This was added in 51f26acaea46afd630fbab4ca441748802d20670 to help with the
display of an `<h3>` tag that has a `<span class='in-band'>` inside.

The way implementation lists were rendered was changed in
34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to have `<code class='in-band'>`,
making this CSS unused.

Then it was turned into a `<div>` in 9077d540da944c41678a7129e04e7fc5d7e38582
without issue.

Finally, the header itself acquired the `in-band` class in
76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30.

22 months agoAuto merge of #94075 - mikebenfield:wip-enum, r=oli-obk
bors [Wed, 7 Sep 2022 23:40:06 +0000 (23:40 +0000)]
Auto merge of #94075 - mikebenfield:wip-enum, r=oli-obk

Use niche-filling optimization even when multiple variants have data.

Fixes #46213

22 months agoUse HashStable_Generic in rustc_type_ir
Eric Holk [Wed, 7 Sep 2022 21:46:04 +0000 (14:46 -0700)]
Use HashStable_Generic in rustc_type_ir

A lot of the types in this crate implemented HashStable directly to
avoid circular dependencies. One way around that is to use
HashStable_Generic. We adopt that here to avoid a lot of boilerplate.

This doesn't update all the types, because some would require
`I: Interner + HashStable`.

22 months agoAuto merge of #101544 - matthiaskrgr:rollup-4urx917, r=matthiaskrgr
bors [Wed, 7 Sep 2022 21:17:30 +0000 (21:17 +0000)]
Auto merge of #101544 - matthiaskrgr:rollup-4urx917, r=matthiaskrgr

Rollup of 14 pull requests

Successful merges:

 - #101343 (Add -api-level to pm command)
 - #101416 (stdio: Document no support for writing to non-blocking stdio/stderr)
 - #101435 (Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH`)
 - #101493 (Pass ImplTraitContext as &mut to avoid the need of ImplTraitContext::reborrow)
 - #101502 (Do not suggest a semicolon for a macro without `!`)
 - #101503 (Add debug calls)
 - #101506 (rustdoc: remove unused CSS `#main-content > .since`)
 - #101507 (rustdoc: remove unused CSS `#main-content > table td`)
 - #101521 (Rustdoc-Json: More accurate struct type.)
 - #101525 (Fix typo in pass_manager.rs)
 - #101534 (rustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`)
 - #101535 (Fix error printing mistake in tidy)
 - #101536 (Add documentation for Attr::is_doc_comment)
 - #101538 (rustdoc: remove unused CSS `.content .methods > div`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

22 months agoremove unnecessary `PartialOrd` and `Ord`
Takayuki Maeda [Wed, 7 Sep 2022 21:15:33 +0000 (06:15 +0900)]
remove unnecessary `PartialOrd` and `Ord`

22 months agoAllow lower_lifetime_binder receive a closure
Santiago Pastorino [Thu, 18 Aug 2022 17:26:59 +0000 (14:26 -0300)]
Allow lower_lifetime_binder receive a closure

22 months agoUse niche-filling optimization even when multiple variants have data.
Michael Benfield [Tue, 8 Mar 2022 19:07:01 +0000 (19:07 +0000)]
Use niche-filling optimization even when multiple variants have data.

Fixes #46213

22 months agoChange name of "dataful" variant to "untagged"
Michael Benfield [Thu, 25 Aug 2022 01:14:23 +0000 (01:14 +0000)]
Change name of "dataful" variant to "untagged"

This is in anticipation of a new enum layout, in which the niche
optimization may be applied even when multiple variants have data.

22 months agoRollup merge of #101538 - notriddle:notriddle/content-methods-div, r=GuillaumeGomez
Matthias Krüger [Wed, 7 Sep 2022 19:48:23 +0000 (21:48 +0200)]
Rollup merge of #101538 - notriddle:notriddle/content-methods-div, r=GuillaumeGomez

rustdoc: remove unused CSS `.content .methods > div`

This selector has its roots in these commits:

  * current version:

    `.content .methods > div:not(.notable-traits):not(.method)` from 9077d540da944c41678a7129e04e7fc5d7e38582

  * intermediate version:

    `.content .methods > div:not(.important-traits)` from d86621f69e827361e47bc6c4b2c7fd5319155227

  * original version:

    `.content .methods > div { margin-left: 40px; }` from 0a46933c4d81573e78ce16cd215ba155a3114fce

Based on the call stack, where [`class='methods'`] calls `trait_item` and [`trait_item`] calls [`document`], this div selector was probably intended to target docblock and stability tags.

In the current version of the code, neither of these can possibly be nested directly below the `class='methods'` wrapper, because the [current version of the `trait_item` function] always wraps them in a `<details>` tag if they exist. The only div tag that can possibly be nested directly below it now is the one with class `method`, which is explicitly excluded.

[`class='methods'`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1811-L1842

[`trait_item`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1807

[`document`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1515-L1523

[current version of the `trait_item` function]: https://github.com/rust-lang/rust/blob/e7c7aa7288559f8e5ea7ce3543ff946b09783628/src/librustdoc/html/render/print_item.rs#L710

22 months agoRollup merge of #101536 - GuillaumeGomez:is_doc_comment-doc, r=lqd
Matthias Krüger [Wed, 7 Sep 2022 19:48:23 +0000 (21:48 +0200)]
Rollup merge of #101536 - GuillaumeGomez:is_doc_comment-doc, r=lqd

Add documentation for Attr::is_doc_comment

The function name is very misleading, some explanations won't hurt.

r? `@lqd`

22 months agoRollup merge of #101535 - est31:tidy_error_fix, r=Mark-Simulacrum
Matthias Krüger [Wed, 7 Sep 2022 19:48:22 +0000 (21:48 +0200)]
Rollup merge of #101535 - est31:tidy_error_fix, r=Mark-Simulacrum

Fix error printing mistake in tidy

Fixes a small bug in the error printing code added by #100591 .

22 months agoRollup merge of #101534 - rust-lang:notriddle/rustdoc-flex-direction, r=GuillaumeGomez
Matthias Krüger [Wed, 7 Sep 2022 19:48:21 +0000 (21:48 +0200)]
Rollup merge of #101534 - rust-lang:notriddle/rustdoc-flex-direction, r=GuillaumeGomez

rustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`

According to MDN, [flex-direction] only applies to [flex containers], which are boxes with `display: flex` or `inline-flex`.

However, the `.rustdoc` body container is not a flex-container on mobile. A few lines above, it's set to `display: block`, so this selector does not have any effect.

[flex-direction]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction

[flex containers]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox#the_flex_container

22 months agoRollup merge of #101525 - eltociear:patch-16, r=cjgillot
Matthias Krüger [Wed, 7 Sep 2022 19:48:20 +0000 (21:48 +0200)]
Rollup merge of #101525 - eltociear:patch-16, r=cjgillot

Fix typo in pass_manager.rs

overriden -> overridden

22 months agoRollup merge of #101521 - aDotInTheVoid:rdj-structkind, r=GuillaumeGomez
Matthias Krüger [Wed, 7 Sep 2022 19:48:19 +0000 (21:48 +0200)]
Rollup merge of #101521 - aDotInTheVoid:rdj-structkind, r=GuillaumeGomez

Rustdoc-Json: More accurate struct type.

Closes #101489

r? `@GuillaumeGomez`

22 months agoRollup merge of #101507 - notriddle:notriddle/main-content-table-td, r=GuillaumeGomez
Matthias Krüger [Wed, 7 Sep 2022 19:48:18 +0000 (21:48 +0200)]
Rollup merge of #101507 - notriddle:notriddle/main-content-table-td, r=GuillaumeGomez

rustdoc: remove unused CSS `#main-content > table td`

This rule was added in 4e2c59a970695b2809a0f68f2ffe415ebdb04913 to benefit the module items table. However, the module items table stopped using table tags when 6020c79ddeafe8d9760b27c14c39da81bac9b4a6 switched us over to grid layout.

You can see when this one used to be triggered by visiting <https://doc.rust-lang.org/1.54.0/alloc/slice/index.html#structs-1> in a very narrow window, but it doesn't any more, because the module table is now rendered using `<div>` tags.

22 months agoRollup merge of #101506 - notriddle:notriddle/rustdoc-main-since-2, r=GuillaumeGomez
Matthias Krüger [Wed, 7 Sep 2022 19:48:17 +0000 (21:48 +0200)]
Rollup merge of #101506 - notriddle:notriddle/rustdoc-main-since-2, r=GuillaumeGomez

rustdoc: remove unused CSS `#main-content > .since`

I missed one from #101298

22 months agoRollup merge of #101503 - spastorino:add-debug-calls, r=compiler-errors
Matthias Krüger [Wed, 7 Sep 2022 19:48:16 +0000 (21:48 +0200)]
Rollup merge of #101503 - spastorino:add-debug-calls, r=compiler-errors

Add debug calls

`@oli-obk` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? `@oli-obk` `@cjgillot`

22 months agoRollup merge of #101502 - TaKO8Ki:do-not-suggest-semicolon-for-macro-without-exclamat...
Matthias Krüger [Wed, 7 Sep 2022 19:48:15 +0000 (21:48 +0200)]
Rollup merge of #101502 - TaKO8Ki:do-not-suggest-semicolon-for-macro-without-exclamation-mark, r=wesleywiser

Do not suggest a semicolon for a macro without `!`

Fixes a regression in #101490

22 months agoRollup merge of #101493 - spastorino:borrow-mut-impl-trait-context, r=oli-obk
Matthias Krüger [Wed, 7 Sep 2022 19:48:14 +0000 (21:48 +0200)]
Rollup merge of #101493 - spastorino:borrow-mut-impl-trait-context, r=oli-obk

Pass ImplTraitContext as &mut to avoid the need of ImplTraitContext::reborrow

`@oli-obk` requested this and other changes as a way of simplifying #101345. This is just going to make the diff of #101345 smaller.

r? `@oli-obk` `@cjgillot`

22 months agoRollup merge of #101435 - JakobDegen:bitwidth-tests, r=wesleywiser
Matthias Krüger [Wed, 7 Sep 2022 19:48:13 +0000 (21:48 +0200)]
Rollup merge of #101435 - JakobDegen:bitwidth-tests, r=wesleywiser

Remove unnecessary `EMIT_MIR_FOR_EACH_BITWIDTH`

This commit removes the annotation only for those tests where the 32 bit and 64 bit files were exactly identical. I didn't touch anything in the `mir-opt/const` directory, since having this annotation there seems more principled, even if it doesn't make a difference.

This also removes four additional files related to the `separate_const_switch.rs` test. The associated annotations were removed in #100827 , but I forgot to remove the files as well. (#97564 is the issue tracking an automated check here)

r? ```@wesleywiser```

22 months agoRollup merge of #101416 - uarif1:doc_non_blocking_stdio, r=joshtriplett
Matthias Krüger [Wed, 7 Sep 2022 19:48:12 +0000 (21:48 +0200)]
Rollup merge of #101416 - uarif1:doc_non_blocking_stdio, r=joshtriplett

stdio: Document no support for writing to non-blocking stdio/stderr

Printing to stdio/stderr that have been opened with non-blocking
(O_NONBLOCK in linux) can result in an error, which is not handled
by std::io module causing a panic.

Signed-off-by: Usama Arif <usama.arif@bytedance.com>
22 months agoRollup merge of #101343 - diminishedprime:patch-3, r=tmandry
Matthias Krüger [Wed, 7 Sep 2022 19:48:11 +0000 (21:48 +0200)]
Rollup merge of #101343 - diminishedprime:patch-3, r=tmandry

Add -api-level to pm command

As of ~Aug 30th, `pm build` commands require an `api-level` flag. This flag should match the fuchsia api-level that's being targeted by the code. Since this is dependent on the version of the SDK that's being used, we may want to change this to something a bit more robust in the future.

22 months agoAuto merge of #101476 - ChrisDenton:BCryptRandom-fix, r=thomcc
bors [Wed, 7 Sep 2022 18:54:03 +0000 (18:54 +0000)]
Auto merge of #101476 - ChrisDenton:BCryptRandom-fix, r=thomcc

Open a BCrypt algorithm handle

Fixes #101474, supplants #101456.

Replaces use of a pseduo handle with manually opening a algorithm handle.

Most interesting thing here is the atomics.

r? `@thomcc`

22 months agorustdoc: remove unused CSS `#main-content > table td`
Michael Howell [Tue, 6 Sep 2022 21:47:04 +0000 (14:47 -0700)]
rustdoc: remove unused CSS `#main-content > table td`

This rule was added in 4e2c59a970695b2809a0f68f2ffe415ebdb04913
to benefit the module items table. However, the module items table stopped
using table tags when 6020c79ddeafe8d9760b27c14c39da81bac9b4a6
switched us over to grid layout.

You can see when this one used to be triggered by visiting
<https://doc.rust-lang.org/1.54.0/alloc/slice/index.html#structs-1> in a
very narrow window, but it doesn't any more, because the module table is
now rendered using `<div>` tags.

22 months agoAuto merge of #101522 - oli-obk:miriup, r=oli-obk
bors [Wed, 7 Sep 2022 16:31:39 +0000 (16:31 +0000)]
Auto merge of #101522 - oli-obk:miriup, r=oli-obk

Update miri submodule

fixes #101344

cc `@rust-lang/miri`

r? `@ghost`

22 months agorustdoc: remove unused CSS `.content .methods > div`
Michael Howell [Wed, 7 Sep 2022 15:42:31 +0000 (08:42 -0700)]
rustdoc: remove unused CSS `.content .methods > div`

This selector has its roots in these commits:

  * current version:

    `.content .methods > div:not(.notable-traits):not(.method)` from
    9077d540da944c41678a7129e04e7fc5d7e38582

  * intermediate version:

    `.content .methods > div:not(.important-traits)` from
    d86621f69e827361e47bc6c4b2c7fd5319155227

  * original version:

    `.content .methods > div { margin-left: 40px; }` from
    0a46933c4d81573e78ce16cd215ba155a3114fce

Based on the call stack, where [`class='methods'`] calls `trait_item` and
[`trait_item`] calls [`document`], this div selector was probably intended to
target docblock and stability tags.

In the current version of the code, neither of these can possibly be nested
directly below the `class='methods'` wrapper, because the [current version of
the `trait_item` function] always wraps them in a `<details>` tag if they
exist. The only div tag that can possibly be nested directly below it now is
the one with class `method`, which is explicitly excluded.

[`class='methods'`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1811-L1842

[`trait_item`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1807

[`document`]: https://github.com/rust-lang/rust/blob/0a46933c4d81573e78ce16cd215ba155a3114fce/src/librustdoc/html/render.rs#L1515-L1523

[current version of the `trait_item` function]: https://github.com/rust-lang/rust/blob/e7c7aa7288559f8e5ea7ce3543ff946b09783628/src/librustdoc/html/render/print_item.rs#L710

22 months agoUpdate miri submodule
Oli Scherer [Wed, 7 Sep 2022 08:43:29 +0000 (08:43 +0000)]
Update miri submodule

22 months agoAuto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnr
bors [Wed, 7 Sep 2022 13:49:58 +0000 (13:49 +0000)]
Auto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnr

Shrink `PredicateS`

r? `@ghost`

22 months agoFix error printing mistake in tidy
est31 [Wed, 7 Sep 2022 13:47:44 +0000 (15:47 +0200)]
Fix error printing mistake in tidy

22 months agoFormat hir_id_validator error using pretty print
Santiago Pastorino [Tue, 6 Sep 2022 20:26:05 +0000 (17:26 -0300)]
Format hir_id_validator error using pretty print

22 months agoAdd instrument and debug calls
Santiago Pastorino [Tue, 6 Sep 2022 20:24:36 +0000 (17:24 -0300)]
Add instrument and debug calls

22 months agorustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`
Michael Howell [Wed, 7 Sep 2022 13:42:36 +0000 (06:42 -0700)]
rustdoc: remove unused mobile CSS `.rustdoc { flex-direction }`

According to MDN, [flex-direction] only applies to [flex containers], which
are boxes with `display: flex` or `inline-flex`.

However, the `.rustdoc` body container is not a flex-container on mobile.
A few lines above, it's set to `display: block`, so this selector does
not have any effect.

[flex-direction]: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction

[flex containers]: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox#the_flex_container

22 months agollvm-wrapper: adapt for LLVM API changes
Krasimir Georgiev [Wed, 7 Sep 2022 12:08:06 +0000 (12:08 +0000)]
llvm-wrapper: adapt for LLVM API changes

No functional changes intended.

Adapts PassWrapper for two recent LLVM API changes:
* https://github.com/llvm/llvm-project/commit/e7bac3b9fa739f8d167a390a547068aad1d424a7
* https://github.com/llvm/llvm-project/commit/93600eb50ceeec83c488ded24fa0fd25f997fec6
* https://github.com/llvm/llvm-project/commit/5e38b2a456df6e263a509af60a731cec57310498

22 months agoAdd documentation for Attr::is_doc_comment
Guillaume Gomez [Wed, 7 Sep 2022 13:34:16 +0000 (15:34 +0200)]
Add documentation for Attr::is_doc_comment

22 months agostdio: Document no support for writing to non-blocking stdio/stderr
Usama Arif [Sun, 4 Sep 2022 17:43:18 +0000 (18:43 +0100)]
stdio: Document no support for writing to non-blocking stdio/stderr

Printing to stdio/stderr that have been opened with non-blocking
(O_NONBLOCK in linux) can result in an error, which is not handled
by std::io module causing a panic.

Signed-off-by: Usama Arif <usama.arif@bytedance.com>
22 months agoDon't break windows/rand for miri
Chris Denton [Wed, 7 Sep 2022 12:14:27 +0000 (13:14 +0100)]
Don't break windows/rand for miri

22 months agoignore `-Zgcc-ld=lld` test on msvc
Rémy Rakic [Tue, 6 Sep 2022 21:39:37 +0000 (23:39 +0200)]
ignore `-Zgcc-ld=lld` test on msvc

now that CI correctly detects rust-lld in run-make tests, we ignore this
test since it relies on `-Zgcc-ld=lld` which is not made to work on the
windows-msvc targets: it requires a gcc flavor.

22 months agofix compiletest detection of needs-rust-lld tests
Rémy Rakic [Tue, 6 Sep 2022 15:19:46 +0000 (17:19 +0200)]
fix compiletest detection of needs-rust-lld tests

for both windows and unixes

22 months agofix lld-wrapper lld flavor detection
Rémy Rakic [Tue, 6 Sep 2022 13:54:20 +0000 (15:54 +0200)]
fix lld-wrapper lld flavor detection

22 months agoFix typo in pass_manager.rs
Ikko Ashimine [Wed, 7 Sep 2022 10:32:28 +0000 (19:32 +0900)]
Fix typo in pass_manager.rs

overriden -> overridden

22 months agoAuto merge of #98332 - oli-obk:assume, r=wesleywiser
bors [Wed, 7 Sep 2022 09:47:23 +0000 (09:47 +0000)]
Auto merge of #98332 - oli-obk:assume, r=wesleywiser

Lower the assume intrinsic to a MIR statement

This makes https://github.com/rust-lang/rust/pull/96862#issuecomment-1153739068 easier and will generally allow us to cheaply insert assume intrinsic calls in mir building.

r? rust-lang/wg-mir-opt

22 months agorustc: Parameterize `ty::Visibility` over used ID
Vadim Petrochenkov [Sat, 27 Aug 2022 21:10:06 +0000 (00:10 +0300)]
rustc: Parameterize `ty::Visibility` over used ID

It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.

22 months agoRustdoc-Json: More accurate struct type.
Nixon Enraght-Moony [Wed, 7 Sep 2022 08:37:22 +0000 (09:37 +0100)]
Rustdoc-Json: More accurate struct type.

Closes #101489

22 months agoAuto merge of #101232 - nikic:issue-98294, r=Mark-Simulacrum
bors [Wed, 7 Sep 2022 05:58:29 +0000 (05:58 +0000)]
Auto merge of #101232 - nikic:issue-98294, r=Mark-Simulacrum

Add test for #98294

Add a test to make that the failure condition for this pattern is optimized away.

Fixes #98294.

22 months agoAuto merge of #100801 - Kobzol:track-pgo-profile-paths, r=michaelwoerister
bors [Wed, 7 Sep 2022 03:17:10 +0000 (03:17 +0000)]
Auto merge of #100801 - Kobzol:track-pgo-profile-paths, r=michaelwoerister

Track PGO profiles in depinfo

This PR makes sure that PGO profiles (`-Cprofile-use` and `-Cprofile-sample-use`) are tracked in depinfo, so that when they change, the compilation session will be invalidated.

This approach was discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Tracking.20PGO.20profile.20files.20in.20cargo).

I tried it locally and it seems that the code is recompiled just with this change, and https://github.com/rust-lang/rust/pull/100413 is not even needed. But it's possible that not everything required is recompiled, so we will probably want to land both changes.

Another approach to implement this could be to store the PGO profiles in `sess.parse_sess.file_depinfo` when the session is being created, but then the paths would have to be converted to a string and then to a symbol, which seemed unnecessarily complicated.

CC `@michaelwoerister`

r? `@Eh2406`