Commit Graph

300570 Commits

Author SHA1 Message Date
León Orell Valerian Liehr
2cbd0bc27c Rollup merge of #143822 - RalfJung:miri-ui-clean, r=jieyouxu
./x test miri: fix cleaning the miri_ui directory

Fixes https://github.com/rust-lang/rust/issues/143680
2025-07-13 07:21:24 +02:00
León Orell Valerian Liehr
886ad3a947 Rollup merge of #143817 - Kobzol:wasi-sdk-path, r=jieyouxu
Access `wasi_sdk_path` instead of reading environment variable in bootstrap

Small cleanup to remove an environment variable read that we have performed earlier in bootstrap already.
2025-07-13 07:21:24 +02:00
León Orell Valerian Liehr
f8bbc91f76 Rollup merge of #143814 - lolbinarycat:htmldocck-negative-err, r=fmease
htmldocck: better error messages for some negative directives

Previously it was saying "did not match pattern" even when the error was that it did match the pattern, and it wasn't supposed to.
2025-07-13 07:21:23 +02:00
León Orell Valerian Liehr
95b5a082cc Rollup merge of #143803 - RalfJung:const-trait-tracking, r=compiler-errors
New tracking issues for const_ops and const_cmp

Let's do a clean start with new tracking issues to avoid mixing things up with the previous constification.

I assume the fact that the `PartialEq` *trait* and *impls* used different feature names  was a mistake (the feature name on the impl is entirely irrelevant anyway).

Part of https://github.com/rust-lang/rust/issues/143800, https://github.com/rust-lang/rust/issues/143802

r? ``@oli-obk``
2025-07-13 07:21:23 +02:00
León Orell Valerian Liehr
d607b944e4 Rollup merge of #143798 - Shourya742:2025-07-11-remove-format-short-command-trait, r=Kobzol
Remove format short command trait

Since we no longer have traces of the vanilla command, and we're already implementing format_short_command for CommandFingerprint, we can use it directly from the fingerprint. This PR removes the standalone format_short_command trait and moves its implementation under CommandFingerprint.
2025-07-13 07:21:22 +02:00
León Orell Valerian Liehr
b0e559a976 Rollup merge of #143796 - JonathanBrouwer:fix-builtin-attribute-prefix, r=jdonszelmann
Fix ICE for parsed attributes with longer path not handled by CheckAttribute

Fixes https://github.com/rust-lang/rust/issues/137590
Fixes https://github.com/rust-lang/rust/issues/143789

r? ```@jdonszelmann```
2025-07-13 07:21:21 +02:00
León Orell Valerian Liehr
8719acd4d1 Rollup merge of #143791 - GuillaumeGomez:update-sysinfo, r=jieyouxu
Update sysinfo version to `0.36.0`

Bugfixes and some new API additions.
2025-07-13 07:21:21 +02:00
León Orell Valerian Liehr
3cd37dfcbe Rollup merge of #143782 - jieyouxu:debug-assertions, r=ChrisDenton
Disambiguate between rustc vs std having debug assertions in `run-make-support` and `run-make` tests

`NO_DEBUG_ASSERTIONS` is set by CI that threads through to the `./configure.py` script, which is somewhat fragile and "spooky action at a distance". For `fmt-write-bloat`, this is actually wrong because the test wants to gate on *std* being built with debug assertions or not, whereas `NO_DEBUG_ASSERTIONS` determines *rustc* being built with debug assertions or not. Instead, use env vars controlled by compiletest, whose debug assertion info comes from bootstrap.

855e0fe46e/src/ci/run.sh (L137-L146)

`NO_DEBUG_ASSERTIONS` controls `--enable-debug-assertions`

855e0fe46e/src/bootstrap/configure.py (L124)

which sets `--rust.debug-assertions`, which controls *rustc* debug assertions.

855e0fe46e/src/bootstrap/configure.py (L125-L129)

`--rust.debug-assertions-std` controls *std* debug assertions.

Noticed while investigating `fmt-write-bloat` in https://github.com/rust-lang/rust/pull/143669#discussion_r2200522215.

Best reviewed commit-by-commit.

r? ``@ChrisDenton`` (or compiler/bootstrap)
2025-07-13 07:21:20 +02:00
León Orell Valerian Liehr
59859b8a37 Rollup merge of #143778 - oli-obk:const-cleanup, r=fee1-dead
Some const_trait_impl test cleanups

Some tests we forgot to update when the feature gate was reimplemented

r? ``@fee1-dead`` ``@compiler-errors``
2025-07-13 07:21:20 +02:00
León Orell Valerian Liehr
5d5645972f Rollup merge of #143776 - no1wudi:fix, r=tgross35
std: move NuttX to use arc4random for random number generation

arc4random support in libc merged in https://github.com/rust-lang/libc/pull/4464, so:

* Move `target_os = "nuttx"` from unix_legacy to arc4random section
* This aligns NuttX with other POSIX-compliant systems that support arc4random
* Improves random number generation quality on NuttX by using the system's built-in arc4random implementation instead of legacy fallback methods

NuttX supports arc4random_buf which provides better entropy and security compared to the legacy random number generation methods.
2025-07-13 07:21:19 +02:00
bors
d2baa49a10 Auto merge of #143213 - dianne:lower-cond-tweaks, r=cjgillot
de-duplicate condition scoping logic between AST→HIR lowering and `ScopeTree` construction

There was some overlap between `rustc_ast_lowering::LoweringContext::lower_cond` and `rustc_hir_analysis::check::region::resolve_expr`, so I've removed the former and migrated its logic to the latter, with some simplifications.

Consequences:
- For `while` and `if` expressions' `let`-chains, this changes the `HirId`s for the `&&`s to properly correspond to their AST nodes. This is how guards were handled already.
- This makes match guards share previously-duplicated logic with `if`/`while` expressions. This will also be used by guard pattern[^1] guards.
- Aside from legacy syntax extensions (e.g. some builtin macros) that directly feed AST to the compiler, it's currently impossible to put attributes directly on `&&` operators in `let` chains[^2]. Nonetheless, attributes on `&&` operators in `let` chains in `if`/`while` expression conditions are no longer silently ignored and will be lowered.
- This no longer wraps conditions in `DropTemps`, so the HIR and THIR will be slightly smaller.
- `DesugaringKind::CondTemporary` is now gone. It's no longer applied to any spans, and all uses of it were dead since they were made to account for `if` and `while` being desugared to `match` on a boolean scrutinee.
- Should be a marginal perf improvement beyond that due to leveraging [`ScopeTree` construction](5e749eb66f/compiler/rustc_hir_analysis/src/check/region.rs (L312-L355))'s clever handling of `&&` and `||`:
  - This removes some unnecessary terminating scopes that were placed around top-level `&&` and `||` operators in conditions. When lowered to MIR, logical operator chains don't create intermediate boolean temporaries, so there's no temporary to drop. The linked snippet handles wrapping the operands in terminating scopes as necessary, in case they create temporaries.
  - The linked snippet takes care of letting `let` temporaries live and terminating other operands, so we don't need separate traversals of `&&` chains for that.

[^1]: rust-lang/rust#129967
[^2]: Case-by-case, here's my justification: `#[attr] e1 && e2` applies the attribute to `e1`. In `#[attr] (e1 && e2)` , the attribute is on the parentheses in the AST, plus it'd fail to parse if `e1` or `e2` contains a `let`. In `#[attr] expands_to_let_chain!()`, the attribute would already be ignored (rust-lang/rust#63221) and it'd fail to parse anyway; even if the expansion site is a condition, the expansion wouldn't be parsed with `Restrictions::ALLOW_LET`. If it *was* allowed, the notion of a "reparse context" from https://github.com/rust-lang/rust/issues/61733#issuecomment-509626449 would be necessary in order to make `let`-chains left-associative; multiple places in the compiler assume they are.
2025-07-13 04:20:07 +00:00
bors
b1d2f2c64c Auto merge of #140717 - mejrs:diagnostic_lints, r=oli-obk
Split up the `unknown_or_malformed_diagnostic_attributes` lint

This splits up the lint into the following lint group:
- `unknown_diagnostic_attributes` - triggers if the attribute is unknown to the current compiler
- `misplaced_diagnostic_attributes` - triggers if the attribute exists but it is not placed on the item kind it's meant for
- `malformed_diagnostic_attributes` - triggers if the attribute's syntax or options are invalid
- `malformed_diagnostic_format_literals` - triggers if the format string literal is invalid, for example if it has unpaired curly braces or invalid parameters
- this pr doesn't create it, but future lints for things like deprecations can also go here.

This PR does not start emitting lints in places that previously did not.

## Motivation

I want to have finer control over what `unknown_or_malformed_diagnostic_attributes` does

I have a project with fairly low msrv that is/will have a lower msrv than future diagnostic attributes. So lints will be emitted when I or others compile it on a lower msrv.

At this time, there are two options to silence these lints:

-  `#[allow(unknown_or_malformed_diagnostic_attributes)]` - this risks diagnostic regressions if I (or others) mess up using the attribute, or if the attribute's syntax ever changes.
- write a build script to detect the compiler version and emit cfgs, and then conditionally enable the attribute:
    ```rust
    #[cfg_attr(rust_version_99, diagnostic::new_attr_in_rust_99(thing = ..))]`
    struct Foo;
    ```
    or conditionally `allow`  the lint:
    ```rust
   // lib.rs
   #![cfg_attr(not(current_rust), allow(unknown_or_malformed_diagnostic_attributes))]
   ```

I like to avoid using build scripts if I can, so the following works much better for me. That is what this PR will let me do in the future:
```rust
    #[allow(unknown_diagnostic_attribute, reason = "attribute came out in rust 1.99 but msrv is 1.70")]
    #[diagnostic::new_attr_in_rust_99(thing = ..)]`
    struct Foo;
2025-07-13 01:11:56 +00:00
bors
288e94c4ba Auto merge of #143783 - bvanjoi:issue-143697-2, r=compiler-errors
compute all rpitit of a trait

Fixes rust-lang/rust#143697

r? `@compiler-errors`
2025-07-12 22:08:57 +00:00
Jonathan Brouwer
86349e31dd Port #[omit_gdb_pretty_printer_section] to the new attribute parsing infrastructure
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-12 22:55:48 +02:00
Michael Goulet
736bfa12de Clean up implementation of RPITIT assoc item lowering 2025-07-12 19:31:15 +00:00
Kivooeo
98934707eb cleaned up some tests
Additionally, remove unused `tests/ui/auxiliary/svh-*` crates that are duplicates of `tests/ui/svh/auxiliary/svh-*`.
2025-07-13 00:03:31 +05:00
Kivooeo
47b8a32ca3 moved tests 2025-07-13 00:03:31 +05:00
bohan
47e15d90e1 query RPITIT in a trait or impl 2025-07-13 02:52:13 +08:00
bohan
dc6c3300fc compute all rpitit of a trait 2025-07-13 02:52:13 +08:00
Hayashi Mikihiro
da6c099dcc remove remove_default 2025-07-13 02:03:56 +09:00
Jonathan Brouwer
68066b90b8 Update uitest stderrs
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-12 17:48:52 +02:00
Jonathan Brouwer
a1cfca3d07 Fix clippy & rustdoc-json
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-12 17:48:52 +02:00
Jonathan Brouwer
ef82007ed7 Port #[automatically_derived] to the new attribute parsing infrastructure
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-12 17:48:50 +02:00
A4-Tacks
01f434675b Fix assoc type where clause position 2025-07-12 23:48:41 +08:00
LorrensP-2158466
e3fc6e5348 merge source and target bindings into single field 2025-07-12 17:42:02 +02:00
Jieyou Xu
977e7d4e11 Label clippy changes with T-clippy team label 2025-07-12 23:15:19 +08:00
Jieyou Xu
869c0e729b Hoist the more "special" autolabels to the start of the section 2025-07-12 23:13:46 +08:00
Jieyou Xu
8011058d90 Make it clearer which key-values belong to which autolabel 2025-07-12 23:12:15 +08:00
Antoni Boucher
1954034e34 Comment test that cannot be fixed currently 2025-07-12 10:44:48 -04:00
Antoni Boucher
0bb092a93f Fix building the sysroot 2025-07-12 10:28:44 -04:00
bit-aloo
a9a238ba5b explicitly drop span_guard in wait_for_output 2025-07-12 19:23:58 +05:30
bors
bfc046a4b8 Auto merge of #143624 - tmiasko:copy-prop-borrowed, r=cjgillot
Propagate from borrowed locals in CopyProp

r? cjgillot
2025-07-12 13:48:36 +00:00
b-naber
9ed5378cfd replace binding and shadowed_glob on NameResolution with non_glob_binding and glob_binding 2025-07-12 15:06:32 +02:00
bjorn3
10bec8f7de Add change_tracker.rs entry 2025-07-12 12:37:03 +00:00
bjorn3
ccc302baa0 Move --compile-time-deps 2025-07-12 12:34:37 +00:00
Jieyou Xu
6f8a7f0000 Make rustdoc-gui-test dummy compiletest config purpose explicit 2025-07-12 19:07:34 +08:00
bors
915e535244 Auto merge of #143810 - matthiaskrgr:rollup-iw7a23z, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#143403 (Port several trait/coherence-related attributes the new attribute system)
 - rust-lang/rust#143633 (fix: correct assertion to check for 'noinline' attribute presence before removal)
 - rust-lang/rust#143647 (Clarify and expand documentation for std::sys_common dependency structure)
 - rust-lang/rust#143716 (compiler: doc/comment some codegen-for-functions interfaces)
 - rust-lang/rust#143747 (Add target maintainer information for aarch64-unknown-linux-musl)
 - rust-lang/rust#143759 (Fix typos in function names in the `target_feature` test)
 - rust-lang/rust#143767 (Bump `src/tools/x` to Edition 2024 and some cleanups)
 - rust-lang/rust#143769 (Remove support for SwitchInt edge effects in backward dataflow)
 - rust-lang/rust#143770 (build-helper: clippy fixes)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-12 10:46:43 +00:00
Ralf Jung
b703451b34 refine comment
Co-authored-by: Jakub Beránek <berykubik@gmail.com>
2025-07-12 12:11:54 +02:00
Ralf Jung
a0a8e80604 fix clippy_test_deps workspace handling 2025-07-12 12:10:04 +02:00
bit-aloo
57ee3f206c add span to streaming command execution flow 2025-07-12 14:55:30 +05:30
bit-aloo
acbbc18599 fix span for deferred command execution 2025-07-12 14:52:34 +05:30
Ralf Jung
73edfe7b73 clippy: fix test filtering when TESTNAME is empty 2025-07-12 11:11:29 +02:00
Jieyou Xu
b9ae117199 Do not glob-reexport TestMode variants
I would like to introduce `TestSuite` over stringly-typed test suite
names, and some test suite names are the same as test modes, which can
make this very confusing.
2025-07-12 16:17:19 +08:00
Jieyou Xu
4aad9ab8aa Rename Mode to TestMode
It is *critical* that we maintain clear nomenclature in `compiletest`.
We have many types of "modes" in `compiletest` -- pass modes, coverage
modes, compare modes, you name it. `Mode` is also a *super* general
term. Rename it to `TestMode` to leave no room for such ambiguity.

As a follow-up, I also intend to introduce an enum for `TestSuite`, then
rid of all usage of glob re-exported `TestMode::*` enum variants -- many
test suites share the same name as the test mode.
2025-07-12 16:07:20 +08:00
Jieyou Xu
b4dfd51bac Do not allow defaults for Mode and Config
They do not have sensible defaults, and it is crucial that we get them
right.
2025-07-12 15:59:16 +08:00
Jieyou Xu
832b6273bd Move string_enum to util module 2025-07-12 15:57:40 +08:00
Jieyou Xu
33668c1b0e Remove outdated debugger version warning 2025-07-12 15:46:08 +08:00
bors
2f9c9cede6 Auto merge of #143766 - matthiaskrgr:rollup-0x7t69s, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#142391 (rust: library: Add `setsid` method to `CommandExt` trait)
 - rust-lang/rust#143302 (`tests/ui`: A New Order [27/N])
 - rust-lang/rust#143303 (`tests/ui`: A New Order [28/28] FINAL PART)
 - rust-lang/rust#143568 (std: sys: net: uefi: tcp4: Add timeout support)
 - rust-lang/rust#143611 (Mention more APIs in `ParseIntError` docs)
 - rust-lang/rust#143661 (chore: Improve how the other suggestions message gets rendered)
 - rust-lang/rust#143708 (fix: Include frontmatter in -Zunpretty output )
 - rust-lang/rust#143718 (Make UB transmutes really UB in LLVM)

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

try-job: i686-gnu-nopt-1
try-job: test-various
2025-07-12 07:44:04 +00:00
Ralf Jung
b0e4c3594f ./x test miri: fix cleaning the miri_ui directory 2025-07-12 09:40:35 +02:00
Ralf Jung
91a52cac82 Merge pull request #4465 from RalfJung/readme-strict-provenance
readme: update strict provenance link
2025-07-12 07:20:28 +00:00