Skip to content

Rollup of 40 pull requests #140573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 171 commits into from
Closed

Conversation

VlaDexa
Copy link
Contributor

@VlaDexa VlaDexa commented May 2, 2025

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

checkraisefold and others added 30 commits December 31, 2024 00:31
When rust provides LLVM bitcode files to lld and the bitcode contains
function summaries as used for thin lto, lld defaults to using thin lto.
This prevents some optimizations that are only applied for fat lto.

We solve this by not creating function summaries when fat lto is
enabled. The bitcode for the module is just directly written out.

An alternative solution would be to set the `ThinLTO=0` module flag to
signal lld to do fat lto.
The code in clang that sets this flag is here:
https://github.com/llvm/llvm-project/blob/560149b5e3c891c64899e9912e29467a69dc3a4c/clang/lib/CodeGen/BackendUtil.cpp#L1150
The code in LLVM that queries the flag and defaults to thin lto if not
set is here:
https://github.com/llvm/llvm-project/blob/e258bca9505f35e0a22cb213a305eea9b76d11ea/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp#L4441-L4446
…_exit`

Getting the address of `errno` should be just as cheap as `pthread_self()` and avoids having to use the expensive `Mutex` logic because it always results in a pointer.
`ptr_eq` was recently enhanced to lint on more cases of raw pointers
comparison:

- lint on all raw pointer comparison, by proposing to use
  `[core|std]::ptr::eq(lhs, rhs)` instead of `lhs == rhs`;
- removing one symetric `as usize` on each size if needed
- peeling any level of `as *[const|mut] _` if the remaining expression
  can still be coerced into the original one (i.e., is a ref or raw
  pointer to the same type as before)

The current change restricts the lint to the cases where at least one
level of symetric `as usize`, or any conversion to a raw pointer, could
be removed. For example, a direct comparaison of two raw pointers will
not trigger the lint anymore.
If you want to logically split an iterator after `n` items, you might first
discover `take`. Before this change, you'd find that `take` consumes the
iterator, and you'd probably be stuck. The answer involves `by_ref`, but that's
hard to discover, especially since `by_ref` is a bit abstract and `Iterator`
has many methods.

After this change, you'd see the example showing `take` along with `by_ref`,
which allows you to continue using the rest of the iterator. `by_ref` had a
good example involving `take` already, so this change just duplicates that
existing example under `take`.
* "while until either" could also be changed to "for a while until either", but I just deleted "while".
* fixed sentence with incorrect "at" and "has/have".
* linked [*currently allocated*] similar to other methods.
`ptr_eq` was recently enhanced to lint on more cases of raw pointers
comparison:

- lint on all raw pointer comparison, by proposing to use
`[core|std]::ptr::eq(lhs, rhs)` instead of `lhs == rhs`;
- removing one symetric `as usize` on each size if needed
- peeling any level of `as *[const|mut] _` if the remaining expression
can still be coerced into the original one (i.e., is a ref or raw
pointer to the same type as before)

The current change restricts the lint to the cases where at least one
level of symetric `as usize`, or any conversion to a raw pointer, could
be removed. For example, a direct comparaison of two raw pointers will
not trigger the lint anymore.

changelog: [`ptr_eq`]: do not lint when comparing two raw pointers
directly with no casts involved

Fixes rust-lang/rust-clippy#14525
VlaDexa added 14 commits May 2, 2025 08:31
PassWrapper: adapt for llvm/llvm-project@f137c3d592e96330e450a8fd63ef…

…7e8877fc1908

In LLVM 21 PR llvm/llvm-project#130940 `TargetRegistry::createTargetMachine` was changed to take a `const Triple&` and has deprecated the old `StringRef` method.

`@rustbot` label llvm-main
Update hashbrown dependency to unblock ExtractIf improvements

Release notes: https://github.com/rust-lang/hashbrown/releases/tag/v0.15.3

Relevant to me, this release includes rust-lang/hashbrown#616 which unblocks rust-lang#139764.
rustc-dev-guide subtree update

r? `@ghost`
…Manishearth

Clippy subtree update

r? `@Manishearth`
… r=fee1-dead

Clean up "const" situation in format_args!().

This cleans up the "const" situation in the format_args!() expansion/lowering.

Rather than marking the Argument::new_display etc. functions as non-const, this marks the Arguments::new_v1 functions as non-const.

Example expansion/lowering of format_args!() in const:

```rust
// Error: cannot call non-const formatting macro in constant functions
const {
    fmt::Arguments::new_v1( // Now the error is produced here.
        &["Hello, ", "!\n"],
        &[
            fmt::Argument::new_display(&world) // The error used to be produced here.
        ],
    )
}
```
Remove backtrace dep from anyhow in features status dump tool

According to `anyhow`'s Cargo.toml:

> On compilers older than 1.65, features=["backtrace"] may be used to enable
> backtraces via the `backtrace` crate. This feature has no effect on 1.65+
> besides bringing in an unused dependency, as `std::backtrace` is always
> preferred.

So this is just bringing in an unused dependency.
…ation, r=compiler-errors

Emit user type annotations for free consts in pattern position

This previously wasnt done because free consts couldn't have any generic parameters that need to be preserved for borrowck. This is no longer the case with `feature(generic_const_items)`

r? fmease
Set groundwork for proper const normalization

r? lcnr

Updates a lot of our normalization/alias infrastructure to be setup to handle mgca aliases and normalization once const items are represented more like aliases than bodies. Inherent associated consts are still super busted, I didn't update the assertions that IACs the right arg setup because that winds up being somewhat involved to do *before* proper support for normalizing const aliases is implemented.

I dont *intend* for this to have any effect on stable. We continue normalizing via ctfe on stable and the codepaths in `project` for consts should only be reachable with mgca or ace.
…able, r=workingjubilee

Stabilize `select_unpredictable`

FCP completed in tracking issue rust-lang#133962.
…d_internal_symbol, r=bjorn3

allow `#[rustc_std_internal_symbol]` in combination with `#[naked]`

The need for this came up in rust-lang/compiler-builtins#897, but in general this seems useful and valid to allow.

Based on a quick scan, I don't think changes to the generated assembly are needed.

cc `@bjorn3`
…-tool-error-output, r=clubby789

Improve error output in case `nodejs` or `npm` is not installed for rustdoc-gui test suite

Fixes rust-lang#138134.

It now looks like this:

![Screenshot From 2025-05-01 17-41-12](https://github.com/user-attachments/assets/ae7f2b37-3619-47ff-941d-5d9a7cdd9b6b)

cc `@kpreid`
…ieyouxu

extend the list of registered dylibs on `test::prepare_cargo_test`

self-explanatory

Fixes rust-lang#140299
…in-std-io-pipe-docs, r=tgross35

Use present indicative tense in std::io::pipe() API docs

The inline documentation for all other free functions in the `std::io` module use the phrase "creates a" instead of "create a", except for the currently nightly-only `std::io::pipe()` function. This commit updates the text to align with the predominant wording in the `std::io` module.

I recognize this PR is quite a minuscule nitpick, so feel free to ignore and close if you disagree and/or there are bigger fish to fry. Thanks in advance! :smile:

Relates to rust-lang#127154.
…uillaumeGomez

Rollup of 12 pull requests

Successful merges:

 - rust-lang#138703 (chore: remove redundant words in comment)
 - rust-lang#139186 (Refactor `diy_float`)
 - rust-lang#139780 (docs: Add example to `Iterator::take` with `by_ref`)
 - rust-lang#139802 (Fix some grammar errors and hyperlinks in doc for `trait Allocator`)
 - rust-lang#140034 (simd_select_bitmask: the 'padding' bits in the mask are just ignored)
 - rust-lang#140062 (std: mention `remove_dir_all` can emit `DirectoryNotEmpty` when concurrently written into)
 - rust-lang#140420 (rustdoc: Fix doctest heuristic for main fn wrapping)
 - rust-lang#140460 (Fix handling of LoongArch target features not supported by LLVM 19)
 - rust-lang#140538 (rustc-dev-guide subtree update)
 - rust-lang#140544 (Clean up "const" situation in format_args!(). )
 - rust-lang#140552 (allow `#[rustc_std_internal_symbol]` in combination with `#[naked]`)
 - rust-lang#140556 (Improve error output in case `nodejs` or `npm` is not installed for rustdoc-gui test suite)

r? `@ghost`
`@rustbot` modify labels: rollup
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels May 2, 2025
@rustbot
Copy link
Collaborator

rustbot commented May 2, 2025

Error: Label rollup can only be set by Rust team members

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@VlaDexa
Copy link
Contributor Author

VlaDexa commented May 2, 2025

why did it allow me to do this

@VlaDexa VlaDexa closed this May 2, 2025
@VlaDexa
Copy link
Contributor Author

VlaDexa commented May 2, 2025

If someone important checks this:
I've pressed a button at bors queue to create a rollup, and for some reason it didn't check at create time if I'm in the Rust team

@fmease
Copy link
Member

fmease commented May 2, 2025

This is well-known. The new bors impl might fix that but in any case, it's not a big deal since you can't approve/merge the rollup anyway, so it's basically as if you were opening dummy PRs/issues manually. And if you were starting to spam these, we'd simply report you to GH and get you banned, so it's not a big issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-run-make Area: port run-make Makefiles to rmake.rs A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.