about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-07-13Rollup merge of #143798 - ↵León Orell Valerian Liehr-28/+5
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-13Rollup merge of #143791 - GuillaumeGomez:update-sysinfo, r=jieyouxuLeón Orell Valerian Liehr-6/+6
Update sysinfo version to `0.36.0` Bugfixes and some new API additions.
2025-07-13Rollup merge of #143782 - jieyouxu:debug-assertions, r=ChrisDentonLeón Orell Valerian Liehr-3/+25
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. https://github.com/rust-lang/rust/blob/855e0fe46e68d94e9f6147531b75ac2d488c548e/src/ci/run.sh#L137-L146 `NO_DEBUG_ASSERTIONS` controls `--enable-debug-assertions` https://github.com/rust-lang/rust/blob/855e0fe46e68d94e9f6147531b75ac2d488c548e/src/bootstrap/configure.py#L124 which sets `--rust.debug-assertions`, which controls *rustc* debug assertions. https://github.com/rust-lang/rust/blob/855e0fe46e68d94e9f6147531b75ac2d488c548e/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-13Auto merge of #143213 - dianne:lower-cond-tweaks, r=cjgillotbors-48/+29
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](https://github.com/rust-lang/rust/blob/5e749eb66f93ee998145399fbdde337e57cd72ef/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-13Auto merge of #140717 - mejrs:diagnostic_lints, r=oli-obkbors-0/+4
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-13remove `remove_default`Hayashi Mikihiro-62/+19
2025-07-12Fix clippy & rustdoc-jsonJonathan Brouwer-4/+8
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-07-12Fix assoc type where clause positionA4-Tacks-5/+75
2025-07-12explicitly drop span_guard in wait_for_outputbit-aloo-1/+5
2025-07-12Add change_tracker.rs entrybjorn3-0/+5
2025-07-12Move --compile-time-depsbjorn3-5/+6
2025-07-12Make rustdoc-gui-test dummy compiletest config purpose explicitJieyou Xu-5/+102
2025-07-12Auto merge of #143810 - matthiaskrgr:rollup-iw7a23z, r=matthiaskrgrbors-41/+86
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-12refine commentRalf Jung-1/+1
Co-authored-by: Jakub Beránek <berykubik@gmail.com>
2025-07-12fix clippy_test_deps workspace handlingRalf Jung-0/+509
2025-07-12add span to streaming command execution flowbit-aloo-1/+15
2025-07-12fix span for deferred command executionbit-aloo-3/+10
2025-07-12clippy: fix test filtering when TESTNAME is emptyRalf Jung-3/+12
2025-07-12Do not glob-reexport `TestMode` variantsJieyou Xu-53/+65
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-12Rename `Mode` to `TestMode`Jieyou Xu-45/+45
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-12Do not allow defaults for `Mode` and `Config`Jieyou Xu-7/+1
They do not have sensible defaults, and it is crucial that we get them right.
2025-07-12Move `string_enum` to `util` moduleJieyou Xu-49/+42
2025-07-12Remove outdated debugger version warningJieyou Xu-11/+0
2025-07-12Auto merge of #143766 - matthiaskrgr:rollup-0x7t69s, r=matthiaskrgrbors-26/+25
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./x test miri: fix cleaning the miri_ui directoryRalf Jung-2/+9
2025-07-12readme: update strict provenance linkRalf Jung-3/+3
2025-07-11Access `wasi_sdk_path` instead of reading environment variable in bootstrapJakub Beránek-1/+1
2025-07-11Merge pull request #20232 from ShoyuVanilla/issue-20225Shoyu Vanilla (Flint)-5/+55
fix: Normalize projection types before calculating memory maps
2025-07-11htmldocck: better error messages for negative raw directivesbinarycat-0/+4
2025-07-11directives.md: build-aux-docs does not work with aux-cratelolbinarycat-1/+1
2025-07-11Update miri for change to random APIJosh Triplett-1/+1
2025-07-11Rollup merge of #143770 - hkBst:build-helper-cleanup, r=KobzolMatthias Krüger-26/+25
build-helper: clippy fixes
2025-07-11Rollup merge of #143767 - hkBst:cleanup-x, r=jieyouxuMatthias Krüger-14/+10
Bump `src/tools/x` to Edition 2024 and some cleanups - Some clippy fixes - Bump `src/tools/x` to Edition 2024
2025-07-11Rollup merge of #143747 - Gelbpunkt:aarch64-musl-maintainer, r=jieyouxuMatthias Krüger-1/+51
Add target maintainer information for aarch64-unknown-linux-musl Mentioning ``@famfo`` so that they can review the documentation. We're both very invested in this target; I originally promoted it to tier 2 with host tools in rust-lang/rust#76420 back in 2020.
2025-07-11Update cargoWeihang Lo-0/+0
2025-07-11remove format short command and push format short command method inside ↵bit-aloo-27/+4
fingerprint impl
2025-07-11Use short command method directly from fingerprintbit-aloo-1/+1
2025-07-11Add a memory map bound check assertion on rendering const sliceShoyu Vanilla-0/+8
2025-07-11Merge pull request #20219 from ChayimFriedman2/expr-store-memChayim Refael Friedman-271/+419
perf: Put the expression stuff in the expression store behind an `Option<Box>`
2025-07-11fix: Normalize projection types before calculating memory mapsShoyu Vanilla-5/+47
2025-07-11Update description for flagbjorn3-139/+139
2025-07-11Update sysinfo version to `0.36.0`Guillaume Gomez-6/+6
2025-07-11Avoid building C++ for rustc_llvm with --compile-time-depsbjorn3-0/+3
This saves about 30s.
2025-07-11Fix fallback for CI_JOB_NAMENikita Popov-1/+1
If CI_JOB_NAME is not specified, it's supposed to fall back to the image name, which is `$image`, not `$IMAGE`. Failing to set the correct CI_JOB_NAME causes failures when running `dist-ohos-*` images locally.
2025-07-11Add --compile-time-deps argument for x checkbjorn3-51/+226
This reduces the amount of time it takes to do the x check for rust-analyzer analysis from 12m16s to 3m34s when the bootstrap compiler is already downloaded.
2025-07-11Disambiguate between rustc vs std having debug assertionsJieyou Xu-3/+25
Additionally, `NO_DEBUG_ASSERTIONS` is set by CI that threads through to the `./configure` script, which is somewhat fragile and "spooky action at a distance". Instead, use env vars controlled by compiletest, whose debug assertion info comes from bootstrap.
2025-07-11Merge pull request #2502 from Kobzol/rustc-josh-sync-ci许杰友 Jieyou Xu (Joe)-102/+9
2025-07-11Merge pull request #20224 from Hmikihiro/migrate_remove_dbgShoyu Vanilla (Flint)-43/+44
Migrate `remove_dbg` assist to use `SyntaxEditor`
2025-07-11Migrate `remove_dbg` assist to use `SyntaxEditor`Hayashi Mikihiro-43/+44
2025-07-11build-helper: clippy fixesMarijn Schouten-26/+25