Commit Graph

4005 Commits

Author SHA1 Message Date
bors 4530187fd4 Auto merge of #140565 - GuillaumeGomez:rollup-gv4ed14, r=GuillaumeGomez
Rollup of 12 pull requests

Successful merges:

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

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-02 04:26:54 +00:00
Guillaume Gomez a7816161bd
Rollup merge of #140556 - GuillaumeGomez:improve-rustdoc-gui-tool-error-output, r=clubby789
Improve error output in case `nodejs` or `npm` is not installed for rustdoc-gui test suite

Fixes https://github.com/rust-lang/rust/issues/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``
2025-05-01 22:27:25 +02:00
Guillaume Gomez 4d9a6c519f
Rollup merge of #140552 - folkertdev:naked-function-rustc_std_internal_symbol, r=bjorn3
allow `#[rustc_std_internal_symbol]` in combination with `#[naked]`

The need for this came up in https://github.com/rust-lang/compiler-builtins/pull/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``
2025-05-01 22:27:25 +02:00
Guillaume Gomez 55330297de
Rollup merge of #140544 - m-ou-se:format-args-const-cleanup, 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.
        ],
    )
}
```
2025-05-01 22:27:24 +02:00
Guillaume Gomez 36082d5fca
Rollup merge of #140538 - tshepang:rust-push, r=jieyouxu
rustc-dev-guide subtree update

r? ``@ghost``
2025-05-01 22:27:24 +02:00
Guillaume Gomez 65c7dcafd0
Rollup merge of #140460 - heiher:issue-140455, r=Urgau
Fix handling of LoongArch target features not supported by LLVM 19

Fixes #140455
2025-05-01 22:27:23 +02:00
Guillaume Gomez c1e77a7d9f
Rollup merge of #140420 - fmease:rustdoc-fix-doctest-heur, r=GuillaumeGomez
rustdoc: Fix doctest heuristic for main fn wrapping

Fixes #140412 which regressed in #140220 that I reviewed. As mentioned in https://github.com/rust-lang/rust/pull/140220#issuecomment-2837061779, at the time I didn't have the time to re-review its latest changes and should've therefore invalided my previous "r=me" and blocked the PR on another review given the fragile nature of the doctest impl. This didn't happen which is my fault.

Contains some other small changes. Diff best reviewed modulo whitespace.
r? ``@GuillaumeGomez``
2025-05-01 22:27:23 +02:00
Guillaume Gomez 42c3796e08
Rollup merge of #140062 - xizheyin:issue-139958, r=workingjubilee
std: mention `remove_dir_all` can emit `DirectoryNotEmpty` when concurrently written into

Closes #139958

The current documentation for `std::fs::remove_dir_all` function does not explicitly mention the error types that may be returned in concurrent scenarios. Specifically, when one thread attempts to remove a directory tree while another thread simultaneously writes files to that directory, the function may return an `io::ErrorKind::DirectoryNotEmpty` error, but this behavior is not clearly mentioned in the current documentation.

r? libs
2025-05-01 22:27:22 +02:00
Guillaume Gomez 4f8a79b717
Rollup merge of #140034 - RalfJung:simd_select_bitmask-padding, r=workingjubilee
simd_select_bitmask: the 'padding' bits in the mask are just ignored

Fixes https://github.com/rust-lang/rust/issues/137942: we documented simd_select_bitmask to require the 'padding' bits in the mask (the mask can sometimes be longer than the vector; I am referring to these extra bits as 'padding' here)  to be zero, mostly because nobody felt like doing the research for what should be done when they are non-zero. However, codegen is already perfectly happy just ignoring them, so in practice they can have any value. Some of the intrinsic wrappers in stdarch have trouble ensuring that they are zero. So let's just adjust the docs and Miri to permit non-zero 'padding' bits.

Cc ````@Amanieu```` ````@workingjubilee````
2025-05-01 22:27:22 +02:00
Guillaume Gomez 39089ec82b
Rollup merge of #139802 - Lee-Janggun:fix-allocate-hyperlink, r=workingjubilee
Fix some grammar errors and hyperlinks in doc for `trait Allocator`

I was reading the allocator docs and noticed some weird sentences and missing hyperlink, so I fixed them and made this small PR.

* "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. All other hyperlinks are fine.
2025-05-01 22:27:21 +02:00
Guillaume Gomez 6a599e5432
Rollup merge of #139780 - ongardie:iterator-take-by_ref-example, r=workingjubilee
docs: Add example to `Iterator::take` with `by_ref`

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`.
2025-05-01 22:27:20 +02:00
Guillaume Gomez 68ab58be47
Rollup merge of #139186 - TDecking:float, r=workingjubilee
Refactor `diy_float`

The refactor replaces bespoke algorithms with functions already inside the standard library, improving both codegen and readability.
2025-05-01 22:27:20 +02:00
Guillaume Gomez a665538666
Rollup merge of #138703 - pudongair:master, r=workingjubilee
chore: remove redundant words in comment

remove redundant words in comment
2025-05-01 22:27:19 +02:00
bors 20f6629bf4 Auto merge of #139965 - amandasystems:marginally-improved-scc-annotations, r=lcnr
Decouple SCC annotations from SCCs

This rewires SCC annotations to have them be a separate, visitor-type data structure. It was broken out of #130227, which needed them to be able to remove unused annotations after computation without recomputing the SCCs themselves.

As a drive-by it also removes some redundant code from the hot loop in SCC construction for a performance improvement.

r? lcnr
2025-05-01 16:04:19 +00:00
bors 787fead9e2 Auto merge of #138522 - osiewicz:shared-generics-respect-visibility, r=bjorn3
shared-generics: Do not share instantiations that contain local-only types

In Zed shared-generics loading takes up a significant chunk of time in incremental build, as rustc deserializes rmeta of all dependencies of a crate. I've recently realized that shared-generics includes all instantiations of some_generic_function in the following snippet:
```rs
pub fn some_generic_function(_: impl Fn()) {}

pub fn non_generic_function() {
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
	some_generic_function(|| {});
}
```
even though none of these instantiations can actually be created from outside of `non_generic_function`. This is a dummy example, but we do rely on invoking callbacks with FnOnce a lot in our codebase.

This PR makes shared-generics account for visibilities of generic arguments; an item is only considered for exporting if it is reachable from the outside or if all of it's arguments are visible outside of the local crate.

This PR reduces incremental build time for Zed (touch editor.rs scenario) from 12.4s to 10.4s. I'd love to see a perf run if possible; per my checks this PR does not incur new instantiations in downstream crates, so if there'd be perf regressions, I'd expect them to come from newly-introduced visibility checks.
2025-05-01 11:57:11 +00:00
Ralf Jung a4f5d61989
Merge pull request #4273 from yoctocell/new-cell-state
TB: add `Cell` state to support more fine-grained tracking of interior mutable data
2025-05-01 10:06:52 +00:00
Laurențiu Nicola ccbe9ba6ef
Merge pull request #19726 from lnicola/sync-from-rust
Sync from downstream again
2025-05-01 07:33:30 +00:00
Laurențiu Nicola 7c335f8d7b Merge from rust-lang/rust 2025-05-01 10:22:16 +03:00
Tshepang Mbambo 8e8bc1d999
add rdg push git config entry for git protocol pushers 2025-05-01 07:38:29 +02:00
Oli Scherer fb64a1a87d
Merge pull request #4304 from rust-lang/rustup-2025-05-01
Automatic Rustup
2025-05-01 05:27:22 +00:00
Tshepang Mbambo 72a9e36e04
Merge pull request #2367 from rust-lang/rustc-pull
Rustc pull update
2025-05-01 07:01:46 +02:00
The Miri Cronjob Bot 4e3d862d91 Merge from rustc 2025-05-01 05:01:02 +00:00
Tshepang Mbambo 4d2e6a9dc6
Merge pull request #2368 from martinomburajr/master
Adds 'with' to the bootstrapping docs to help clarify how to build a new compiler
2025-05-01 07:00:21 +02:00
bors 8ca711cea0 Auto merge of #140145 - Zoxc:job-server-proxy, r=SparrowLii
Add a jobserver proxy to ensure at least one token is always held

This adds a jobserver proxy to ensure at least one token is always held by `rustc`. Currently with `-Z threads` `rustc` can temporarily give up all its tokens, causing `cargo` to spawn additional `rustc` instances beyond the job limit.

The current behavior causes an issue with `cargo fix` which has a global lock preventing concurrent `rustc` instances, but it also holds a jobserver token, causing a deadlock when `rustc` gives up its token. That is fixed by this PR.

Fixes https://github.com/rust-lang/rust/issues/67385.
Fixes https://github.com/rust-lang/rust/issues/133873.
Fixes https://github.com/rust-lang/rust/issues/140093.
2025-05-01 04:11:52 +00:00
Martin Ombura Jr. 7f939765c4 adds commas 2025-05-01 04:07:27 +00:00
The rustc-dev-guide Cronjob Bot f6524cb54d Merge from rustc 2025-05-01 04:05:49 +00:00
The rustc-dev-guide Cronjob Bot 8fe288a2f4 Preparing for merge from rustc 2025-05-01 04:05:40 +00:00
Martin Ombura Jr. 9c4b433575 adds 'with' to help clarify how to build a new compiler 2025-05-01 04:01:42 +00:00
bors deb0c0426f Auto merge of #121909 - Zoxc:drop-ast-task, r=petrochenkov
Drop AST on a separate thread and prefetch `hir_crate`

This drop AST on a separate thread and prefetches `hir_crate`.

A `spawn` function is added to the `parallel` module which spawn some work on the Rayon thread pool.
2025-04-30 23:57:22 +00:00
bors cecdac7d2f Auto merge of #140503 - matthiaskrgr:rollup-n7zigts, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`)
 - #139059 (uses_power_alignment: wording tweaks)
 - #139192 (mention provenance in the pointer::wrapping_offset docs)
 - #140312 (Improve pretty-printing of braces)
 - #140404 (rm `TypeVistable` impls for `Canonical`)
 - #140437 (enable msa feature for mips in codegen tests)
 - #140438 (Add `rust.debug-assertions-tools` option)
 - #140439 (miri: algebraic intrinsics: bring back float non-determinism)
 - #140445 (Treat ManuallyDrop as ~const Destruct)
 - #140446 (chore: fix some tests)
 - #140448 (Rename `rustc_query_append!` to `rustc_with_all_queries!`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-30 12:09:10 +00:00
许杰友 Jieyou Xu (Joe) c5598e0703
Merge pull request #2352 from xizheyin/enable-behind-upstream 2025-04-30 18:42:23 +08:00
许杰友 Jieyou Xu (Joe) 6eb758edf4
Merge pull request #2359 from rust-lang/tshepang-repo-name 2025-04-30 18:41:49 +08:00
许杰友 Jieyou Xu (Joe) 04caa77a7d
Merge pull request #2366 from rust-lang/tshepang-patch-1 2025-04-30 18:39:22 +08:00
Lukas Wirth 58b2e14e85
Merge pull request #19247 from alibektas/19172_very_new
fix: Correct span info for mir::Operand
2025-04-30 10:13:02 +00:00
Matthias Krüger fa49b28b28
Rollup merge of #140446 - mejrs:test1, r=jieyouxu
chore: fix some tests
2025-04-30 10:18:29 +02:00
Matthias Krüger 61b42a4ea3
Rollup merge of #140438 - ferrocene:pa-debug-assertions-tools, r=Kobzol
Add `rust.debug-assertions-tools` option

Before this PR, the two only options to configure the presence of debug assertions were the `rust.debug-assertions` and `rust.debug-assertions-std` options. The former applied to everything, and the latter allowed to override the setting just for the standard library. This combination of settings doesn't allow to enable debug assertions for the std and the compiler but not tools.

Some tools (like Cargo) are not really meant to be executed with debug assertions enabled, and in Ferrocene we hit some debug assertions in it that are exclusively meant for its test suite. We'd thus like to enable debug assertions everywhere but in tools.

This PR adds a `rust.debug-assertions-tools` setting that does exactly this.
2025-04-30 10:18:27 +02:00
Matthias Krüger 7ec41b9691
Rollup merge of #139192 - lolbinarycat:docs-wrapping_offset-provenance-139008, r=RalfJung
mention provenance in the pointer::wrapping_offset docs

fixes https://github.com/rust-lang/rust/issues/139008
2025-04-30 10:18:25 +02:00
Matthias Krüger 43a147932d
Rollup merge of #139059 - RalfJung:uses_power_alignment, r=nagisa
uses_power_alignment: wording tweaks

Slightly improves the wording introduced with https://github.com/rust-lang/rust/pull/135552.
2025-04-30 10:18:24 +02:00
Matthias Krüger 424bf9b7a5
Rollup merge of #136160 - ShE3py:should-panic-backticks, r=thomcc
Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`

More legible imo
```rs
#[test]
#[should_panic = "love"]
fn foo() {
    assert!(1 == 2);
}
```
Before:
```
note: panic did not contain expected string
      panic message: `"assertion failed: 1 == 2"`,
 expected substring: `"love"`
```
After:
```
note: panic did not contain expected string
      panic message: "assertion failed: 1 == 2"
 expected substring: "love"
```
Also removed the comma as `assert_eq!` / `assert_ne!` don't use one.

``@rustbot`` label +A-libtest
2025-04-30 10:18:24 +02:00
bors 51762a91a0 Auto merge of #139720 - petrochenkov:errkind2, r=jieyouxu
compiletest: Make diagnostic kind mandatory on line annotations (take 2)

Compiletest currently accepts line annotations without kind in UI tests.
```
    let a = b + c; //~ my message
```

Such annotations have two effects.
- First, they match any compiler-produced diagnostic kind. This functionality is never used in practice, there are no target-dependent diagnostic kinds of something like that.
- Second, they are not "viral". For example, any explicit `//~ NOTE my msg` in a test requires all other `NOTE` diagnostics in the same test to be annotated. Implicit `//~ my msg` will just match the note and won't require other annotations.

The second functionality has a replacement since recently - directive `//@ dont-require-annotations: NOTE`.

This PR removes support for `//~ my message` and makes the explicit diagnostic kind mandatory.
Unwanted additional annotations are suppressed using the `dont-require-annotations` directive.

Closes https://github.com/rust-lang/compiler-team/issues/862.
Previous attempt - #139427.
r? `@jieyouxu`
2025-04-30 08:17:30 +00:00
Vadim Petrochenkov d41f1f4219 compiletest: Make diagnostic kind mandatory on line annotations 2025-04-30 10:44:24 +03:00
bors f24f31a122 Auto merge of #140188 - nnethercote:streamline-format-macro, r=cuviper
Streamline the `format` macro.

Removing the unnecessary local variable speeds up compilation a little.

r? `@cuviper`
2025-04-30 04:04:21 +00:00
Tshepang Mbambo 1b2f1c30d9
for a more friendly output
Also, these are normal Rust things (crates/packages), so remove the word *normal*.
2025-04-29 23:39:06 +02:00
bors bd34a6bf0f Auto merge of #140023 - cjgillot:arena-try-alloc, r=BoxyUwU
Introduce Arena::try_alloc_from_iter.

`alloc_from_iter` already collects the iterator for reentrancy. So adding an early exit for a fallible iterator integrates naturally into the code. This avoids the other solution to allocate and dump the allocation.
2025-04-29 21:06:15 +00:00
Tshepang Mbambo 64dd1c3a8c
Merge pull request #2363 from smanilov/patch-1
Update compiler-src.md
2025-04-29 23:01:31 +02:00
Travis Cross 2cc8f1a3a1 Merge PR #2360: Add docs about stabilizing an edition 2025-04-29 19:09:46 +00:00
Boxy 3c3aa7ebb4
Merge pull request #2365 from BoxyUwU/norm_footnotes
Fix footnotes
2025-04-29 19:38:28 +01:00
Boxy 2eae1c6f99 Fix footnotes 2025-04-29 19:35:26 +01:00
lcnr 12be276e9d
Merge pull request #2266 from BoxyUwU/normalization
Introduce a normalization chapter
2025-04-29 20:19:27 +02:00
Boxy 38a5e54ccd Introduce a normalization chapter 2025-04-29 19:08:55 +01:00