]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 #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 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 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 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

18 months agoDon't take into account hashtag prepended lines if not in rust code block
Guillaume Gomez [Sat, 10 Dec 2022 20:01:48 +0000 (21:01 +0100)]
Don't take into account hashtag prepended lines if not in rust code block

18 months agoAuto merge of #105416 - nnethercote:more-linting-tweaks, r=cjgillot
bors [Sat, 10 Dec 2022 19:49:51 +0000 (19:49 +0000)]
Auto merge of #105416 - nnethercote:more-linting-tweaks, r=cjgillot

More linting tweaks

Squeeze a little more blood from this stone.

r? `@cjgillot`

18 months agocompiler: remove unnecessary imports and qualified paths
KaDiWa [Tue, 9 Aug 2022 00:14:43 +0000 (02:14 +0200)]
compiler: remove unnecessary imports and qualified paths

18 months agoAuto merge of #105531 - matthiaskrgr:rollup-7y7zbgl, r=matthiaskrgr
bors [Sat, 10 Dec 2022 16:37:36 +0000 (16:37 +0000)]
Auto merge of #105531 - matthiaskrgr:rollup-7y7zbgl, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #104460 (Migrate parts of `rustc_expand` to session diagnostics)
 - #105192 (Point at LHS on binop type err if relevant)
 - #105234 (Remove unneeded field from `SwitchTargets`)
 - #105239 (Avoid heap allocation when truncating thread names)
 - #105410 (Consider `parent_count` for const param defaults)
 - #105482 (Fix invalid codegen during debuginfo lowering)

Failed merges:

 - #105411 (Introduce `with_forced_trimmed_paths`)

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

18 months agoAdd Nilstrieb to compiler reviewers
Nilstrieb [Sat, 10 Dec 2022 16:31:39 +0000 (17:31 +0100)]
Add Nilstrieb to compiler reviewers

18 months agodoc: document remap matching behaviour in rustc flags
Alexis (Poliorcetics) Bourget [Sat, 10 Dec 2022 15:04:00 +0000 (16:04 +0100)]
doc: document remap matching behaviour in rustc flags

18 months agoRollup merge of #105482 - wesleywiser:fix_debuginfo_ub, r=tmiasko
Matthias Krüger [Sat, 10 Dec 2022 14:01:45 +0000 (15:01 +0100)]
Rollup merge of #105482 - wesleywiser:fix_debuginfo_ub, r=tmiasko

Fix invalid codegen during debuginfo lowering

In order for LLVM to correctly generate debuginfo for msvc, we sometimes need to spill arguments to the stack and perform some direct & indirect offsets into the value. Previously, this code always performed those actions, even when not required as LLVM would clean it up during optimization.

However, when MIR inlining is enabled, this can cause problems as the operations occur prior to the spilled value being initialized. To solve this, we first calculate the necessary offsets using just the type which is side-effect free and does not alter the LLVM IR. Then, if we are in a situation which requires us to generate the LLVM IR (and this situation only occurs for arguments, not local variables) then we perform the same calculation again, this time generating the appropriate LLVM IR as we go.

r? `@tmiasko` but feel free to reassign if you want 🙂

Fixes #105386

18 months agoRollup merge of #105410 - TaKO8Ki:fix-105257, r=BoxyUwU
Matthias Krüger [Sat, 10 Dec 2022 14:01:44 +0000 (15:01 +0100)]
Rollup merge of #105410 - TaKO8Ki:fix-105257, r=BoxyUwU

Consider `parent_count` for const param defaults

Fixes #105257

18 months agoRollup merge of #105239 - gh2o:no-heap-alloc-on-thread-start, r=cuviper
Matthias Krüger [Sat, 10 Dec 2022 14:01:44 +0000 (15:01 +0100)]
Rollup merge of #105239 - gh2o:no-heap-alloc-on-thread-start, r=cuviper

Avoid heap allocation when truncating thread names

Ensure that heap allocation does not occur in a thread until `std::thread` is ready. This fixes issues with custom allocators that call `std::thread::current()`, since doing so prematurely initializes `THREAD_INFO` and causes the following `thread_info::set()` to fail.

18 months agoRollup merge of #105234 - JakobDegen:unneeded-field, r=oli-obk
Matthias Krüger [Sat, 10 Dec 2022 14:01:43 +0000 (15:01 +0100)]
Rollup merge of #105234 - JakobDegen:unneeded-field, r=oli-obk

Remove unneeded field from `SwitchTargets`

This had a fixme already. The only change in behavior is that the mir dumps now no longer contains labels for the types of the integers on the edges of a switchint:

Before:
![image](https://user-images.githubusercontent.com/51179609/205467622-34401a68-dca6-43eb-915e-b9fda1988860.png)

After:
![image](https://user-images.githubusercontent.com/51179609/205467634-b5b2a259-9cb4-4843-845c-592c500f0f9c.png)

I don't think that's a problem though. The information is still available to a user that really cares by checking the type of `_2`, so it honestly feels like a bit of an improvement to me.

r? mir

18 months agoRollup merge of #105192 - estebank:point-at-lhs-on-binop, r=fee1-dead
Matthias Krüger [Sat, 10 Dec 2022 14:01:43 +0000 (15:01 +0100)]
Rollup merge of #105192 - estebank:point-at-lhs-on-binop, r=fee1-dead

Point at LHS on binop type err if relevant

18 months agoRollup merge of #104460 - Nilstrieb:expand-the-translation, r=davidtwco
Matthias Krüger [Sat, 10 Dec 2022 14:01:42 +0000 (15:01 +0100)]
Rollup merge of #104460 - Nilstrieb:expand-the-translation, r=davidtwco

Migrate parts of `rustc_expand` to session diagnostics

This migrates everything but the `mbe` and `proc_macro` modules. It also contains a few cleanups and drive-by/accidental diagnostic improvements which can be seen in the diff for the UI tests.

18 months agoAuto merge of #105384 - uweigand:s390x-test-codegen, r=Mark-Simulacrum
bors [Sat, 10 Dec 2022 13:56:58 +0000 (13:56 +0000)]
Auto merge of #105384 - uweigand:s390x-test-codegen, r=Mark-Simulacrum

Fix failing codegen tests on s390x

Several codegen tests are currently failing due to making assumptions that are not valid for the s390x architecture:

- catch-unwind.rs: fails due to inlining differences. Already ignored on another platform for the same reason. Solution: Ignore on s390x.

- remap_path_prefix/main.rs: fails due to different alignment requirement for string constants. Solution: Do not test for the alignment requirement.

- repr-transparent-aggregates-1.rs: many ABI assumptions. Already ignored on many platforms for the same reason. Solution: Ignore on s390x.

- repr-transparent.rs: no vector ABI by default on s390x. Already ignored on another platform for a similar reason. Solution: Ignore on s390x.

- uninit-consts.rs: hard-coded little-endian constant. Solution: Match both little- and big-endian versions.

Fixes part of https://github.com/rust-lang/rust/issues/105383.

18 months agoClean up lifetimes in rustdoc syntax highlighting
Nilstrieb [Sat, 10 Dec 2022 13:04:09 +0000 (14:04 +0100)]
Clean up lifetimes in rustdoc syntax highlighting

Removes a few lifetimes and renames some.

18 months agoAuto merge of #105525 - matthiaskrgr:rollup-ricyw5s, r=matthiaskrgr
bors [Sat, 10 Dec 2022 11:16:18 +0000 (11:16 +0000)]
Auto merge of #105525 - matthiaskrgr:rollup-ricyw5s, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #98391 (Reimplement std's thread parker on top of events on SGX)
 - #104019 (Compute generator sizes with `-Zprint_type_sizes`)
 - #104512 (Set `download-ci-llvm = "if-available"` by default when `channel = dev`)
 - #104901 (Implement masking in FileType comparison on Unix)
 - #105082 (Fix Async Generator ABI)
 - #105109 (Add LLVM KCFI support to the Rust compiler)
 - #105505 (Don't warn about unused parens when they are used by yeet expr)
 - #105514 (Introduce `Span::is_visible`)
 - #105516 (Update cargo)
 - #105522 (Remove wrong note for short circuiting operators)

Failed merges:

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

18 months agoMigrate parts of `rustc_expand` to session diagnostics
nils [Tue, 15 Nov 2022 13:24:33 +0000 (14:24 +0100)]
Migrate parts of `rustc_expand` to session diagnostics

This migrates everything but the `mbe` and `proc_macro` modules. It also
contains a few cleanups and drive-by/accidental diagnostic improvements
which can be seen in the diff for the UI tests.

18 months agoRollup merge of #105522 - est31:remove_or_and_note, r=scottmcm
Matthias Krüger [Sat, 10 Dec 2022 08:24:45 +0000 (09:24 +0100)]
Rollup merge of #105522 - est31:remove_or_and_note, r=scottmcm

Remove wrong note for short circuiting operators

They *are* representable by traits, even if the short-circuiting behaviour requires a different approach than the non-short-circuiting operators. For an example proposal, see the postponed [RFC 2722](https://github.com/rust-lang/rfcs/pull/2722). As it is not accurate, remove most of the note.

18 months agoRollup merge of #105516 - weihanglo:update-cargo, r=weihanglo
Matthias Krüger [Sat, 10 Dec 2022 08:24:45 +0000 (09:24 +0100)]
Rollup merge of #105516 - weihanglo:update-cargo, r=weihanglo

Update cargo

2 commits in f6e737b1e3386adb89333bf06a01f68a91ac5306..70898e522116f6c23971e2a554b2dc85fd4c84cd 2022-12-02 20:21:24 +0000 to 2022-12-05 19:43:44 +0000

- Rename `generate_units` -&gt; `generate_root_units` (rust-lang/cargo#11458)
- Implements cargo file locking using fcntl on Solaris. (rust-lang/cargo#11439)

r? `@ghost`

18 months agoRollup merge of #105514 - estebank:is_visible, r=oli-obk
Matthias Krüger [Sat, 10 Dec 2022 08:24:44 +0000 (09:24 +0100)]
Rollup merge of #105514 - estebank:is_visible, r=oli-obk

Introduce `Span::is_visible`

r? `@oli-obk`

18 months agoRollup merge of #105505 - WaffleLapkin:yeet_unused_parens_lint, r=fee1-dead
Matthias Krüger [Sat, 10 Dec 2022 08:24:44 +0000 (09:24 +0100)]
Rollup merge of #105505 - WaffleLapkin:yeet_unused_parens_lint, r=fee1-dead

Don't warn about unused parens when they are used by yeet expr

Don't even get me started on how I've found this.

18 months agoRollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3
Matthias Krüger [Sat, 10 Dec 2022 08:24:43 +0000 (09:24 +0100)]
Rollup merge of #105109 - rcvalle:rust-kcfi, r=bjorn3

Add LLVM KCFI support to the Rust compiler

This PR adds LLVM Kernel Control Flow Integrity (KCFI) support to the Rust compiler. It initially provides forward-edge control flow protection for operating systems kernels for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types. (See llvm/llvm-project@cff5bef.)

Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue #89653).

LLVM KCFI can be enabled with -Zsanitizer=kcfi.

Thank you again, `@bjorn3,` `@eddyb,` `@nagisa,` and `@ojeda,` for all the help!

18 months agoRollup merge of #105082 - Swatinem:async-abi, r=compiler-errors
Matthias Krüger [Sat, 10 Dec 2022 08:24:43 +0000 (09:24 +0100)]
Rollup merge of #105082 - Swatinem:async-abi, r=compiler-errors

Fix Async Generator ABI

This change was missed when making async generators implement `Future` directly.
It did not cause any problems in codegen so far, as `GeneratorState<(), Output>`
happens to have the same ABI as `Poll<Output>`.

18 months agoRollup merge of #104901 - krtab:filetype_compare, r=the8472
Matthias Krüger [Sat, 10 Dec 2022 08:24:42 +0000 (09:24 +0100)]
Rollup merge of #104901 - krtab:filetype_compare, r=the8472

Implement masking in FileType comparison on Unix

Fixes: https://github.com/rust-lang/rust/issues/104900
18 months agoRollup merge of #104512 - jyn514:download-ci-llvm-default, r=Mark-Simulacrum
Matthias Krüger [Sat, 10 Dec 2022 08:24:41 +0000 (09:24 +0100)]
Rollup merge of #104512 - jyn514:download-ci-llvm-default, r=Mark-Simulacrum

Set `download-ci-llvm = "if-available"` by default when `channel = dev`

See https://github.com/rust-lang/compiler-team/issues/566. The motivation for changing the default is to avoid downloading and building LLVM when someone runs `x build` before running `x setup`. The motivation for only doing it on `channel = "dev"` is to avoid breaking distros or users installing from source. It works because `dev` is also the default channel.

The diff looks larger than it is; most of it is moving the `llvm` branch below the `rust` so `config.channel` is set.

r? `@Mark-Simulacrum` cc `@oli-obk` `@bjorn3` `@cuviper`

18 months agoRollup merge of #104019 - compiler-errors:print-generator-sizes, r=wesleywiser
Matthias Krüger [Sat, 10 Dec 2022 08:24:41 +0000 (09:24 +0100)]
Rollup merge of #104019 - compiler-errors:print-generator-sizes, r=wesleywiser

Compute generator sizes with `-Zprint_type_sizes`

Fixes #103887
r? `@pnkfelix`

18 months agoRollup merge of #98391 - joboet:sgx_parker, r=m-ou-se
Matthias Krüger [Sat, 10 Dec 2022 08:24:40 +0000 (09:24 +0100)]
Rollup merge of #98391 - joboet:sgx_parker, r=m-ou-se

Reimplement std's thread parker on top of events on SGX

Mutex and Condvar are being replaced by more efficient implementations, which need thread parking themselves (see #93740). Therefore, the generic `Parker` needs to be replaced on all platforms where the new lock implementation will be used.

SGX enclaves have a per-thread event state, which allows waiting for and setting specific bits. This is already used by the current mutex implementation. The thread parker can however be much more efficient, as it only needs to store the `TCS` address of one thread. This address is stored in a state variable, which can also be set to indicate the thread was already notified.

`park_timeout` does not guard against spurious wakeups like the current condition variable does. This is allowed by the API of `Parker`, and I think it is better to let users handle these wakeups themselves as the guarding is quite expensive and might not be necessary.

`@jethrogb` as you wrote the initial SGX support for `std`, I assume you are the target maintainer? Could you help me test this, please? Lacking a x86_64 chip, I can't run SGX.

18 months agoAuto merge of #105357 - oli-obk:feeding, r=cjgillot,petrochenkov
bors [Sat, 10 Dec 2022 08:23:16 +0000 (08:23 +0000)]
Auto merge of #105357 - oli-obk:feeding, r=cjgillot,petrochenkov

Group some fields in a common struct so we only pass one reference instead of three

r? `@cjgillot`

18 months agoCorrect wrong note for short circuiting operators
est31 [Sat, 10 Dec 2022 03:36:23 +0000 (04:36 +0100)]
Correct wrong note for short circuiting operators

They *are* representable by traits, even if the short-circuiting
behaviour requires a different approach than the non-short-circuiting
operators. For an example proposal, see the postponed RFC 2722.
As it is not accurate, reword the note.

18 months agoAuto merge of #105512 - matthiaskrgr:rollup-i74avrf, r=matthiaskrgr
bors [Sat, 10 Dec 2022 05:32:44 +0000 (05:32 +0000)]
Auto merge of #105512 - matthiaskrgr:rollup-i74avrf, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #102406 (Make `missing_copy_implementations` more cautious)
 - #105265 (Add `rustc_on_unimplemented` to `Sum` and `Product` trait.)
 - #105385 (Skip test on s390x as LLD does not support the platform)
 - #105453 (Make `VecDeque::from_iter` O(1) from `vec(_deque)::IntoIter`)
 - #105468 (Mangle "main" as "__main_void" on wasm32-wasi)
 - #105480 (rustdoc: remove no-op mobile CSS `#sidebar-toggle { text-align }`)
 - #105489 (Fix typo in apple_base.rs)
 - #105504 (rustdoc: make stability badge CSS more consistent)
 - #105506 (Tweak `rustc_must_implement_one_of` diagnostic output)

Failed merges:

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

18 months agoseparate heading from body
Tshepang Mbambo [Sat, 10 Dec 2022 02:48:37 +0000 (04:48 +0200)]
separate heading from body

18 months agoUpdate cargo
Weihang Lo [Sat, 10 Dec 2022 01:00:27 +0000 (01:00 +0000)]
Update cargo

2 commits in f6e737b1e3386adb89333bf06a01f68a91ac5306..70898e522116f6c23971e2a554b2dc85fd4c84cd
2022-12-02 20:21:24 +0000 to 2022-12-05 19:43:44 +0000
- Rename `generate_units` -&gt; `generate_root_units` (rust-lang/cargo#11458)
- Implements cargo file locking using fcntl on Solaris. (rust-lang/cargo#11439)

18 months agoIntroduce `Span::is_visible`
Esteban Küber [Fri, 9 Dec 2022 22:35:55 +0000 (14:35 -0800)]
Introduce `Span::is_visible`

18 months agoRollup merge of #105506 - estebank:rustc_must_implement_one_of, r=compiler-errors
Matthias Krüger [Fri, 9 Dec 2022 21:31:59 +0000 (22:31 +0100)]
Rollup merge of #105506 - estebank:rustc_must_implement_one_of, r=compiler-errors

Tweak `rustc_must_implement_one_of` diagnostic output

18 months agoRollup merge of #105504 - notriddle:notriddle/stab-css, r=GuillaumeGomez
Matthias Krüger [Fri, 9 Dec 2022 21:31:58 +0000 (22:31 +0100)]
Rollup merge of #105504 - notriddle:notriddle/stab-css, r=GuillaumeGomez

rustdoc: make stability badge CSS more consistent

# Before

![image](https://user-images.githubusercontent.com/1593513/206763667-8e0deb74-be63-4906-8229-9a7eb51725c2.png)

![image](https://user-images.githubusercontent.com/1593513/206764007-6301c0e8-4594-4a41-ba93-105824dffee6.png)

# After

![image](https://user-images.githubusercontent.com/1593513/206763698-e187cee2-3a50-4e48-b7b5-c3cfa41a797d.png)

![image](https://user-images.githubusercontent.com/1593513/206764058-3999ee67-1439-4c98-8216-b90575342aa8.png)

# Description

* They all get rounded corners now. A test case has been added for this, too.

* There are now broadly two kinds of stability badge, where there used to be three: item-info "fat badge", and the "thin badge" in both item tables and in docblocks (which got merged). The fat badges can have icons, while the thin badges can't.

* The old Ayu design doesn't make sense to me. Does anyone know why it was done that way?

18 months agoRollup merge of #105489 - eltociear:patch-17, r=Dylan-DPC
Matthias Krüger [Fri, 9 Dec 2022 21:31:58 +0000 (22:31 +0100)]
Rollup merge of #105489 - eltociear:patch-17, r=Dylan-DPC

Fix typo in apple_base.rs

erronous -> erroneous

18 months agoRollup merge of #105480 - notriddle:notriddle/sidebar-toggle-mobile-center, r=Guillau...
Matthias Krüger [Fri, 9 Dec 2022 21:31:57 +0000 (22:31 +0100)]
Rollup merge of #105480 - notriddle:notriddle/sidebar-toggle-mobile-center, r=GuillaumeGomez

rustdoc: remove no-op mobile CSS `#sidebar-toggle { text-align }`

Since 8b001b4da0716936e0ca32303cc0e3c5e53e42f8 make the sidebar toggle a flex container, and already centers its content in desktop mode, this rule doesn't do anything.

18 months agoRollup merge of #105468 - sunfishcode:sunfishcode/main-void-wasi, r=estebank
Matthias Krüger [Fri, 9 Dec 2022 21:31:57 +0000 (22:31 +0100)]
Rollup merge of #105468 - sunfishcode:sunfishcode/main-void-wasi, r=estebank

Mangle "main" as "__main_void" on wasm32-wasi

On wasm, the age-old C trick of having a main function which can either have no arguments or argc+argv doesn't work, because wasm requires caller and callee signatures to match. WASI's current strategy is to have compilers mangle main's name to indicate which signature they're using. Rust uses the no-argument form, which should be mangled as `__main_void`.

This is needed on wasm32-wasi as of #105395.

18 months agoRollup merge of #105453 - scottmcm:vecdeque_from_iter, r=the8472
Matthias Krüger [Fri, 9 Dec 2022 21:31:56 +0000 (22:31 +0100)]
Rollup merge of #105453 - scottmcm:vecdeque_from_iter, r=the8472

Make `VecDeque::from_iter` O(1) from `vec(_deque)::IntoIter`

As suggested in https://github.com/rust-lang/rust/pull/105046#issuecomment-1330371695 by
r? ``@the8472``

`Vec` & `VecDeque`'s `IntoIter`s own the allocations, and even if advanced can be turned into `VecDeque`s in O(1).

This is just a specialization, not an API or doc commitment, so I don't think it needs an FCP.

18 months agoRollup merge of #105385 - uweigand:s390x-test-lld, r=Mark-Simulacrum
Matthias Krüger [Fri, 9 Dec 2022 21:31:56 +0000 (22:31 +0100)]
Rollup merge of #105385 - uweigand:s390x-test-lld, r=Mark-Simulacrum

Skip test on s390x as LLD does not support the platform

test/run-make/issue-71519 requires use of lld as linker, but lld does not currently support the s390x architecture.

18 months agoRollup merge of #105265 - aDotInTheVoid:sum-product-on-unimplemented, r=estebank
Matthias Krüger [Fri, 9 Dec 2022 21:31:55 +0000 (22:31 +0100)]
Rollup merge of #105265 - aDotInTheVoid:sum-product-on-unimplemented, r=estebank

Add `rustc_on_unimplemented` to `Sum` and `Product` trait.

Helps with #105184, but I don't think it fully fixes it.

18 months agoRollup merge of #102406 - mejrs:missing_copy, r=wesleywiser
Matthias Krüger [Fri, 9 Dec 2022 21:31:54 +0000 (22:31 +0100)]
Rollup merge of #102406 - mejrs:missing_copy, r=wesleywiser

Make `missing_copy_implementations` more cautious

- Fixes https://github.com/rust-lang/rust/issues/98348
- Also makes the lint not fire on large types and types containing raw pointers. Thoughts?

18 months agoAuto merge of #105363 - WaffleLapkin:thin2win_box_next_argument, r=nnethercote
bors [Fri, 9 Dec 2022 21:27:35 +0000 (21:27 +0000)]
Auto merge of #105363 - WaffleLapkin:thin2win_box_next_argument, r=nnethercote

Shrink `rustc_parse_format::Piece`

This makes both variants closer together in size (previously they were different by 208 bytes -- 16 vs 224). This may make things worse, but it's worth a try.

r? `@nnethercote`

18 months agoUpdate rustix to 0.36.5
Luqman Aden [Fri, 9 Dec 2022 21:10:18 +0000 (13:10 -0800)]
Update rustix to 0.36.5

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

18 months agoMake `<*{const,mut} T>::{,wrapping_}sub` methods `#[inline(always)]`
Eduardo Sánchez Muñoz [Fri, 9 Dec 2022 19:30:06 +0000 (20:30 +0100)]
Make `<*{const,mut} T>::{,wrapping_}sub` methods `#[inline(always)]`

18 months agoAuto merge of #105499 - pietroalbini:pa-bump-version, r=pietroalbini
bors [Fri, 9 Dec 2022 18:46:42 +0000 (18:46 +0000)]
Auto merge of #105499 - pietroalbini:pa-bump-version, r=pietroalbini

Bump version to 1.68

cc `@rust-lang/release`

18 months agoTweak `rustc_must_implement_one_of` diagnostic output
Esteban Küber [Fri, 9 Dec 2022 18:44:11 +0000 (10:44 -0800)]
Tweak `rustc_must_implement_one_of` diagnostic output

18 months agoDon't warn about unused parens when they are used by yeet expr
Maybe Waffle [Fri, 9 Dec 2022 18:32:06 +0000 (18:32 +0000)]
Don't warn about unused parens when they are used by yeet expr

18 months agorustdoc: make stability badge CSS more consistent
Michael Howell [Fri, 9 Dec 2022 17:40:49 +0000 (10:40 -0700)]
rustdoc: make stability badge CSS more consistent

* They all get rounded corners now. A test case has been added for this, too.

* There are now broadly two kinds of stability badge, where there used to be
  three: item-info "fat badge", and the "thin badge" in both item tables and
  in docblocks (which got merged). The fat badges can have icons, while the
  thin badges can't.

18 months agobump version to 1.68
Pietro Albini [Fri, 9 Dec 2022 16:47:46 +0000 (17:47 +0100)]
bump version to 1.68

18 months agoAuto merge of #105262 - eduardosm:more-inline-always, r=thomcc
bors [Fri, 9 Dec 2022 15:42:18 +0000 (15:42 +0000)]
Auto merge of #105262 - eduardosm:more-inline-always, r=thomcc

Make some trivial functions `#[inline(always)]`

This is some kind of follow-up of PRs like https://github.com/rust-lang/rust/pull/85218, https://github.com/rust-lang/rust/pull/84061, https://github.com/rust-lang/rust/pull/87150. Functions that do very basic operations are made `#[inline(always)]` to avoid pessimizing them in debug builds when compared to using built-in operations directly.