]> git.lizzy.rs Git - rust.git/log
rust.git
18 months agoSuggest `collect`ing into `Vec<_>`
Esteban Küber [Sat, 10 Dec 2022 06:31:16 +0000 (22:31 -0800)]
Suggest `collect`ing into `Vec<_>`

18 months agoAuto merge of #105612 - oli-obk:bind_rustdoc, r=GuillaumeGomez
bors [Tue, 13 Dec 2022 13:09:40 +0000 (13:09 +0000)]
Auto merge of #105612 - oli-obk:bind_rustdoc, r=GuillaumeGomez

use ty::Binder in rustdoc instead of `skip_binder`

r? `@GuillaumeGomez`

this is a preliminary cleanup required to be able to normalize correctly/conveniently in rustdoc

18 months agoAuto merge of #105350 - compiler-errors:faster-binder-relate, r=oli-obk
bors [Tue, 13 Dec 2022 07:10:53 +0000 (07:10 +0000)]
Auto merge of #105350 - compiler-errors:faster-binder-relate, r=oli-obk

Fast-path some binder relations

A simpler approach than #104598

Fixes #104583

r? types

18 months agoAuto merge of #105436 - nnethercote:inline-place_contents_drop_state_cannot_differ...
bors [Tue, 13 Dec 2022 03:28:57 +0000 (03:28 +0000)]
Auto merge of #105436 - nnethercote:inline-place_contents_drop_state_cannot_differ, r=spastorino

Inline and remove `place_contents_drop_state_cannot_differ`.

It has a single call site and is hot enough to be worth inlining. And make sure `is_terminal_path` is inlined, too.

r? `@ghost`

18 months agoFast path some binder relations
Michael Goulet [Tue, 6 Dec 2022 04:42:06 +0000 (04:42 +0000)]
Fast path some binder relations

18 months agoAuto merge of #105644 - matthiaskrgr:rollup-qc6hlzq, r=matthiaskrgr
bors [Tue, 13 Dec 2022 00:29:28 +0000 (00:29 +0000)]
Auto merge of #105644 - matthiaskrgr:rollup-qc6hlzq, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #104864 (Account for item-local in inner scope for E0425)
 - #105332 (Point out the type of associated types in every method call of iterator chains)
 - #105620 (Remove unnecessary uses of `clone`)
 - #105625 (minor code cleanups)
 - #105629 (rustdoc: stop treating everything in a trait item as a method)
 - #105636 (Add check for local-storage value when changing "display line numbers" settings)
 - #105639 (rustdoc: remove `type="text/css" from stylesheet links)
 - #105640 (Adjust miri to still be optional)

Failed merges:

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

18 months agoRollup merge of #105640 - lukas-code:miri-beta, r=Mark-Simulacrum
Matthias Krüger [Tue, 13 Dec 2022 00:17:12 +0000 (01:17 +0100)]
Rollup merge of #105640 - lukas-code:miri-beta, r=Mark-Simulacrum

Adjust miri to still be optional

r? `@pietroalbini`

18 months agoRollup merge of #105639 - notriddle:notriddle/text-css, r=GuillaumeGomez
Matthias Krüger [Tue, 13 Dec 2022 00:17:12 +0000 (01:17 +0100)]
Rollup merge of #105639 - notriddle:notriddle/text-css, r=GuillaumeGomez

rustdoc: remove `type="text/css" from stylesheet links

MDN directly recommends this in <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>, since "CSS is the only stylesheet language used on the web."

Like 07a243b2a46384235d7e2c08688978b7cf018973, but a few places that were missed the first time.

18 months agoRollup merge of #105636 - GuillaumeGomez:extend-gui-test, r=notriddle
Matthias Krüger [Tue, 13 Dec 2022 00:17:11 +0000 (01:17 +0100)]
Rollup merge of #105636 - GuillaumeGomez:extend-gui-test, r=notriddle

Add check for local-storage value when changing "display line numbers" settings

r? `@notriddle`

18 months agoRollup merge of #105629 - notriddle:notriddle/method-toggle-trait, r=GuillaumeGomez
Matthias Krüger [Tue, 13 Dec 2022 00:17:11 +0000 (01:17 +0100)]
Rollup merge of #105629 - notriddle:notriddle/method-toggle-trait, r=GuillaumeGomez

rustdoc: stop treating everything in a trait item as a method

This was added in 0b9b4b70683db6ef707755f520f139eb7b92a944 to fix the spacing on trait pages, but stopped being needed because 791f04e5a47ee78951552c7ed1545b2b01a44c74 stopped styling method-toggle. By only putting the method-toggle class on actual methods, the JS setting does the right thing.

18 months agoRollup merge of #105625 - matthiaskrgr:clippy_dec12, r=compiler-errors
Matthias Krüger [Tue, 13 Dec 2022 00:17:10 +0000 (01:17 +0100)]
Rollup merge of #105625 - matthiaskrgr:clippy_dec12, r=compiler-errors

minor code cleanups

r? `@compiler-errors`

18 months agoRollup merge of #105620 - TaKO8Ki:remove-unnecessary-uses-of-clone, r=compiler-errors
Matthias Krüger [Tue, 13 Dec 2022 00:17:10 +0000 (01:17 +0100)]
Rollup merge of #105620 - TaKO8Ki:remove-unnecessary-uses-of-clone, r=compiler-errors

Remove unnecessary uses of `clone`

18 months agoRollup merge of #105332 - estebank:iterator-chains, r=oli-obk
Matthias Krüger [Tue, 13 Dec 2022 00:17:09 +0000 (01:17 +0100)]
Rollup merge of #105332 - estebank:iterator-chains, r=oli-obk

Point out the type of associated types in every method call of iterator chains

Partially address #105184 by pointing out the type of associated types in every method call of iterator chains:

```
note: the expression is of type `Map<std::slice::Iter<'_, {integer}>, [closure@src/test/ui/iterators/invalid-iterator-chain.rs:12:18: 12:21]>`
    --> src/test/ui/iterators/invalid-iterator-chain.rs:12:14
     |
10   |         vec![0, 1]
     |         ---------- this expression has type `Vec<{integer}>`
11   |             .iter()
     |              ------ associated type `std::iter::Iterator::Item` is `&{integer}` here
12   |             .map(|x| { x; })
     |              ^^^^^^^^^^^^^^^ associated type `std::iter::Iterator::Item` is `()` here
```

We also reduce the number of impls we mention when any of the candidates is an "exact match". This benefits the output of cases with numerics greatly.

Outstanding work would be to provide a structured suggestion for appropriate changes, like in this case detecting the spurious `;` in the closure.

18 months agoRollup merge of #104864 - chenyukang:yukang/fix-104700-binding, r=estebank
Matthias Krüger [Tue, 13 Dec 2022 00:17:08 +0000 (01:17 +0100)]
Rollup merge of #104864 - chenyukang:yukang/fix-104700-binding, r=estebank

Account for item-local in inner scope for E0425

Fixes #104700

18 months agoAdjust miri to still be optional
Mark Rousskov [Tue, 1 Nov 2022 00:52:55 +0000 (20:52 -0400)]
Adjust miri to still be optional

We don't distribute a miri build for beta/stable so it needs to be kept
optional. In the future it likely makes sense to switch the miri
*artifacts* to always be built, but the rustup component to not be
included -- this will avoid some of this pain.

18 months agorustdoc: remove `type="text/css" from stylesheet links
Michael Howell [Mon, 12 Dec 2022 22:17:49 +0000 (15:17 -0700)]
rustdoc: remove `type="text/css" from stylesheet links

MDN directly recommends this in <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>,
since "CSS is the only stylesheet language used on the web."

Like 07a243b2a46384235d7e2c08688978b7cf018973, but a few places that were
missed the first time.

18 months agoAdd check for local-storage value when changing "display line numbers" settings
Guillaume Gomez [Mon, 12 Dec 2022 21:49:19 +0000 (22:49 +0100)]
Add check for local-storage value when changing "display line numbers" settings

18 months agoAuto merge of #105622 - matthiaskrgr:rollup-a6i81q7, r=matthiaskrgr
bors [Mon, 12 Dec 2022 21:34:28 +0000 (21:34 +0000)]
Auto merge of #105622 - matthiaskrgr:rollup-a6i81q7, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #104405 (1.66.0 release notes)
 - #105561 (Normalize receiver substs and erase the regions)
 - #105593 (Fix typo in comment: length_limit)
 - #105597 (Correct typos in `core::sync::Exclusive::get_{pin_mut, mut}`)
 - #105614 (delete mentions of type ascription from lint descriptions)
 - #105615 (Fixup method doc that mentions removed param)
 - #105616 (Add a "the" to proc_macro documentation)
 - #105619 (rustdoc: remove no-op CSS `.source pre { overflow: auto }`)

Failed merges:

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

18 months agoDo not `skip_binder`s
Esteban Küber [Mon, 12 Dec 2022 19:53:39 +0000 (11:53 -0800)]
Do not `skip_binder`s

18 months agorustdoc: stop treating everything in a trait item as a method
Michael Howell [Mon, 12 Dec 2022 19:46:11 +0000 (12:46 -0700)]
rustdoc: stop treating everything in a trait item as a method

This was added in 0b9b4b70683db6ef707755f520f139eb7b92a944 to fix the
spacing on trait pages, but stopped being needed because
791f04e5a47ee78951552c7ed1545b2b01a44c74 stopped styling method-toggle.
By only putting the method-toggle class on actual methods, the JS setting
does the right thing.

18 months agominor code cleanups
Matthias Krüger [Mon, 12 Dec 2022 18:49:53 +0000 (19:49 +0100)]
minor code cleanups

18 months agoRollup merge of #105619 - notriddle:notriddle/source-pre-overflow, r=GuillaumeGomez
Matthias Krüger [Mon, 12 Dec 2022 18:20:38 +0000 (19:20 +0100)]
Rollup merge of #105619 - notriddle:notriddle/source-pre-overflow, r=GuillaumeGomez

rustdoc: remove no-op CSS `.source pre { overflow: auto }`

Since source pages use the `example-wrap` wrapper, this rule became redundant because there is already an `overflow-x: auto` rule.

18 months agoRollup merge of #105616 - est31:add_the, r=Dylan-DPC
Matthias Krüger [Mon, 12 Dec 2022 18:20:37 +0000 (19:20 +0100)]
Rollup merge of #105616 - est31:add_the, r=Dylan-DPC

Add a "the" to proc_macro documentation

18 months agoRollup merge of #105615 - WaffleLapkin:remove_opt_scope_span_mention, r=compiler...
Matthias Krüger [Mon, 12 Dec 2022 18:20:36 +0000 (19:20 +0100)]
Rollup merge of #105615 - WaffleLapkin:remove_opt_scope_span_mention, r=compiler-errors

Fixup method doc that mentions removed param

The param was removed in https://github.com/rust-lang/rust/pull/61872 (101a2f59b490650c12c5f9e4561a7390bfce78d3)

18 months agoRollup merge of #105614 - lukas-code:ascription, r=Nilstrieb
Matthias Krüger [Mon, 12 Dec 2022 18:20:36 +0000 (19:20 +0100)]
Rollup merge of #105614 - lukas-code:ascription, r=Nilstrieb

delete mentions of type ascription from lint descriptions

Tracking Issue: https://github.com/rust-lang/rust/issues/101728

18 months agoRollup merge of #105597 - albertlarsan68:patch-1, r=Dylan-DPC
Matthias Krüger [Mon, 12 Dec 2022 18:20:35 +0000 (19:20 +0100)]
Rollup merge of #105597 - albertlarsan68:patch-1, r=Dylan-DPC

Correct typos in `core::sync::Exclusive::get_{pin_mut, mut}`

18 months agoRollup merge of #105593 - jruderman:patch-3, r=Dylan-DPC
Matthias Krüger [Mon, 12 Dec 2022 18:20:35 +0000 (19:20 +0100)]
Rollup merge of #105593 - jruderman:patch-3, r=Dylan-DPC

Fix typo in comment: length_limit

18 months agoRollup merge of #105561 - TaKO8Ki:fix-105449, r=fee1-dead
Matthias Krüger [Mon, 12 Dec 2022 18:20:34 +0000 (19:20 +0100)]
Rollup merge of #105561 - TaKO8Ki:fix-105449, r=fee1-dead

Normalize receiver substs and erase the regions

Fixes #105449

18 months agoRollup merge of #104405 - Mark-Simulacrum:relnotes, r=pietroalbini
Matthias Krüger [Mon, 12 Dec 2022 18:20:33 +0000 (19:20 +0100)]
Rollup merge of #104405 - Mark-Simulacrum:relnotes, r=pietroalbini

1.66.0 release notes

r? ``@tmandry`` ``@rust-lang/release``

18 months agoMove logic to their own methods
Esteban Küber [Mon, 12 Dec 2022 17:13:27 +0000 (09:13 -0800)]
Move logic to their own methods

18 months agoremove unnecessary uses of `clone`
Takayuki Maeda [Mon, 12 Dec 2022 17:06:24 +0000 (02:06 +0900)]
remove unnecessary uses of `clone`

18 months agorustdoc: remove no-op CSS `.source pre { overflow: auto }`
Michael Howell [Mon, 12 Dec 2022 16:56:15 +0000 (09:56 -0700)]
rustdoc: remove no-op CSS `.source pre { overflow: auto }`

Since source pages use the `example-wrap` wrapper, this rule became
redundant because there is already an `overflow-x: auto` rule.

18 months agodelete mentions of type ascription from lint descriptions
Lukas Markeffsky [Mon, 12 Dec 2022 15:10:22 +0000 (16:10 +0100)]
delete mentions of type ascription from lint descriptions

Move it to the historical context section instead.

18 months agoFixup method doc that mentions removed param
Maybe Waffle [Mon, 12 Dec 2022 15:43:04 +0000 (15:43 +0000)]
Fixup method doc that mentions removed param

18 months agoAdd a "the" to proc_macro documentation
est31 [Mon, 12 Dec 2022 15:18:44 +0000 (16:18 +0100)]
Add a "the" to proc_macro documentation

18 months agoAvoid trying to normalize unnormalizable types
Oli Scherer [Mon, 12 Dec 2022 14:39:08 +0000 (14:39 +0000)]
Avoid trying to normalize unnormalizable types

18 months agoRound 3: require binders for substs
Oli Scherer [Mon, 12 Dec 2022 13:20:36 +0000 (13:20 +0000)]
Round 3: require binders for substs

18 months agonormalize receiver substs and erase the regions
Takayuki Maeda [Mon, 12 Dec 2022 13:11:33 +0000 (22:11 +0900)]
normalize receiver substs and erase the regions

use a smaller example

18 months ago1.66.0 release notes
Mark Rousskov [Mon, 14 Nov 2022 14:55:10 +0000 (09:55 -0500)]
1.66.0 release notes

18 months agoRound 2: make clean_middle_ty take a binder
Oli Scherer [Mon, 12 Dec 2022 12:55:47 +0000 (12:55 +0000)]
Round 2: make clean_middle_ty take a binder

18 months agoRound 1: add some binders (fails due to losing bound vars and then rebinding them...
Oli Scherer [Mon, 12 Dec 2022 12:12:40 +0000 (12:12 +0000)]
Round 1: add some binders (fails due to losing bound vars and then rebinding them with `Binder::dummy`)

18 months agoAuto merge of #105252 - bjorn3:codegen_less_pair_values, r=nagisa
bors [Mon, 12 Dec 2022 10:38:31 +0000 (10:38 +0000)]
Auto merge of #105252 - bjorn3:codegen_less_pair_values, r=nagisa

Use struct types during codegen in less places

This makes it easier to use cg_ssa from a backend like Cranelift that doesn't have any struct types at all. After this PR struct types are still used for function arguments and return values. Removing those usages is harder but should still be doable.

18 months agoCorrect typos in `core::sync::Exclusive::get_{pin_mut, mut}`
Albert Larsan [Mon, 12 Dec 2022 08:19:17 +0000 (09:19 +0100)]
Correct typos in `core::sync::Exclusive::get_{pin_mut, mut}`

18 months agoAuto merge of #105592 - matthiaskrgr:rollup-1cazogq, r=matthiaskrgr
bors [Mon, 12 Dec 2022 07:57:41 +0000 (07:57 +0000)]
Auto merge of #105592 - matthiaskrgr:rollup-1cazogq, r=matthiaskrgr

Rollup of 2 pull requests

Successful merges:

 - #104997 (Move tests)
 - #105569 (`bug!` with a better error message for failing `Instance::resolve`)

Failed merges:

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

18 months agoRollup merge of #105569 - compiler-errors:resolve-bug-better, r=TaKO8Ki
Matthias Krüger [Mon, 12 Dec 2022 07:21:32 +0000 (08:21 +0100)]
Rollup merge of #105569 - compiler-errors:resolve-bug-better, r=TaKO8Ki

`bug!` with a better error message for failing `Instance::resolve`

Better ICE message when `.unwrap().unwrap()` fails.

18 months agoRollup merge of #104997 - c410-f3r:moar-errors, r=petrochenkov
Matthias Krüger [Mon, 12 Dec 2022 07:21:31 +0000 (08:21 +0100)]
Rollup merge of #104997 - c410-f3r:moar-errors, r=petrochenkov

Move tests

r? `@petrochenkov`

18 months agoFix typo in comment: length_limit
Jesse Ruderman [Mon, 12 Dec 2022 07:21:10 +0000 (23:21 -0800)]
Fix typo in comment: length_limit

18 months agoAuto merge of #105160 - nnethercote:rm-Lit-token_lit, r=petrochenkov
bors [Mon, 12 Dec 2022 05:16:50 +0000 (05:16 +0000)]
Auto merge of #105160 - nnethercote:rm-Lit-token_lit, r=petrochenkov

Remove `token::Lit` from `ast::MetaItemLit`.

Currently `ast::MetaItemLit` represents the literal kind twice. This PR removes that redundancy. Best reviewed one commit at a time.

r? `@petrochenkov`

18 months agoAuto merge of #105485 - nnethercote:fix-lint-perf-regressions, r=cjgillot
bors [Mon, 12 Dec 2022 02:17:08 +0000 (02:17 +0000)]
Auto merge of #105485 - nnethercote:fix-lint-perf-regressions, r=cjgillot

Fix lint perf regressions

#104863 caused small but widespread regressions in lint performance. I tried to improve things in #105291 and #105416 with minimal success, before fully understanding what caused the regression. This PR effectively reverts all of #105291 and part of #104863 to fix the perf regression.

r? `@cjgillot`

18 months agoAuto merge of #105579 - matthiaskrgr:rollup-vw5dlqc, r=matthiaskrgr
bors [Sun, 11 Dec 2022 23:36:15 +0000 (23:36 +0000)]
Auto merge of #105579 - matthiaskrgr:rollup-vw5dlqc, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #101648 (Better documentation for env::home_dir()'s broken behaviour)
 - #105283 (Don't call `diagnostic_hir_wf_check` query if we have infer variables)
 - #105369 (Detect spurious ; before assoc fn body)
 - #105472 (Make encode_info_for_trait_item use queries instead of accessing the HIR)
 - #105521 (separate heading from body)
 - #105555 (llvm-wrapper: adapt for LLVM API changes)
 - #105560 (Extend rustdoc hashtag prepended line test)

Failed merges:

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

18 months agoPoint at method call when it is the source of the bound error
Esteban Küber [Sun, 11 Dec 2022 22:49:50 +0000 (14:49 -0800)]
Point at method call when it is the source of the bound error

18 months agoMove tests
Caio [Sun, 11 Dec 2022 22:43:42 +0000 (19:43 -0300)]
Move tests

18 months agoRollup merge of #105560 - GuillaumeGomez:extend-rustdoc-hashtag-prep-line, r=notriddle
Matthias Krüger [Sun, 11 Dec 2022 22:36:48 +0000 (23:36 +0100)]
Rollup merge of #105560 - GuillaumeGomez:extend-rustdoc-hashtag-prep-line, r=notriddle

Extend rustdoc hashtag prepended line test

Follow-up of https://github.com/rust-lang/rust/pull/105539. This case wasn't checked so better add it.

r? `@notriddle`

18 months agoRollup merge of #105555 - krasimirgg:llvm-int-opt-2, r=cuviper
Matthias Krüger [Sun, 11 Dec 2022 22:36:47 +0000 (23:36 +0100)]
Rollup merge of #105555 - krasimirgg:llvm-int-opt-2, r=cuviper

llvm-wrapper: adapt for LLVM API changes

This is a follow-up of https://github.com/rust-lang/rust/commit/75aec4703dea7ef8e13924ccfa3a3d2e8c5c7cff. There, I updated the wrapper to only include llvm/ADT/Optional.h for LLVM version below 16. But I missed updating some of the None references.

Found by our experimental rust + llvm at HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15587#0185006b-e0af-49e5-8b06-280ed125ff0d/200-539

18 months agoRollup merge of #105521 - tshepang:keep-heading-separate, r=nagisa
Matthias Krüger [Sun, 11 Dec 2022 22:36:46 +0000 (23:36 +0100)]
Rollup merge of #105521 - tshepang:keep-heading-separate, r=nagisa

separate heading from body

18 months agoRollup merge of #105472 - spastorino:make-encoder-use-queries, r=oli-obk
Matthias Krüger [Sun, 11 Dec 2022 22:36:46 +0000 (23:36 +0100)]
Rollup merge of #105472 - spastorino:make-encoder-use-queries, r=oli-obk

Make encode_info_for_trait_item use queries instead of accessing the HIR

This change avoids accessing the HIR on `encode_info_for_trait_item` and uses queries. We will need to execute this function for elements that have no HIR and by using queries we will be able to feed for definitions that have no HIR.

r? ``@oli-obk``

18 months agoRollup merge of #105369 - chenyukang:yukang/fix-105226, r=TaKO8Ki
Matthias Krüger [Sun, 11 Dec 2022 22:36:46 +0000 (23:36 +0100)]
Rollup merge of #105369 - chenyukang:yukang/fix-105226, r=TaKO8Ki

Detect spurious ; before assoc fn body

Fixes #105226

r? ``@TaKO8Ki``

18 months agoRollup merge of #105283 - compiler-errors:ty-var-in-hir-wfcheck, r=nagisa
Matthias Krüger [Sun, 11 Dec 2022 22:36:45 +0000 (23:36 +0100)]
Rollup merge of #105283 - compiler-errors:ty-var-in-hir-wfcheck, r=nagisa

Don't call `diagnostic_hir_wf_check` query if we have infer variables

Fixes #105260

18 months agoRollup merge of #101648 - Timmmm:home_dir_docs, r=joshtriplett
Matthias Krüger [Sun, 11 Dec 2022 22:36:44 +0000 (23:36 +0100)]
Rollup merge of #101648 - Timmmm:home_dir_docs, r=joshtriplett

Better documentation for env::home_dir()'s broken behaviour

This improves the documentation to say *why* it was deprecated. The reason was because it reads `HOME` on Windows which is meaningless there. Note that the PR that deprecated it stated that returning an empty string if `HOME` is set to an empty string was a problem, however I can find no evidence that this is the case. `cd` handles it fine whereas if `HOME` is unset it gives an explicit `HOME not set` error.

* Original deprecation reason: https://internals.rust-lang.org/t/deprecate-or-break-fix-std-env-home-dir/7315
* Original deprecation PR: https://github.com/rust-lang/rust/pull/51656

See #71684

18 months agoSpeed up the "builtin lints only" case.
Nicholas Nethercote [Fri, 9 Dec 2022 03:15:26 +0000 (14:15 +1100)]
Speed up the "builtin lints only" case.

This commit partly undoes #104863, which combined the builtin lints pass
with other lints. This caused a slowdown, because often there are no
other lints, and it's faster to do a pass with a single lint directly
than it is to do a combined pass with a `passes` vector containing a
single lint.

18 months agoReinstate `{Early,Late}LintPassObjects`.
Nicholas Nethercote [Fri, 9 Dec 2022 01:27:43 +0000 (12:27 +1100)]
Reinstate `{Early,Late}LintPassObjects`.

I removed these in #105291, and subsequently learned they are necessary
for performance.

This commit reinstates them with the new and more descriptive names
`RuntimeCombined{Early,Late}LintPass`, similar to the existing passes
like `BuiltinCombinedEarlyLintPass`. It also adds some comments,
particularly emphasising how we have ways to combine passes at both
compile-time and runtime. And it moves some comments around.

18 months agoRename `run_early_passes` as `lint_callback`.
Nicholas Nethercote [Fri, 9 Dec 2022 00:40:39 +0000 (11:40 +1100)]
Rename `run_early_passes` as `lint_callback`.

This matches the name used in `late.rs`.

18 months agoAuto merge of #103647 - lqd:osx-x64-lto, r=Mark-Simulacrum
bors [Sun, 11 Dec 2022 20:38:34 +0000 (20:38 +0000)]
Auto merge of #103647 - lqd:osx-x64-lto, r=Mark-Simulacrum

Enable ThinLTO for rustc on `x86_64-apple-darwin`

Local measurements seemed to show an improvement on a couple benchmarks, so I'd like to test real CI builds, and see if the builder doesn't timeout with the expected slight increase in build times.

Let's start with x64 rustc ThinLTO, and then figure out the file structure to configure LLVM ThinLTO. Maybe we'll then try `aarch64` builds since that also looked good locally.

18 months agobug! with a better error message for failing Instance::resolve
Michael Goulet [Sun, 11 Dec 2022 19:46:58 +0000 (19:46 +0000)]
bug! with a better error message for failing Instance::resolve

18 months agoUse `with_forced_trimmed_paths`
Esteban Küber [Sun, 11 Dec 2022 19:38:43 +0000 (11:38 -0800)]
Use `with_forced_trimmed_paths`

18 months agofix rebase
Esteban Küber [Sun, 11 Dec 2022 03:08:59 +0000 (19:08 -0800)]
fix rebase

18 months agoOnly point at methods that might be relevant
Esteban Küber [Wed, 7 Dec 2022 22:16:37 +0000 (14:16 -0800)]
Only point at methods that might be relevant

18 months agoAdd label to method chains where assoc type remains the same
Esteban Küber [Wed, 7 Dec 2022 20:25:49 +0000 (12:25 -0800)]
Add label to method chains where assoc type remains the same

18 months agoRemove mention of "assoc type" in label as it is already in the `note` message
Esteban Küber [Wed, 7 Dec 2022 19:32:26 +0000 (11:32 -0800)]
Remove mention of "assoc type" in label as it is already in the `note` message

18 months agoAccount for method call chains split across multiple bindings
Esteban Küber [Wed, 7 Dec 2022 19:11:06 +0000 (11:11 -0800)]
Account for method call chains split across multiple bindings

18 months agoMention only assoc types changes
Esteban Küber [Tue, 6 Dec 2022 20:08:17 +0000 (12:08 -0800)]
Mention only assoc types changes

18 months agoExpand iterator chain test
Esteban Küber [Tue, 6 Dec 2022 18:32:49 +0000 (10:32 -0800)]
Expand iterator chain test

18 months agoProvide associated type information in method chains
Michael Goulet [Tue, 6 Dec 2022 17:34:24 +0000 (17:34 +0000)]
Provide associated type information in method chains

When encountering an unmet obligation that affects a method chain, like
in iterator chains where one of the links has the wrong associated
type, we point at every method call and mention their evaluated
associated type at that point to give context to the user of where
expectations diverged from the code as written.

```
note: the expression is of type `Map<std::slice::Iter<'_, {integer}>, [closure@$DIR/invalid-iterator-chain.rs:12:18: 12:21]>`
  --> $DIR/invalid-iterator-chain.rs:12:14
   |
LL |         vec![0, 1]
   |         ---------- this expression has type `Vec<{integer}>`
LL |             .iter()
   |              ------ associated type `std::iter::Iterator::Item` is `&{integer}` here
LL |             .map(|x| { x; })
   |              ^^^^^^^^^^^^^^^ associated type `std::iter::Iterator::Item` is `()` here
```

18 months agoAuto merge of #103591 - lqd:win-lto, r=Mark-Simulacrum
bors [Sun, 11 Dec 2022 17:37:12 +0000 (17:37 +0000)]
Auto merge of #103591 - lqd:win-lto, r=Mark-Simulacrum

Enable ThinLTO for rustc on x64 msvc

This applies the great work from `@bjorn3` and `@Kobzol` in https://github.com/rust-lang/rust/pull/101403 to x64 msvc.

Here are the local results for the try build `68c5c85ed759334a11f0b0e586f5032a23f85ce4`, compared to its parent `0a6b941df354c59b546ec4c0d27f2b9b0cb1162c`. Looking better than my previous local builds.

![image](https://user-images.githubusercontent.com/247183/198158039-98ebac0e-da0e-462e-8162-95e88345edb9.png)

(I can't show cycle counts, as that option is failing on the windows version of the perf collector, but I'll try to analyze and debug this soon)

This will be the first of a few tests for rustc / llvm / both ThinLTO on the windows and mac targets.

18 months agoAuto merge of #102900 - abrachet:master, r=bjorn3
bors [Sun, 11 Dec 2022 14:42:45 +0000 (14:42 +0000)]
Auto merge of #102900 - abrachet:master, r=bjorn3

Don't internalize __llvm_profile_counter_bias

Currently, LLVM profiling runtime counter relocation cannot be used by rust during LTO because symbols are being internalized before all symbol information is known.

This mode makes LLVM emit a __llvm_profile_counter_bias symbol which is referenced by the profiling initialization, which itself is pulled in by the rust driver here [1].

It is enabled with -Cllvm-args=-runtime-counter-relocation for platforms which are opt-in to this mode like Linux. On these platforms there will be no link error, rather just surprising behavior for a user which request runtime counter relocation. The profiling runtime will not see that symbol go on as if it were never there. On Fuchsia, the profiling runtime must have this symbol which will cause a hard link error.

As an aside, I don't have enough context as to why rust's LTO model is how it is. AFAICT, the internalize pass is only safe to run at link time when all symbol information is actually known, this being an example as to why. I think special casing this symbol as a known one that LLVM can emit which should not have it's visbility de-escalated should be fine given how seldom this pattern of defining an undefined symbol to get initilization code pulled in is. From a quick grep, __llvm_profile_runtime is the only symbol that rustc does this for.

[1] https://github.com/rust-lang/rust/blob/0265a3e93bf1b89d97cae113ed214954d5c35e22/compiler/rustc_codegen_ssa/src/back/linker.rs#L598

18 months agoExtend rustdoc hashtag prepended line test
Guillaume Gomez [Sun, 11 Dec 2022 13:37:55 +0000 (14:37 +0100)]
Extend rustdoc hashtag prepended line test

18 months agoAuto merge of #105508 - eduardosm:ptr-methods-inline-always, r=Mark-Simulacrum
bors [Sun, 11 Dec 2022 11:42:15 +0000 (11:42 +0000)]
Auto merge of #105508 - eduardosm:ptr-methods-inline-always, r=Mark-Simulacrum

Make pointer `sub` and `wrapping_sub` methods `#[inline(always)]`

Splitted from https://github.com/rust-lang/rust/pull/105262

18 months agollvm-wrapper: adapt for LLVM API changes
Krasimir Georgiev [Sun, 11 Dec 2022 09:14:50 +0000 (09:14 +0000)]
llvm-wrapper: adapt for LLVM API changes

This is a follow-up of
https://github.com/rust-lang/rust/commit/75aec4703dea7ef8e13924ccfa3a3d2e8c5c7cff.
There, I updated the wrapper to only include llvm/ADT/Optional.h for
LLVM version below 16. But I missed updating some of the None references.

Found by our experimental rust + llvm at HEAD bot:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/15587#0185006b-e0af-49e5-8b06-280ed125ff0d/200-539

18 months agoAuto merge of #105554 - matthiaskrgr:rollup-ir60gc7, r=matthiaskrgr
bors [Sun, 11 Dec 2022 09:01:37 +0000 (09:01 +0000)]
Auto merge of #105554 - matthiaskrgr:rollup-ir60gc7, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #105411 (Introduce `with_forced_trimmed_paths`)
 - #105532 (Document behaviour of `--remap-path-prefix` with several matches)
 - #105537 (compiler: remove unnecessary imports and qualified paths)
 - #105539 (rustdoc: Only hide lines starting with `#` in rust code blocks )
 - #105546 (Add some regression tests for #44454)
 - #105547 (Add regression test for #104582)

Failed merges:

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

18 months agoRollup merge of #105547 - JohnTitor:issue-104582, r=compiler-errors
Matthias Krüger [Sun, 11 Dec 2022 08:51:58 +0000 (09:51 +0100)]
Rollup merge of #105547 - JohnTitor:issue-104582, r=compiler-errors

Add regression test for #104582

Closes #104582
r? `@compiler-errors`

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoRollup merge of #105546 - JohnTitor:issue-44454, r=compiler-errors
Matthias Krüger [Sun, 11 Dec 2022 08:51:58 +0000 (09:51 +0100)]
Rollup merge of #105546 - JohnTitor:issue-44454, r=compiler-errors

Add some regression tests for #44454

Closes #44454
r? ``@compiler-errors``

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoRollup merge of #105539 - GuillaumeGomez:hashtag-prepended-lines-non-rust, r=notriddle
Matthias Krüger [Sun, 11 Dec 2022 08:51:57 +0000 (09:51 +0100)]
Rollup merge of #105539 - GuillaumeGomez:hashtag-prepended-lines-non-rust, r=notriddle

rustdoc: Only hide lines starting with `#` in rust code blocks

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

So before approving, this is a big question: in rust code blocks, in a line starts with a `#`, we hide it in the output. However, should we do the same for non-rust code blocks too? I think it's a bit problematic to do it because `#` can be used for many things but I prefer to check first with everyone (might also be worth updating documentation too).

cc ``@rust-lang/rustdoc``
r? ``@notriddle``

18 months agoRollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead
Matthias Krüger [Sun, 11 Dec 2022 08:51:57 +0000 (09:51 +0100)]
Rollup merge of #105537 - kadiwa4:remove_some_imports, r=fee1-dead

compiler: remove unnecessary imports and qualified paths

Some of these imports were necessary before Edition 2021, others were already in the prelude.

I hope it's fine that this PR is so spread-out across files :/

18 months agoRollup merge of #105532 - poliorcetics:document-remap-order, r=JohnTitor
Matthias Krüger [Sun, 11 Dec 2022 08:51:56 +0000 (09:51 +0100)]
Rollup merge of #105532 - poliorcetics:document-remap-order, r=JohnTitor

Document behaviour of `--remap-path-prefix` with several matches

18 months agoRollup merge of #105411 - estebank:short-names, r=oli-obk
Matthias Krüger [Sun, 11 Dec 2022 08:51:56 +0000 (09:51 +0100)]
Rollup merge of #105411 - estebank:short-names, r=oli-obk

Introduce `with_forced_trimmed_paths`

Built on top of https://github.com/rust-lang/rust/pull/104922, only last commit is relevant.

18 months agoAuto merge of #105457 - GuillaumeGomez:prevent-auto-blanket-impl-retrieval, r=notriddle
bors [Sun, 11 Dec 2022 06:20:59 +0000 (06:20 +0000)]
Auto merge of #105457 - GuillaumeGomez:prevent-auto-blanket-impl-retrieval, r=notriddle

rustdoc: Prevent auto/blanket impl retrieval if there were compiler errors

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

I'm not sure happy about this fix but since it's how passes work (ie, even if there are errors, it runs all passes), I think it's fine as is.

Just as a sidenote: I also gave a try to prevent running all passes in case there were compiler errors but then a lot of rustdoc tests were failing so I went for this fix instead.

r? `@notriddle`

18 months agoAdd some regression tests for #44454
Yuki Okushi [Sun, 11 Dec 2022 01:57:56 +0000 (10:57 +0900)]
Add some regression tests for #44454

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoAuto merge of #105543 - matthiaskrgr:rollup-s9zj0pq, r=matthiaskrgr
bors [Sun, 11 Dec 2022 02:26:50 +0000 (02:26 +0000)]
Auto merge of #105543 - matthiaskrgr:rollup-s9zj0pq, r=matthiaskrgr

Rollup of 7 pull requests

Successful merges:

 - #103146 (Cleanup timeouts in pthread condvar)
 - #105459 (Build rust-analyzer proc-macro server by default)
 - #105460 (Bump compiler-builtins to 0.1.85)
 - #105511 (Update rustix to 0.36.5)
 - #105530 (Clean up lifetimes in rustdoc syntax highlighting)
 - #105534 (Add Nilstrieb to compiler reviewers)
 - #105542 (Some method confirmation code nits)

Failed merges:

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

18 months agoAdd regression test for #104582
Yuki Okushi [Sun, 11 Dec 2022 01:47:51 +0000 (10:47 +0900)]
Add regression test for #104582

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
18 months agoRollup merge of #105542 - compiler-errors:confirm-nits, r=jackh726
Matthias Krüger [Sat, 10 Dec 2022 23:30:21 +0000 (00:30 +0100)]
Rollup merge of #105542 - compiler-errors:confirm-nits, r=jackh726

Some method confirmation code nits

1. Make some pick methods take `&self` instead of `&mut` to avoid some cloning
2. Pass some values by reference to avoid some cloning
3. Rename a few variables here and there

18 months agoRollup merge of #105534 - Nilstrieb:i-will-review-your-code, r=wesleywiser
Matthias Krüger [Sat, 10 Dec 2022 23:30:20 +0000 (00:30 +0100)]
Rollup merge of #105534 - Nilstrieb:i-will-review-your-code, r=wesleywiser

Add Nilstrieb to compiler reviewers

r? ``@wesleywiser``

18 months agoRollup merge of #105530 - Nilstrieb:rustdoc-highlight-less-lifetimes, r=GuillaumeGomez
Matthias Krüger [Sat, 10 Dec 2022 23:30:20 +0000 (00:30 +0100)]
Rollup merge of #105530 - Nilstrieb:rustdoc-highlight-less-lifetimes, r=GuillaumeGomez

Clean up lifetimes in rustdoc syntax highlighting

Removes a few lifetimes and renames some.

r? ``@GuillaumeGomez``

18 months agoRollup merge of #105511 - luqmana:rustix-upgrade, r=Mark-Simulacrum
Matthias Krüger [Sat, 10 Dec 2022 23:30:19 +0000 (00:30 +0100)]
Rollup merge of #105511 - luqmana:rustix-upgrade, r=Mark-Simulacrum

Update rustix to 0.36.5

Pull in fix for https://github.com/bytecodealliance/rustix/issues/467 on recent cargo nightlies.

18 months agoRollup merge of #105460 - mkroening:compiler-builtins-0.1.85, r=Mark-Simulacrum
Matthias Krüger [Sat, 10 Dec 2022 23:30:19 +0000 (00:30 +0100)]
Rollup merge of #105460 - mkroening:compiler-builtins-0.1.85, r=Mark-Simulacrum

Bump compiler-builtins to 0.1.85

This makes minimal floating point symbols available on `x86_64-unknown-none`.

See https://github.com/rust-lang/compiler-builtins/issues/509 and https://github.com/rust-lang/compiler-builtins/pull/510.

18 months agoRollup merge of #105459 - jyn514:proc-macro-default, r=Mark-Simulacrum
Matthias Krüger [Sat, 10 Dec 2022 23:30:18 +0000 (00:30 +0100)]
Rollup merge of #105459 - jyn514:proc-macro-default, r=Mark-Simulacrum

Build rust-analyzer proc-macro server by default

This allows getting rid of some documentation and an extra step when building a custom toolchain: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#creating-a-rustup-toolchain and it seems likely that people will want to do this if they want rustdoc (which is also built by default).

18 months agoRollup merge of #103146 - joboet:cleanup_pthread_condvar, r=Mark-Simulacrum
Matthias Krüger [Sat, 10 Dec 2022 23:30:18 +0000 (00:30 +0100)]
Rollup merge of #103146 - joboet:cleanup_pthread_condvar, r=Mark-Simulacrum

Cleanup timeouts in pthread condvar

18 months agofix rebase
Esteban Küber [Sat, 10 Dec 2022 23:03:47 +0000 (15:03 -0800)]
fix rebase

18 months agoIntroduce `with_forced_trimmed_paths`
Esteban Küber [Wed, 7 Dec 2022 04:13:31 +0000 (20:13 -0800)]
Introduce `with_forced_trimmed_paths`

18 months agoSome method confirmation code nits
Michael Goulet [Sat, 10 Dec 2022 21:19:02 +0000 (21:19 +0000)]
Some method confirmation code nits

18 months agoAdd test for non-rust code block hashtag prepended lines
Guillaume Gomez [Sat, 10 Dec 2022 20:02:08 +0000 (21:02 +0100)]
Add test for non-rust code block hashtag prepended lines