about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-08-26Rollup merge of #145821 - lolbinarycat:compiletest-error-show, r=clubby789Stuart Cook-2/+3
compiletest: if a compiler fails, show its output Before, when working on something like a `rustdoc-js` test, if you made a syntax error in a rust file, you would not get that error output unless you ran with `--verbose`, which would also cause an enormous amount of other output to be printed as well. This can also lead to frustration in new contributors who don't think to run with `--verbose`. Now, if rustc or rustdoc is run by compiletest and produces an non-zero exit code, its output will be printed.
2025-08-26Rollup merge of #145766 - epage:rustfmt, r=calebcartwrightStuart Cook-0/+74
test(rustfmt): Verify frontmatter is preserved This is to prove that the frontmatter is preserved. The choices in tests is intended for showing the different parts of the proposed Style Guide for frontmatters (rust-lang/rust#145617). While rustfmt is developed in a different repo, work involving upstream integration is blocked on some work that is being finished up in that repo. I was told that it would be ok to post against this repo in the mean time. Tracking issue: rust-lang/rust#136889
2025-08-25Update wasm-component-ld dependencyAlex Crichton-2/+1
Keeping it up-to-date with the latest changes/features.
2025-08-25Merge pull request #20423 from ShoyuVanilla/import-2024Chayim Refael Friedman-50/+219
Make import sorting order follow 2024 edition style
2025-08-25Merge pull request #20528 from ShoyuVanilla/nightly-zscriptChayim Refael Friedman-0/+1
fix: Masquerade as nightly cargo when invoking flycheck with `-Zscript`
2025-08-25Don't map Chalk's `Normalize` to next solver's `NormalizesTo`Chayim Refael Friedman-6/+16
`NormalizesTo` is a private predicate that should not be used outside the solver. For normalization, rustc uses `AliasRelate`, so replace with that.
2025-08-25Normalize all types when finishing inferenceChayim Refael Friedman-0/+29
The new solver does not eagerly normalize, but things after inference expect types to be normalized. rustc does the same. Also, I'm afraid other things in r-a don't expect results of the solver to be unnormalized. We'll need to handle that.
2025-08-25Cache trait solving across queries in the same revisionChayim Refael Friedman-66/+140
Caching trait solving can do a lot to speed. Unfortunately it also consume a huge amount of memory. Therefore, as part of the migration to the new solver Jack Huey disabled caching of trait solving (he made the query transparent). The PR proposes a middle ground: do cache trait solving, but only for the same revision. This allows us to be safe because during a revision the inputs cannot change. The result is hopefully much better performance to features that tend to do a bulk of trait solving, and also repeat the same query (e.g. inference then IDE features). There is another limitation: results are only cached in the same thread, to remove the need for synchronization which will be expensive. More measurements are required to check whether it's better to use a synchronized global cache, or maybe stay with a thread-local cache but batch multiple feature requests (highlighting, inlay hints etc.) of the same file to the same thread. Alongside the actual cache we store the revision, because we need to verify it (we can't eagerly clear caches when incrementing the revision), and also the address of the db to prevent multiple dbs from interleaving (this is mostly relevant in tests, although injected highlighting also uses a new db, therefore maybe it's better to move it to a separate thread). This "games" analysis-stats to both be way faster and use way more memory; the former is because analysis-stats doesn't increment revisions, therefore all queries share the cache and hit ratio is way too good, the latter is because analysis-stats doesn't increment revisions and therefore the cache isn't cleared. Both are not representative of a typical IDE scenario.
2025-08-25Merge pull request #4543 from RalfJung/tb-sifaRalf Jung-12/+12
TB: fix SIFA comment
2025-08-25TB: fix SIFA commentRalf Jung-12/+12
2025-08-25Handle tarballs in `x test tidy`Jakub Beránek-0/+6
2025-08-25Fix ExprStmt delete semicolon for toggle_macro_delimiterA4-Tacks-3/+33
2025-08-25add span to struct pattern rest (..)Valdemar Erk-7/+8
2025-08-25Merge ref 'a1dbb443527b' from rust-lang/rustThe Miri Cronjob Bot-70/+61
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: a1dbb443527bd126452875eb5d5860c1d001d761 Filtered ref: e644bd7324c7e071785356fcaad5bd89e671366b This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-25Prepare for merging from rust-lang/rustThe Miri Cronjob Bot-1/+1
This updates the rust-version file to a1dbb443527bd126452875eb5d5860c1d001d761.
2025-08-24compiletest: if a compiler fails outside a ui test, show its outputbinarycat-2/+3
2025-08-24Fix rust-analyzer-contributors referenceEmmanuel Ferdman-1/+1
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-08-24fix: Masquerade as nightly cargo when invoking flycheck with `-Zscript`Shoyu Vanilla-0/+1
2025-08-24Auto merge of #145384 - ywxt:parallel-tests, r=jieyouxubors-1/+15
Add more tests for the parallel rustc At the moment, the parallel frontend test cases are severely lacking. Althought some reported issues have been resolved, they haven't been added into the tests. This PR arranges the resolved ICE issues and adds tests for them. Whether it is worthwhile to add a separate test suite for the paralel frontend still requires futher discussion. But we are trying coveraging issues being resolved through capability of the existing UI test suite. Discussion: [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/Proposal.20for.20a.20dedicated.20test.20suite.20for.20t.E2.80.A6.20compiler-team.23906) Related issues: - rust-lang/rust#120760 - rust-lang/rust#124423 fixed by rust-lang/rust#140358 - rust-lang/rust#127971 fxied by rust-lang/rust#140358 - rust-lang/rust#120601 fixed by rust-lang/rust#127311 cc `@jieyouxu`
2025-08-24Merge pull request #20523 from ChayimFriedman2/opaque-genericsShoyu Vanilla (Flint)-43/+54
fix: Fix opaque generics
2025-08-24Fix opaque genericsChayim Refael Friedman-43/+54
The parent generics were incorrectly not considered for TAIT. I'm not convinced we should follow rustc here, also there are items (opaques) with more than 1 parent (opaque -> fn/type alias -> impl/trait) and I'm not sure we properly account for that in all places, but for now I left it as-is. Also fix a bug where lifetimes' indices were incorrect when there is a self param (they started from 0 instead of 1).
2025-08-24fmtThe Miri Cronjob Bot-1/+2
2025-08-24Merge ref 'f6d23413c399' from rust-lang/rustThe Miri Cronjob Bot-1098/+1971
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: f6d23413c399fb530be362ebcf25a4e788e16137 Filtered ref: fc132ae45e682a2556f99caed7bca9b8a2e909c8 This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-24Prepare for merging from rust-lang/rustThe Miri Cronjob Bot-1/+1
This updates the rust-version file to f6d23413c399fb530be362ebcf25a4e788e16137.
2025-08-23Rollup merge of #145798 - compiler-errors:unnamed-lt-primary, r=lqdJacob Pratt-2/+2
Use unnamed lifetime spans as primary spans for `MISMATCHED_LIFETIME_SYNTAXES` Fixes https://github.com/rust-lang/rust/issues/145772 This PR changes the primary span(s) of the `MISMATCHED_LIFETIME_SYNTAXES` to point to the *unnamed* lifetime spans in both the inputs and *outputs* of the function signature. As reported in rust-lang/rust#145772, this should make it so that IDEs highlight the spans of the actionable part of this lint, rather than just the (possibly named) input spans like they do today. This could be tweaked further perhaps, for example for `fn foo(_: T<'_>) -> T`, we don't need to highlight the elided lifetime if the actionable part is to change only the return type to `T<'_>`, but I think it's improvement on what's here today, so I think that should be follow-up since I think the logic might get a bit hairy. cc ```@shepmaster```
2025-08-23Rollup merge of #144531 - Urgau:int_to_ptr_transmutes, r=jackh726Jacob Pratt-67/+44
Add lint against integer to pointer transmutes # `integer_to_ptr_transmutes` *warn-by-default* The `integer_to_ptr_transmutes` lint detects integer to pointer transmutes where the resulting pointers are undefined behavior to dereference. ### Example ```rust fn foo(a: usize) -> *const u8 { unsafe { std::mem::transmute::<usize, *const u8>(a) } } ``` ``` warning: transmuting an integer to a pointer creates a pointer without provenance --> a.rs:1:9 | 158 | std::mem::transmute::<usize, *const u8>(a) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this is dangerous because dereferencing the resulting pointer is undefined behavior = note: exposed provenance semantics can be used to create a pointer based on some previously exposed provenance = help: if you truly mean to create a pointer without provenance, use `std::ptr::without_provenance_mut` = help: for more information about transmute, see <https://doc.rust-lang.org/std/mem/fn.transmute.html#transmutation-between-pointers-and-integers> = help: for more information about exposed provenance, see <https://doc.rust-lang.org/std/ptr/index.html#exposed-provenance> = note: `#[warn(integer_to_ptr_transmutes)]` on by default help: use `std::ptr::with_exposed_provenance` instead to use a previously exposed provenance | 158 - std::mem::transmute::<usize, *const u8>(a) 158 + std::ptr::with_exposed_provenance::<u8>(a) | ``` ### Explanation Any attempt to use the resulting pointers are undefined behavior as the resulting pointers won't have any provenance. Alternatively, `std::ptr::with_exposed_provenance` should be used, as they do not carry the provenance requirement or if the wanting to create pointers without provenance `std::ptr::without_provenance_mut` should be used. See [std::mem::transmute] in the reference for more details. [std::mem::transmute]: https://doc.rust-lang.org/std/mem/fn.transmute.html -------- People are getting tripped up on this, see https://github.com/rust-lang/rust/issues/128409 and https://github.com/rust-lang/rust/issues/141220. There are >90 cases like these on [GitHub search](https://github.com/search?q=lang%3Arust+%2Ftransmute%3A%3A%3Cu%5B0-9%5D*.*%2C+%5C*const%2F&type=code). Fixes https://github.com/rust-lang/rust-clippy/issues/13140 Fixes https://github.com/rust-lang/rust/issues/141220 Fixes https://github.com/rust-lang/rust/issues/145523 `@rustbot` labels +I-lang-nominated +T-lang cc `@traviscross` r? compiler
2025-08-24Merge pull request #20507 from A4-Tacks/suggest-return-exprChayim Refael Friedman-3/+54
Add ReturnExpr completion suggest
2025-08-24Add ReturnExpr completion suggestA4-Tacks-3/+54
2025-08-24Merge pull request #20512 from A4-Tacks/arith-op-not-on-selectedChayim Refael Friedman-1/+16
replace_arith_op not applicable on selected
2025-08-24replace_arith_op not applicable on selectedA4-Tacks-1/+16
2025-08-24Add an option to remove reborrows from adjustment inlay hintsChayim Refael Friedman-5/+88
Reborrows are consecutive deref then ref. Make it the default because reborrows are mostly useless to the programmer. Also rename `rust-analyzer.inlayHints.expressionAdjustmentHints.enable: "reborrow"` to `rust-analyzer.inlayHints.expressionAdjustmentHints.enable: "borrows"`, as it's not about reborrows but about any ref/deref and it's confusing with the new setting.
2025-08-23Merge pull request #20513 from A4-Tacks/let-in-let-chainChayim Refael Friedman-3/+17
Add let in let-chain completion support
2025-08-23Use unnamed lifetime spans as primary spans for MISMATCHED_LIFETIME_SYNTAXESMichael Goulet-2/+2
2025-08-23Merge pull request #20518 from A4-Tacks/fix-else-in-in-letChayim Refael Friedman-3/+355
Fix `else` completion in `let _ = if x {} $0`
2025-08-24Adjust clippy lints for rustc `integer_to_ptr_transmutes` lintUrgau-67/+32
2025-08-24Allow `integer_to_ptr_transmutes` in testsUrgau-0/+12
2025-08-23Merge pull request #20511 from A4-Tacks/fix-conv-int-lit-on-selectedChayim Refael Friedman-2/+8
convert_integer_literal not on selected
2025-08-23Merge pull request #4540 from RalfJung/tb-refactorsRalf Jung-144/+116
tree borrows: refactor new-permission logic
2025-08-23refactor tb_rebor: reduce code duplicationRalf Jung-38/+22
2025-08-23tree borrows: refactor new-permission logicRalf Jung-110/+98
2025-08-23Rollup merge of #145781 - Kobzol:clippy-remove-profile, r=lqdSamuel Tardieu-7/+0
Remove profile section from Clippy To avoid workspace warnings. [This](https://github.com/rust-lang/rust/pull/145749) subtree sync started causing warnings in Rust builds (https://github.com/rust-lang/rust/issues/145777) because of the `profile` section in Clippy's `Cargo.toml` file. This profile section was added in https://github.com/rust-lang/rust-clippy/pull/13408 last year, and since it also caused issues then, it was later reverted. However, this change recently reappeared in [this commit](https://github.com/rust-lang/rust-clippy/commit/90364dd178b074db391649eed504564ac26f77c1), so it is again causing issues for rust-lang/rust. This PR removes the profile section again. Fixes: https://github.com/rust-lang/rust/issues/145777
2025-08-23Rollup merge of #145744 - RalfJung:miri-inplace-aliasing, r=compiler-errorsSamuel Tardieu-0/+95
miri: also detect aliasing of in-place argument and return place This is a follow-up to https://github.com/rust-lang/rust/pull/145585 where I forgot to deal with the case of the return place aliasing an in-place argument -- as ``@Amanieu`` mentioned in https://github.com/rust-lang/rust/issues/71117#issuecomment-3212885817, that case must also be forbidden. r? ``@compiler-errors``
2025-08-23Rollup merge of #145729 - nnethercote:dup-packages, r=calebcartwrightSamuel Tardieu-3/+3
Remove two duplicated crates These commits remove `toml-0.5.11` and `dirs-sys-0.4.1`. There are later versions of those same crates already in the tree. Found with `cargo tree -d`. r? ``@jieyouxu``
2025-08-23Rollup merge of #145540 - nia-e:prov-map-range, r=RalfJungSamuel Tardieu-8/+3
interpret/allocation: get_range on ProvenanceMap Helper method to grab all provenances in a given address range for an allocation, making some logic in Miri nicer.
2025-08-23Rollup merge of #143898 - ognevny:opt-dist-rustc-rebuild, r=KobzolSamuel Tardieu-2/+14
opt-dist: rebuild rustc when doing static LLVM builds when building LLVM it's obvious that in case of shared build rustc doesn't need to be recompiled, but with static builds it would be better to compile rustc again to ensure we linked proper library. maybe I didn't understand the pipeline correctly, but it was strange for me to see that in Stage 5 LLVM is built while rustc is not r? ```@Kobzol``` try-job: dist-x86_64-msvc try-job: dist-x86_64-linux
2025-08-23Auto merge of #145567 - clubby789:cargo_update, r=clubby789bors-34/+38
Weekly `cargo update` (with libc pin) Supersedes rust-lang/rust#145516 Manually pins libc for `compiler` and `rustbook` (both of which use rustix), with fixmes to remove this later. ``` compiler & tools dependencies: Locking 28 packages to latest compatible versions Updating anyhow v1.0.98 -> v1.0.99 Updating bitflags v2.9.1 -> v2.9.2 Updating clap v4.5.43 -> v4.5.45 Updating clap_builder v4.5.43 -> v4.5.44 Updating clap_derive v4.5.41 -> v4.5.45 Updating curl v0.4.48 -> v0.4.49 Updating curl-sys v0.4.82+curl-8.14.1 -> v0.4.83+curl-8.15.0 Updating cxx v1.0.166 -> v1.0.168 Updating cxx-build v1.0.166 -> v1.0.168 Updating cxxbridge-cmd v1.0.166 -> v1.0.168 Updating cxxbridge-flags v1.0.166 -> v1.0.168 Updating cxxbridge-macro v1.0.166 -> v1.0.168 Updating glob v0.3.2 -> v0.3.3 Updating object v0.37.2 -> v0.37.3 Updating proc-macro2 v1.0.95 -> v1.0.101 Updating rayon v1.10.0 -> v1.11.0 Updating rayon-core v1.12.1 -> v1.13.0 Updating serde-untagged v0.1.7 -> v0.1.8 Updating socket2 v0.5.10 -> v0.6.0 Updating syn v2.0.104 -> v2.0.106 Updating thiserror v2.0.12 -> v2.0.15 Updating thiserror-impl v2.0.12 -> v2.0.15 Updating uuid v1.17.0 -> v1.18.0 Updating wasm-encoder v0.236.0 -> v0.236.1 Updating wasmparser v0.236.0 -> v0.236.1 Updating wast v236.0.0 -> v236.0.1 Updating wat v1.236.0 -> v1.236.1 note: pass `--verbose` to see 35 unchanged dependencies behind latest library dependencies: Locking 2 packages to latest compatible versions Updating libc v0.2.174 -> v0.2.175 Updating object v0.37.2 -> v0.37.3 note: pass `--verbose` to see 2 unchanged dependencies behind latest rustbook dependencies: Locking 13 packages to latest compatible versions Updating anyhow v1.0.98 -> v1.0.99 Updating bitflags v2.9.1 -> v2.9.2 Updating cc v1.2.32 -> v1.2.33 Updating clap v4.5.43 -> v4.5.45 Updating clap_builder v4.5.43 -> v4.5.44 Updating clap_complete v4.5.56 -> v4.5.57 Updating clap_derive v4.5.41 -> v4.5.45 Updating proc-macro2 v1.0.95 -> v1.0.101 Updating syn v2.0.104 -> v2.0.106 Updating terminal_size v0.4.2 -> v0.4.3 Updating thiserror v2.0.12 -> v2.0.15 Updating thiserror-impl v2.0.12 -> v2.0.15 ```
2025-08-23Auto merge of #145771 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo submodule 12 commits in 71eb84f21aef43c07580c6aed6f806a6299f5042..623d536836b4cde09ce38609232a024d5b25da81 2025-08-17 17:18:56 +0000 to 2025-08-22 19:05:52 +0000 - test(frontmatter): Match test updates in rustc (rust-lang/cargo#15878) - chore: fix some typos in comment (rust-lang/cargo#15877) - Add Arm64 Windows CI jobs (rust-lang/cargo#15790) - suggest workspace hints for boolean dependencies (rust-lang/cargo#15507) - make `UnitGenerator` public in cargo-as-a-library (rust-lang/cargo#15873) - Linting system (rust-lang/cargo#15865) - Switch to using native mdbook fragment redirects (rust-lang/cargo#15861) - docs(profile): revert wrong statement of lto options' optimization (rust-lang/cargo#15855) - docs: avoid ambiguity between update and fetch (rust-lang/cargo#15860) - docs: mention how Cargo fetch git submodules (rust-lang/cargo#15853) - feat(unstable): Added `-Zbuild-dir-new-layout` unstable feature (rust-lang/cargo#15848) - Implement `host`-target substitution (rust-lang/cargo#15838) r? ghost
2025-08-23Merge pull request #4524 from Stypox/tracing-chrome-overhead-rdtscRalf Jung-78/+283
Account for time spent tracing, use RDTSC for faster time
2025-08-23Account for time spent tracing, use RDTSC for faster timeStypox-78/+283
2025-08-23Fix `else` completion in `let _ = if x {} $0`A4-Tacks-3/+355