about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-27Rollup merge of #138999 - jieyouxu:spellout-pass-mode, r=wesleywiserJacob Pratt-12/+17
Report compiletest pass mode if forced This is very non-obvious if it fails in PR CI, because the starting invocation is miles away from the final test suite outcome.
2025-03-27Rollup merge of #138989 - m-ou-se:clean-up-things, ↵Jacob Pratt-47/+35
r=jdonszelmann,dingxiangfei2009 Clean up a few things in rustc_hir_analysis::check::region Each commit is independent. They are all small clean-ups in rustc_hir_analysis::check::region.
2025-03-27Rollup merge of #138926 - nnethercote:less-kw-Empty-rustc_middle, r=lcnrJacob Pratt-20/+11
Remove `kw::Empty` uses from `rustc_middle`. There are several places in `rustc_middle` that check for an empty lifetime name. These checks appear to be totally unnecessary, because empty lifetime names aren't produced here. (Empty lifetime names *are* possible in `hir::Lifetime`. Perhaps there was some confusion between it and the `rustc_middle` types?) This commit removes the `kw::Empty` checks. r? `@lcnr`
2025-03-27Rollup merge of #138844 - petrochenkov:cfgtrace2, r=nnethercoteJacob Pratt-108/+88
expand: Leave traces when expanding `cfg` attributes This is the same as https://github.com/rust-lang/rust/pull/138515, but for `cfg(true)` instead of `cfg_attr`. The difference is that `cfg(true)`s already left "traces" after themselves - the `cfg` attributes themselves, with `expanded_inert_attrs` set to true, with full tokens, available to proc macros. This is not a reasonably expected behavior, but it could not be removed without a replacement, because a [major rustdoc feature](https://github.com/rust-lang/rfcs/pull/3631) and a number of clippy lints rely on it. This PR implements a replacement. This needs a crater run, because it changes observable behavior (in an intended way) - proc macros can no longer see expanded `cfg(true)` attributes. (Some minor unnecessary special casing for `sym::cfg_attr` is also removed in this PR.) r? `@nnethercote`
2025-03-27Remove `kw::Empty` uses from `src/librustdoc`.Nicholas Nethercote-6/+3
Much like the ones in the previous commit.
2025-03-27Auto merge of #139012 - Zalathar:rollup-qgt5yfo, r=Zalatharbors-311/+733
Rollup of 10 pull requests Successful merges: - #130883 (Add environment variable query) - #138624 (Add mipsel maintainer) - #138672 (Avoiding calling queries when collecting active queries) - #138935 (Update wg-prio triagebot config) - #138946 (Un-bury chapters from the chapter list in rustc book) - #138964 (Implement lint against using Interner and InferCtxtLike in random compiler crates) - #138977 (Don't deaggregate InvocationParent just to reaggregate it again) - #138980 (Collect items referenced from var_debug_info) - #138985 (Use the correct binder scope for elided lifetimes in assoc consts) - #138987 (Always emit `native-static-libs` note, even if it is empty) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-27Rollup merge of #138987 - madsmtm:fix-108825, r=jieyouxuStuart Cook-9/+21
Always emit `native-static-libs` note, even if it is empty Fixes https://github.com/rust-lang/rust/issues/108825. Retry of https://github.com/rust-lang/rust/pull/121216, finally got around to fixing the test, the errors in that PR were because `libcore` uses the `#[link]` attribute on MSVC. try-job: x86_64-msvc r? wesleywiser
2025-03-27Rollup merge of #138985 - oli-obk:push-mvlqmtmyozro, r=compiler-errorsStuart Cook-59/+51
Use the correct binder scope for elided lifetimes in assoc consts Beyond diagnostics this has no real effect, and it's also just about a future incompat lint. But it causes ICEs in some refactorings that I'm doing, so trying to get it out of the way
2025-03-27Rollup merge of #138980 - tmiasko:collect-var-debug-info, r=compiler-errorsStuart Cook-1/+30
Collect items referenced from var_debug_info The collection is limited to full debuginfo builds to match behavior of FunctionCx::compute_per_local_var_debug_info. Fixes #138942.
2025-03-27Rollup merge of #138977 - oli-obk:invoc-parent-keep-aggregated, ↵Stuart Cook-24/+15
r=compiler-errors Don't deaggregate InvocationParent just to reaggregate it again Also makes it easier to add more things to it in the future (which I am doing in some local experiments, so not really a reason to do this just now, but I think this PR stands on its own).
2025-03-27Rollup merge of #138964 - compiler-errors:usage-of-interner, r=lcnrStuart Cook-47/+139
Implement lint against using Interner and InferCtxtLike in random compiler crates Often `Interner` defines similar methods to `TyCtxt` (but often simplified due to the simpler API surface of the type system layer for the new solver), which people will either unintentionally or intentionally import and use. Let's discourage that. r? lcnr
2025-03-27Rollup merge of #138946 - Urgau:platform-support-bottom, r=jieyouxuStuart Cook-13/+16
Un-bury chapters from the chapter list in rustc book This PR moves the "Platform Support" section to the bottom of rustc chapter book, as to un-burry chapters from the chapter list, which where hidden by the wall of targets. | Before | After | |--------|-------| | ![image](https://github.com/user-attachments/assets/92769307-eadb-4d9d-bdbb-9e610207eb79) | ![image](https://github.com/user-attachments/assets/1834f5c5-a1e6-4674-9be2-1094d1376eda) | r? ````@jieyouxu````
2025-03-27Rollup merge of #138935 - apiraino:update-wg-prio-triagebot-config, r=lqdStuart Cook-2/+2
Update wg-prio triagebot config This completes the Zulip channel renaming after https://github.com/rust-lang/compiler-team/issues/848 Just nits: fixed a documentation link and the name of the Zulip channel for prioritization alerts. r? ````@davidtwco````
2025-03-27Rollup merge of #138672 - Zoxc:deferred-queries-in-deadlock-handler, r=oli-obkStuart Cook-148/+311
Avoiding calling queries when collecting active queries This PR changes active query collection to no longer call queries. Instead the fields needing queries have their computation delayed to when an cycle error is emitted or when printing the query backtrace in a panic. This is done by splitting the fields in `QueryStackFrame` needing queries into a new `QueryStackFrameExtra` type. When collecting queries `QueryStackFrame` will contain a closure that can create `QueryStackFrameExtra`, which does make use of queries. Calling `lift` on a `QueryStackFrame` or `CycleError` will convert it to a variant containing `QueryStackFrameExtra` using those closures. This also only calls queries needed to collect information on a cycle errors, instead of information on all active queries. Calling queries when collecting active queries is a bit odd. Calling queries should not be done in the deadlock handler at all. This avoids the out of memory scenario in https://github.com/rust-lang/rust/issues/124901.
2025-03-27Rollup merge of #138624 - LukasWoodtli:gardena/lw/mipsel-maintainer, r=jieyouxuStuart Cook-1/+30
Add mipsel maintainer
2025-03-27Rollup merge of #130883 - madsmtm:env-var-query, r=petrochenkovStuart Cook-7/+118
Add environment variable query Generally, `rustc` prefers command-line arguments, but in some cases, an environment variable really is the most sensible option. We should make sure that this works properly with the compiler's change-tracking mechanisms, such that changing the relevant environment variable causes a rebuild. This PR is a first step forwards in doing that. Part of the work needed to do https://github.com/rust-lang/rust/issues/118204, see https://github.com/rust-lang/rust/pull/129342 for some discussion. r? ``@petrochenkov``
2025-03-27Auto merge of #138915 - compiler-errors:binder-tweak, r=lcnrbors-32/+16
Instantiate binder before registering nested obligations for auto/built-in traits Instead of turning a `Binder<Vec<Ty>>` into a bunch of higher-ranked predicates, instantiate the binder eagerly *once* and turn them into a bunch of non-higher-ranked predicates. Right now this feels like a noop, but this `enter_forall_and_leak_universe` call would be the singular place where we could instantiate bound lifetime assumptions for coroutine witnesses... if we had them. Thus consolidating the binder instantiation here is useful if we want to fix the coroutine-auto-trait problem. r? lcnr
2025-03-27Auto merge of #139005 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 10 commits in 307cbfda3119f06600e43cd38283f4a746fe1f8b..a6c604d1b8a2f2a8ff1f3ba6092f9fda42f4b7e9 2025-03-20 20:00:39 +0000 to 2025-03-26 18:11:00 +0000 - fix(package): update tracking issue for `--message-format` (rust-lang/cargo#15354) - docs(contrib): Expand the description of team meetings (rust-lang/cargo#15349) - feat(package): add unstable `--message-format` flag (rust-lang/cargo#15311) - feat(complete): Added completion for `--profile` (rust-lang/cargo#15308) - Uplift windows Cygwin DLL import libraries (rust-lang/cargo#15193) - do not pass cdylib link args to test (rust-lang/cargo#15317) - fix: revert the behavior checking lockfile's VCS status (rust-lang/cargo#15341) - Temporarily ignore cargo_test_doctest_xcompile_ignores (rust-lang/cargo#15348) - docs: fix typo in the "Shared cache" section (rust-lang/cargo#15346) - Fix some issues with future-incompat report generation (rust-lang/cargo#15345) r? ghost
2025-03-26Auto merge of #138996 - CAD97:use_cfg_match, r=joboetbors-118/+53
Use `cfg_match!` in core All of these uses of `cfg_if!` do not utilize that `cfg_if!` works with auto-`doc(cfg)`, so no functionality is lost from switching to use `cfg_match!` instead. We *do* lose what rustfmt special support exists for `cfg_if!`, though. Tracking issue: #115585
2025-03-26Update cargoWeihang Lo-0/+0
2025-03-26Always emit native-static-libs note, even if it is emptyMads Marquart-9/+21
2025-03-27Report compiletest pass mode if forcedJieyou Xu-12/+17
This is very non-obvious if it fails in PR CI.
2025-03-26Use cfg_match in coreChristopher Durham-118/+53
2025-03-26Auto merge of #138824 - Zoxc:dep-graph-no-prev-map, r=oli-obkbors-185/+144
Remove `prev_index_to_index` field from `CurrentDepGraph` The dep graph currently has 2 ways to map a previous index into a current index. The `prev_index_to_index` map stores the current index equivalent of a previous index. For indices which are marked green, we also store the same information in the `DepNodeColorMap`. We actually only need to known the mapping for green nodes however, so this PR removes `prev_index_to_index` and instead makes use of the `DepNodeColorMap`. To avoid racing when promoting a node from the previous session, the encoder lock is now used to ensure only one thread encodes the promoted node. This was previously done by the lock in `prev_index_to_index`. This also changes `nodes_newly_allocated_in_current_session` used to detect duplicate dep nodes to contain both new and previous nodes, which is simpler and can better catch duplicates. The dep node index encoding used in `DepNodeColorMap` is tweak to avoid subtraction / addition to optimize accessing the current equivalent of a previous index. r? `@oli-obk`
2025-03-26Remove ScopeDepth from var_parent.Mara Bos-10/+16
It was never used.
2025-03-26Don't set cx.parent to None; it seems unnecessary.Mara Bos-2/+1
2025-03-26Simplify RvalueCandidateType.Mara Bos-34/+19
There is no difference between the Patternand Borrow cases. Reduce it to a simple struct.
2025-03-26Don't record child scopes for patterns.Mara Bos-2/+0
They are unused.
2025-03-26Add environment variable tracking in places where it was convenientMads Marquart-6/+7
This won't work with Cargo's change tracking, but it should work with incremental.
2025-03-26Add `TyCtx::env_var_os`Mads Marquart-1/+75
Along with `TyCtx::env_var` helper. These can be used to track environment variable accesses in the query system. Since `TyCtx::env_var_os` uses `OsStr`, this commit also adds the necessary trait implementations for that to work.
2025-03-26Auto merge of #130324 - petrochenkov:ctxtache, r=oli-obkbors-73/+120
hygiene: Ensure uniqueness of `SyntaxContextData`s `SyntaxContextData`s are basically interned with `SyntaxContext`s working as indices, so they are supposed to be unique. However, currently duplicate `SyntaxContextData`s can be created during decoding from metadata or incremental cache. This PR fixes that. cc https://github.com/rust-lang/rust/pull/129827#discussion_r1759074553
2025-03-26Test that env! works with incremental compilationMads Marquart-0/+36
This currently works because it's part of expansion, and that isn't yet tracked by the query system. But we want to ensure it continues working, even if that is changed.
2025-03-26Use the correct binder scope for elided lifetimes in assoc constsOli Scherer-59/+51
2025-03-26expand: Leave traces when expanding `cfg` attributesVadim Petrochenkov-108/+88
2025-03-26Use a function to create `QueryStackDeferred` to ensure context is CopyJohn Kåre Alsaker-36/+48
2025-03-26Auto merge of #138974 - Zalathar:rollup-568cpmy, r=Zalatharbors-745/+896
Rollup of 7 pull requests Successful merges: - #138483 (Target modifiers fix for bool flags without value) - #138818 (Don't produce debug information for compiler-introduced-vars when desugaring assignments.) - #138898 (Mostly parser: Eliminate code that's been dead / semi-dead since the removal of type ascription syntax) - #138930 (Add bootstrap step diff to CI job analysis) - #138954 (Ensure `define_opaque` attrs are accounted for in HIR hash) - #138959 (Revert "Make MatchPairTree::place non-optional") - #138967 (Fix typo in error message) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-26Collect items referenced from var_debug_infoTomasz Miąsko-1/+30
The collection is limited to full debuginfo builds to match behavior of FunctionCx::compute_per_local_var_debug_info.
2025-03-26Don't deaggregate InvocationParent just to reaggregate it againOli Scherer-24/+15
2025-03-26Rollup merge of #138967 - thaliaarchi:error-typo, r=NoratriebStuart Cook-1/+1
Fix typo in error message Fix typo from https://github.com/rust-lang/rust/pull/137809. r? `@Noratrieb`
2025-03-26Rollup merge of #138959 - meithecatte:matchpair-place-option, r=ZalatharStuart Cook-9/+34
Revert "Make MatchPairTree::place non-optional" Reverts a part of #137875. Fixes #138958. cc `@Zalathar`
2025-03-26Rollup merge of #138954 - compiler-errors:hash-opaques, r=oli-obkStuart Cook-3/+28
Ensure `define_opaque` attrs are accounted for in HIR hash Fixes #138948 r? oli-obk
2025-03-26Rollup merge of #138930 - Kobzol:analyze-bootstrap-diffs, r=marcoieniStuart Cook-51/+178
Add bootstrap step diff to CI job analysis This PR adds another analysis to the job analysis report in GitHub summary. It compares (diffs) bootstrap steps executed by the parent run and by the current commit. This will help us figure out if the bootstrap invocation did something different than before, and also how did the duration of individual steps and bootstrap invocations change. Can be tested on the https://github.com/rust-lang/rust/pull/119899 PR like this: ```bash $ curl https://ci-artifacts.rust-lang.org/rustc-builds/3d3394eb64ee2f99ad1a2b849b376220fd38263e/metrics-mingw-check.json > metrics.json $ cargo run --manifest-path src/ci/citool/Cargo.toml postprocess-metrics metrics.json --job-name mingw-check --parent 961351c76c812e3aeb65bfb542742500a6436aed > out.md ``` r? `@marcoie`
2025-03-26Rollup merge of #138898 - fmease:decrustify-parser-post-ty-ascr, ↵Stuart Cook-616/+411
r=compiler-errors Mostly parser: Eliminate code that's been dead / semi-dead since the removal of type ascription syntax **Disclaimer**: This PR is intended to mostly clean up code as opposed to bringing about behavioral changes. Therefore it doesn't aim to address any of the 'FIXME: remove after a month [dated: 2023-05-02]: "type ascription syntax has been removed, see issue [#]101728"'. --- By commit: 1. Removes truly dead code: * Since 1.71 (#109128) `let _ = { f: x };` is a syntax error as opposed to a semantic error which allows the parse-time diagnostic (suggestion) "*struct literal body without path // you might have forgotten […]*" to kick in. * The analysis-time diagnostic (suggestion) from <=1.70 "*cannot find value \`f\` in this scope // you might have forgotten […]*" is therefore no longer reachable. 2. Updates `is_certainly_not_a_block` to be in line with the current grammar: * The seq. `{ ident:` is definitely not the start of a block. Before the removal of ty ascr, `{ ident: ty_start` would begin a block expr. * This shouldn't make more code compile IINM, it should *ultimately* only affect diagnostics. * For example, `if T { f: () } {}` will now be interpreted as an `if` with struct lit `T { f: () }` as its *condition* (which is banned in the parser anyway) as opposed to just `T` (with the *consequent* being `f : ()` which is also invalid (since 1.71)). The diagnostics are almost the same because we have two separate parse recovery procedures + diagnostics: `StructLiteralNeedingParens` (*invalid struct lit*) before and `StructLiteralNotAllowedHere` (*struct lits aren't allowed here*) now, as you can see from the diff. * (As an aside, even before this PR, fn `maybe_suggest_struct_literal` should've just used the much older & clearer `StructLiteralNotAllowedHere`) * NB: This does sadly regress the compiler output for `tests/ui/parser/type-ascription-in-pattern.rs` but that can be fixed in follow-up PRs. It's not super important IMO and a natural consequence. 3. Removes code that's become dead due to the prior commit. * Basically reverts #106620 + #112475 (without regressing rustc's output!). * Now the older & more robust parse recovery procedure (cc `StructLiteralNotAllowedHere`) takes care of the cases the removed code used to handle. * This automatically fixes the suggestions for \[[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=7e2030163b11ee96d17adc3325b01780)\]: * `if Ty::<i32> { f: K }.m() {}`: `if Ty::<i32> { SomeStruct { f: K } }.m() {}` (broken) → ` if (Ty::<i32> { f: K }).m() {}` * `if <T as Trait>::Out { f: K::<> }.m() {}`: `if <T as Trait>(::Out { f: K::<> }).m() {}` (broken) → `if (<T as Trait>::Out { f: K::<> }).m() {}` 4. Merge and simplify UI tests pertaining to this issue, so it's easier to add more regression tests like for the two cases mentioned above. 5. Merge UI tests and add the two regression tests. Best reviewed commit by commit (on request I'll partially squash after approval).
2025-03-26Rollup merge of #138818 - khuey:138198, r=jieyouxuStuart Cook-16/+60
Don't produce debug information for compiler-introduced-vars when desugaring assignments. An assignment such as (a, b) = (b, c); desugars to the HIR { let (lhs, lhs) = (b, c); a = lhs; b = lhs; }; The repeated `lhs` leads to multiple Locals assigned to the same DILocalVariable. Rather than attempting to fix that, get rid of the debug info for these bindings that don't even exist in the program to begin with. Fixes #138198 r? `@jieyouxu`
2025-03-26Rollup merge of #138483 - azhogin:azhogin/target-modifiers-bool-fix, r=fee1-deadStuart Cook-49/+184
Target modifiers fix for bool flags without value Fixed support of boolean flags without values: `-Zbool-flag` is now consistent with `-Zbool-flag=true` in another crate. When flag is explicitly set to default value, target modifier will not be set in crate metainfo (`-Zflag=false` when `false` is a default value for the flag). Improved error notification when target modifier flag is absent in a crate ("-Zflag unset"). Example: ``` note: `-Zreg-struct-return=true` in this crate is incompatible with unset `-Zreg-struct-return` in dependency `default_reg_struct_return` ```
2025-03-26Avoiding calling queries when collecting active queriesJohn Kåre Alsaker-162/+313
2025-03-26Auto merge of #138893 - klensy:thorin-0.9, r=Mark-Simulacrumbors-46/+13
bump thorin to 0.9 to drop duped deps Bumps `thorin`, removing duped deps. This also changes features for hashbrown: ``` hashbrown v0.15.2 `-- indexmap v2.7.0 |-- object v0.36.7 |-- wasmparser v0.219.1 |-- wasmparser v0.223.0 `-- wit-component v0.223.0 |-- indexmap feature "default" |-- indexmap feature "serde" `-- indexmap feature "std" |-- hashbrown feature "default-hasher" | |-- object v0.36.7 (*) | `-- wasmparser v0.223.0 (*) |-- hashbrown feature "nightly" | |-- rustc_data_structures v0.0.0 | `-- rustc_query_system v0.0.0 `-- hashbrown feature "serde" `-- wasmparser feature "serde" ``` to ``` hashbrown v0.15.2 `-- indexmap v2.7.0 |-- object v0.36.7 |-- wasmparser v0.219.1 |-- wasmparser v0.223.0 `-- wit-component v0.223.0 |-- indexmap feature "default" |-- indexmap feature "serde" `-- indexmap feature "std" |-- hashbrown feature "allocator-api2" | `-- hashbrown feature "default" |-- hashbrown feature "default" (*) |-- hashbrown feature "default-hasher" | |-- object v0.36.7 (*) | `-- wasmparser v0.223.0 (*) | `-- hashbrown feature "default" (*) |-- hashbrown feature "equivalent" | `-- hashbrown feature "default" (*) |-- hashbrown feature "inline-more" | `-- hashbrown feature "default" (*) |-- hashbrown feature "nightly" | |-- rustc_data_structures v0.0.0 | `-- rustc_query_system v0.0.0 |-- hashbrown feature "raw-entry" | `-- hashbrown feature "default" (*) `-- hashbrown feature "serde" `-- wasmparser feature "serde" ``` To be safe, as this can be perf-sensitive: `@bors` rollup=never
2025-03-25Fix typo in error messageThalia Archibald-1/+1
2025-03-26Stop using Interner in the compiler randomlyMichael Goulet-5/+7
2025-03-26Implement lint against using Interner and InferCtxtLike in random compiler ↵Michael Goulet-3/+82
crates