about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2025-09-10tidy: Print crate name on dependency errorclubby789-1/+2
2025-09-10this apparently needs more test roundsRalf Jung-3/+11
2025-09-10tidy: Introduce `WorkspaceInfo` struct for deps informationclubby789-36/+73
2025-09-10move all weak memory tests into their folderRalf Jung-2/+2
2025-09-10also use nicer check_all_outcomes in float_nanRalf Jung-177/+142
2025-09-10refactor weak-mem test to list all expected executionsRalf Jung-103/+114
2025-09-10ensure we do not see the inconsistent execution from Figure 8Ralf Jung-1/+10
2025-09-10weak memory tests: add more info on where they come fromRalf Jung-11/+14
2025-09-10interpret: fix overlapping aggregate initializationRalf Jung-7/+63
2025-09-10bless miri testsjoboet-24/+24
2025-09-10Rollup merge of #146378 - alexcrichton:update-wasm-component-ld, r=lqdMatthias Krüger-1/+1
Update wasm-component-ld to 0.5.17 Keeping this up-to-date as the project itself, and its dependencies, are updated.
2025-09-10Rollup merge of #146178 - folkertdev:static-align, ↵Matthias Krüger-0/+14
r=jdonszelmann,ralfjung,traviscross Implement `#[rustc_align_static(N)]` on `static`s Tracking issue: https://github.com/rust-lang/rust/issues/146177 ```rust #![feature(static_align)] #[rustc_align_static(64)] static SO_ALIGNED: u64 = 0; ``` We need a different attribute than `rustc_align` because unstable attributes are tied to their feature (we can't have two unstable features use the same unstable attribute). Otherwise this uses all of the same infrastructure as `#[rustc_align]`. r? `@traviscross`
2025-09-10Rollup merge of #144765 - Qelxiros:range-inclusive-last, r=jhprattMatthias Krüger-1/+0
inclusive `Range`s: change `end` to `last` Tracking issue: rust-lang/rust#125687 ACP: rust-lang/libs-team#511
2025-09-10Merge pull request #20649 from ChayimFriedman2/cast-unknownShoyu Vanilla (Flint)-6/+25
fix: Always coerce in a cast, even when there are unknown types
2025-09-10Always coerce in a cast, even when there are unknown typesChayim Refael Friedman-6/+25
This cause the relationships between inference vars to get recorded.
2025-09-10Merge pull request #20645 from ChayimFriedman2/update-rustcShoyu Vanilla (Flint)-330/+468
internal: Upgrade rustc crates
2025-09-10Merge pull request #20647 from ChayimFriedman2/ns-projectionsShoyu Vanilla (Flint)-199/+266
fix: Fix normalization in the new solver
2025-09-10Properly handle normalizationChayim Refael Friedman-198/+235
Previously normalization was broken, which caused a lot of fake errors. This fix most type mismatches of the new solver, and it also reverts many test regressions. The downside is that now `chalk_ir::TyKind::AssociatedType`/`chalk_ir::TyKind::Alias` cannot be trusted anymore with their roles, namely: `AssociatedType` is always fully normalized and `Alias` only if it can possibly be normalized further. That seems okay as the new solver does not have this distinction at all (due to it being a lazy normalizer), so this will only hold for the migration time. This does mean we have to change some APIs, notably `hir::Type::walk()` and `TyFingerprint`, to treat `Alias` the same as `AssociatedType`. Another small thing this commit does is to isolate processing of user-written types (currently involving replacing error types and normalizing, but in the future validation will also be needed) to separate functions.
2025-09-10An associated type is not a projection!Chayim Refael Friedman-1/+31
More correctly, a `TyKind::AssociatedType` is not the same as `TyKind::Projection`. We used to map next-solver `TyKind::Alias` to Chalk's `TyKind::AssociatedType`. This is very incorrect, as `AssociatedType` is assumed to be fully normalized, and caused a lot of type mismatches. Unfortunately fixing this causes a lot of stack overflows, because the next solver doesn't have something akin to `AssociatedType` so we normalize again and again. The reason is that is the lazy-normalization nature of the next solver, which means we need to stop normalizing everything. This will be fixed in the next commit.
2025-09-10Adopt even more custom types in the new solverChayim Refael Friedman-222/+220
A lot of simplification and fun.
2025-09-10Upgrade rustc crates and handle changes to canonicalizationChayim Refael Friedman-116/+256
They have to do with diagnostics, we could probably not support them but we will also someday want good diagnostics. The code is mostly copied from rustc.
2025-09-09allow `#[rustc_align_static(N)]` on `static`sFolkert de Vries-0/+14
We need a different attribute than `rustc_align` because unstable attributes are tied to their feature (we can't have two unstable features use the same unstable attribute). Otherwise this uses all of the same infrastructure as `#[rustc_align]`.
2025-09-09Merge pull request #20613 from A4-Tacks/diag-unresolved-field-fixes-wsDavid Barsky-13/+52
Fix indent for unresolved_field fixes
2025-09-09Auto merge of #146375 - matthiaskrgr:rollup-utik9zj, r=matthiaskrgrbors-2/+0
Rollup of 6 pull requests Successful merges: - rust-lang/rust#145463 (Reject invalid literal suffixes in tuple indexing, tuple struct indexing, and struct field name position) - rust-lang/rust#145929 (fix APITIT being treated as a normal generic parameter in suggestions) - rust-lang/rust#146001 (Update getopts to remove unicode-width dependency) - rust-lang/rust#146365 (triagebot: warn about #[rustc_intrinsic_const_stable_indirect]) - rust-lang/rust#146366 (add approx_delta to all gamma tests) - rust-lang/rust#146373 (fix comments about trait solver cycle heads) r? `@ghost` `@rustbot` modify labels: rollup
2025-09-09Strip frontmatter in fewer placesLeón Orell Valerian Liehr-10/+20
2025-09-09Update wasm-component-ld to 0.5.17Alex Crichton-1/+1
Keeping this up-to-date as the project itself, and its dependencies, are updated.
2025-09-09Merge pull request #20639 from ChayimFriedman2/update-test-absDavid Barsky-23/+85
fix: Resolve paths to snapshot test libraries absolutely
2025-09-10Fix failing tests and fill-in missing detailsShoyu Vanilla-1428/+914
2025-09-09Rollup merge of #146001 - bjorn3:update_getopts, r=davidtwcoMatthias Krüger-1/+0
Update getopts to remove unicode-width dependency Pulls in https://github.com/rust-lang/getopts/pull/133. This saves 1.5MB on the vendored size of the standard library.
2025-09-09Rollup merge of #145463 - jieyouxu:error-suffix, r=fmeaseMatthias Krüger-1/+0
Reject invalid literal suffixes in tuple indexing, tuple struct indexing, and struct field name position Tracking issue: rust-lang/rust#60210 Closes rust-lang/rust#60210 ## Summary Bump the ["suffixes on a tuple index are invalid" non-lint pseudo future-incompatibility warning (#60210)][issue-60210][^non-lint] to a **hard error** across all editions, rejecting the remaining carve outs from accidentally accepted invalid suffixes since Rust **1.27**. - We accidentally accepted invalid suffixes in tuple indexing positions in Rust **1.27**. Originally reported at https://github.com/rust-lang/rust/issues/59418. - We tried to hard reject all invalid suffixes in https://github.com/rust-lang/rust/pull/59421, but unfortunately it turns out there were proc macros accidentally relying on it: https://github.com/rust-lang/rust/issues/60138. - We temporarily accepted `{i,u}{32,size}` in https://github.com/rust-lang/rust/pull/60186 (the "*carve outs*") to mitigate *immediate* ecosystem impact, but it came with an FCW warning indicating that we wanted to reject it after a few Rust releases. - Now (1.89.0) is a few Rust releases later (1.35.0), thus I'm proposing to **also reject the carve outs**. - `std::mem::offset_of!` stabilized in Rust **1.77.0** happens to use the same "don't expect suffix" code path which has the carve outs, so it also accepted the carve out suffixes. I'm proposing to **reject this case as well**. ## What specifically breaks? Code that still relied on invalid `{i,u}{32,size}` suffixes being temporarily accepted by rust-lang/rust#60186 as an ecosystem impact mitigation measure (cf. rust-lang/rust#60138). Specifically, the following cases (particularly the construction of these forms in proc macros like reported in rust-lang/rust#60138): ### Position 1: Invalid `{i,u}{32,size}` suffixes in tuple indexing ```rs fn main() { let _x = (42,).0invalid; // Already error, already rejected by #59421 let _x = (42,).0i8; // Already error, not one of the #60186 carve outs. let _x = (42,).0usize; // warning: suffixes on a tuple index are invalid } ``` ### Position 2: Invalid `{i,u}{32,size}` suffixes in tuple struct indexing ```rs fn main() { struct X(i32); let _x = X(42); let _x = _x.0invalid; // Already error, already rejected by #59421 let _x = _x.0i8; // Already error, not one of the #60186 carve outs. let _x = _x.0usize; // warning: suffixes on a tuple index are invalid } ``` ### Position 3: Invalid `{i,u}{32,size}` suffixes in numeric struct field names ```rs fn main() { struct X(i32, i32, i32); let _x = X(1, 2, 3); let _y = X { 0usize: 42, 1: 42, 2: 42 }; // warning: suffixes on a tuple index are invalid match _x { X { 0usize: 1, 1: 2, 2: 3 } => todo!(), // warning: suffixes on a tuple index are invalid _ => {} } } ``` ### Position 4: Invalid `{i,u}{32,size}` suffixes in `std::mem::offset_of!` While investigating the warning, unfortunately I noticed `std::mem::offset_of!` also happens to use the "expect no suffix" code path which had the carve outs. So this was accepted since Rust **1.77.0** with the same FCW: ```rs fn main() { #[repr(C)] pub struct Struct<T>(u8, T); assert_eq!(std::mem::offset_of!(Struct<u32>, 0usize), 0); //~^ WARN suffixes on a tuple index are invalid } ``` ### The above forms in proc macros For instance, constructions like (see tracking issue rust-lang/rust#60210): ```rs let i = 0; quote! { foo.$i } ``` where the user needs to actually write ```rs let i = syn::Index::from(0); quote! { foo.$i } ``` ### Crater results Conducted a crater run (https://github.com/rust-lang/rust/pull/145463#issuecomment-3194920383). - https://github.com/AmlingPalantir/r4/tree/256af3c72f094b298cd442097ef7c571d8001f29: genuine regression; "invalid suffix `usize`" in derive macro. Has a ton of other build warnings, last updated 6 years ago. - Exactly the kind of intended breakage. Minimized down to https://github.com/AmlingPalantir/r4/blob/256af3c72f094b298cd442097ef7c571d8001f29/validates_derive/src/lib.rs#L71-L75, where when interpolation uses `quote`'s `ToTokens` on a `usize` index (i.e. on tuple struct `Tup(())`), the generated suffix becomes `.0usize` (cf. Position 2). - Notified crate author of breakage in https://github.com/AmlingPalantir/r4/issues/1. - Other failures are unrelated or spurious. ## Review remarks - Commits 1-3 expands the test coverage to better reflect the current situation before doing any functional changes. - Commit 4 is an intentional **breaking change**. We bump the non-lint "suffixes on a tuple index are invalid" warning into a hard error. Thus, this will need a crater run and a T-lang FCP. ## Tasks - [x] Run crater to check if anyone is still relying on this being not a hard error. Determine degree of ecosystem breakage. - [x] If degree of breakage seems acceptable, draft nomination report for T-lang for FCP. - [x] Determine hard error on Edition 2024+, or on all editions. ## Accompanying Reference update - https://github.com/rust-lang/reference/pull/1966 [^non-lint]: The FCW was implemented as a *non-lint* warning (meaning it has no associated lint name, and you can't `#![deny(..)]` it) because spans coming from proc macros could not be distinguished from regular field access. This warning was also intentionally impossible to silence. See https://github.com/rust-lang/rust/pull/60186#issuecomment-485581694. [issue-60210]: https://github.com/rust-lang/rust/issues/60210
2025-09-09Auto merge of #145717 - BoxyUwU:erase_regions_rename, r=lcnrbors-8/+8
rename erase_regions to erase_and_anonymize_regions I find it consistently confusing that `erase_regions` does more than replacing regions with `'erased`. it also makes some code look real goofy to be writing manual folders to erase regions with a comment saying "we cant use erase regions" :> or code that re-calls erase_regions on types with regions already erased just to anonymize all the bound regions. r? lcnr idk how i feel about the name being almost twice as long now
2025-09-09WIP switch inference table to next-solverjackh726-526/+2292
2025-09-09erase_regions to erase_and_anonymize_regionsBoxy-8/+8
2025-09-09Make `#[target_feature]` safe always on WASMChayim Refael Friedman-11/+69
Even when the feature isn't enabled, as it's not UB to invoke an undefined feature in WASM (just a trap).
2025-09-09Expand target info to include the architectureChayim Refael Friedman-78/+188
And make it easier to expand it more in the future, if needed.
2025-09-09Resolve paths to snapshot test libraries absolutelyChayim Refael Friedman-23/+85
That is, resolve them globally, not from the test's location. This *should* result in more robust resolution; for example, previously the code failed to detect the presence of snapshot testing if the snapshot library was renamed in the dependency or was an indirect dependency.
2025-09-09Merge pull request #20624 from A4-Tacks/fix-syn-lifetime-boundsChayim Refael Friedman-7/+6
Fix LifetimeParam::lifetime_bounds invalid implement
2025-09-09Fix LifetimeParam::lifetime_bounds invalid implementA4-Tacks-7/+6
Lifetime node example: ``` LIFETIME_PARAM@15..21 LIFETIME@15..17 LIFETIME_IDENT@15..17 "'a" COLON@17..18 ":" WHITESPACE@18..19 " " TYPE_BOUND_LIST@19..21 TYPE_BOUND@19..21 LIFETIME@19..21 LIFETIME_IDENT@19..21 "'b" ```
2025-09-09Add a FAQ entry about RA and Cargo interactionJakub Beránek-0/+9
2025-09-09Update documentation about how to build the RA bookJakub Beránek-0/+1
2025-09-09Rollup merge of #146195 - nixxo:urlencoding-fix, r=ehussStuart Cook-12/+16
fix partial urlencoded link support Hello Rust community. This is my first contribution, hope is useful. While translating in Italian the rust book https://github.com/nixxo/rust-lang-book-it I noticed that the linkchecker tool was failing reporting broken links on some pages even if the link worked properly in the browser. Upon inspection I noticed that mdbook basically urlencoded the links, but not urlencoded the heading IDs resulting in a non-identical anchor/IDs pairing that linkchecker reports as non-valid. looking at the source code for the linkchecker tool I noticed that urlencoding was done by the `small_url_encode` function in a partial way, as the name suggests. Replacing this function with a full urlencoding fixes the issue and the links are properly reported as valid. - added full urlencoding to properly check urlencoded anchor links against non-urlencoded heading IDs - added tests urlecoding provided by https://crates.io/crates/urlencoding
2025-09-08change end to lastJeremy Smart-1/+0
2025-09-08Skip flycheck for workspace if it is already being checkedIfeanyi Orizu-9/+16
2025-09-08Merge pull request #20632 from rmehri01/navigation-on-primsChayim Refael Friedman-139/+244
feat: support navigation on primitives
2025-09-08make TryToNav take Semantics instead of RootDatabaseRyan Mehri-124/+203
2025-09-08add testRyan Mehri-0/+14
2025-09-08impl TryToNav for BuiltinType insteadRyan Mehri-30/+32
2025-09-08Merge pull request #20633 from Wilfred/improve_introChayim Refael Friedman-9/+29
Clarify intro in README and manual
2025-09-08Clarify intro in README and manualWilfred Hughes-9/+29
The first sentence a new user should see should ideally answer the questions: * What is rust-analyzer? * Why might I want to use it? The vast majority of users will be interested in using rust-analyzer inside their favourite editor. We should clarify that rust-analyzer is an LSP implementation and that it supports all the classic IDE features. Whilst it's also true that rust-analyzer is modular and organised into libraries, the first impression should (I think) focus on an overview and the primary use case.
2025-09-08fix partial urlencoded link supportnixxo-12/+16
- added full urlencoding to properly check urlencoded anchor links against non-urlencoded heading IDs - added tests urlecoding provided by https://crates.io/crates/urlencoding