about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates
AgeCommit message (Collapse)AuthorLines
2025-03-13insert braces for closurejnyfah-5/+32
2025-03-12Emit an error when RTN is used in an incorrect placeChayim Refael Friedman-2/+80
We miss one place: associated type bindings aka. `impl Trait<Type(..): Send>`, but we also miss it for Fn-style parenthesizes error so I left it out for now.
2025-03-12Lower Return Type Notation (`Type::method(..): Send`)Chayim Refael Friedman-80/+125
We do it the way rustc does it, by only marking segments with it, and not the whole path. This will allow extending where it is allowed in the future.
2025-03-12Merge pull request #19337 from ChayimFriedman2/salsify-crate-graph-finalChayim Refael Friedman-2511/+3628
Salsify the crate graph
2025-03-12Salsify the crate graphChayim Refael Friedman-2511/+3628
I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.
2025-03-11Make GenericParamsCollector::type_or_consts not unnecessarily pub(crate)¨Florian-10/+15
2025-03-11Auto merge of #136932 - m-ou-se:fmt-width-precision-u16, r=scottmcmbors-1/+1
Reduce formatting `width` and `precision` to 16 bits This is part of https://github.com/rust-lang/rust/issues/99012 This is reduces the `width` and `precision` fields in format strings to 16 bits. They are currently full `usize`s, but it's a bit nonsensical that we need to support the case where someone wants to pad their value to eighteen quintillion spaces and/or have eighteen quintillion digits of precision. By reducing these fields to 16 bit, we can reduce `FormattingOptions` to 64 bits (see https://github.com/rust-lang/rust/pull/136974) and improve the in memory representation of `format_args!()`. (See additional context below.) This also fixes a bug where the width or precision is silently truncated when cross-compiling to a target with a smaller `usize`. By reducing the width and precision fields to the minimum guaranteed size of `usize`, 16 bits, this bug is eliminated. This is a breaking change, but affects almost no existing code. --- Details of this change: There are three ways to set a width or precision today: 1. Directly a formatting string, e.g. `println!("{a:1234}")` 2. Indirectly in a formatting string, e.g. `println!("{a:width$}", width=1234)` 3. Through the unstable `FormattingOptions::width` method. This PR: - Adds a compiler error for 1. (`println!("{a:9999999}")` no longer compiles and gives a clear error.) - Adds a runtime check for 2. (`println!("{a:width$}, width=9999999)` will panic.) - Changes the signatures of the (unstable) `FormattingOptions::[get_]width` methods to use a `u16` instead. --- Additional context for improving `FormattingOptions` and `fmt::Arguments`: All the formatting flags and options are currently: - The `+` flag (1 bit) - The `-` flag (1 bit) - The `#` flag (1 bit) - The `0` flag (1 bit) - The `x?` flag (1 bit) - The `X?` flag (1 bit) - The alignment (2 bits) - The fill character (21 bits) - Whether a width is specified (1 bit) - Whether a precision is specified (1 bit) - If used, the width (a full usize) - If used, the precision (a full usize) Everything except the last two can simply fit in a `u32` (those add up to 31 bits in total). If we can accept a max width and precision of u16::MAX, we can make a `FormattingOptions` that is exactly 64 bits in size; the same size as a thin reference on most platforms. If, additionally, we also limit the number of formatting arguments, we can also reduce the size of `fmt::Arguments` (that is, of a `format_args!()` expression).
2025-03-10internal: port rust-analyzer to new SalsaDavid Barsky-2017/+2460
2025-03-10internal(config): use `FxIndexMap` for default completion snippetsDavid Barsky-24/+27
2025-03-10Merge pull request #19305 from davidbarsky/davidbarsky/vendor-query-group-macroLukas Wirth-1/+1642
internal: vendor `query-group-macro` in rust-analyzer
2025-03-10internal: vendor `query-group-macro`David Barsky-1/+1642
2025-03-10doc: add doc to proc-macro-apibit-aloo-1/+71
2025-03-10Merge pull request #19326 from Veykril/push-vovuxzkzrowpLukas Wirth-10/+11
Add missing name-ref parents to syntactic highlighting
2025-03-10Merge pull request #19294 from alibektas/better_build_script_err_msgsLukas Wirth-0/+1
minor: Show build scripts errors in server status
2025-03-10Add missing name-ref parents to syntactic highlightingLukas Wirth-10/+11
2025-03-10Merge pull request #19332 from Veykril/push-trvznlqsvtyqLukas Wirth-84/+53
Make change annotations per text-edit
2025-03-10Fix rust-analyzer for 16-bit fmt width and precision.Mara Bos-1/+1
2025-03-10Make change annotations per text-editLukas Wirth-84/+53
2025-03-10Fix diagnostics being cleared right after being receivedAlex Kirszenberg-1/+3
2025-03-10Merge pull request #19331 from lnicola/sync-from-rustLaurențiu Nicola-215/+70
minor: Sync from downstream
2025-03-10Format codeLaurențiu Nicola-35/+43
2025-03-10Fix simd layout testLaurențiu Nicola-1/+1
2025-03-10Bump rustc cratesLaurențiu Nicola-4/+0
2025-03-10Merge pull request #19330 from ChayimFriedman2/normalize-projectionLukas Wirth-503/+869
fix: Normalize projections in evaluated const display and layout calculation
2025-03-10Merge pull request #19079 from ChayimFriedman2/rename-conflictLukas Wirth-59/+509
feat: Warn the user when a rename will change the meaning of the program
2025-03-10Merge pull request #19327 from Veykril/push-qyyvkulltzpzLukas Wirth-2/+6
Fix `path` macro hygiene
2025-03-10Merge from rust-lang/rustLaurențiu Nicola-186/+37
2025-03-10Fix `path` macro hygieneLukas Wirth-2/+6
2025-03-10Merge pull request #19311 from aibaars/log-build-script-errorLukas Wirth-0/+8
Log build script error output in `load_cargo::load_workspace_at`
2025-03-10Merge pull request #19314 from snprajwal/variantdef-implLukas Wirth-1/+68
fix(hir): `VariantDef` is `impl HasSource`
2025-03-10Merge pull request #19252 from flodiebold/fix-fixup-delimitersLukas Wirth-88/+105
Fix syntax fixup producing invalid punctuation
2025-03-10Merge pull request #19232 from ShoyuVanilla/issue-19196Lukas Wirth-0/+47
Bump chalk for built-in supports of async closures
2025-03-09Rank ADT constructors as constructors for completion scoringLukas Wirth-12/+102
2025-03-09fix: Prevent wrong invocations of `needs_parens_in` with non-ancestral "parent"sShoyu Vanilla-14/+117
2025-03-09internal: Migrate `inline_local_variable` to `SyntaxEditor`Shoyu Vanilla-32/+55
2025-03-09Bump chalk for built-in supports of async closuresShoyu Vanilla-0/+47
2025-03-08Fix syntax fixup producing invalid punctuation¨Florian-88/+105
Fixes #19206. Fixes #18244.
2025-03-08Use `rustc_abi` code for SIMD layout in rust-analyzerMoulins-39/+7
2025-03-08Remove most manual LayoutData creations and move them to `rustc_abi`Moulins-78/+20
...either as: - methods on LayoutCalculator, for faillible operations; - constructors on LayoutData, for infaillible ones.
2025-03-08fix(hir): `VariantDef` is `impl HasSource`Prajwal S N-1/+68
A new syntax node `ast::VariantDef` has been introduced to map between the HIR node and the AST. The files have been updated with `cargo test -p xtask`. Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-03-07Remove explicit error message when build.rs failsAli Bektas-3/+3
2025-03-07Log build script error output in `load_cargo::load_workspace_at`Arthur Baars-0/+8
2025-03-07Merge pull request #19308 from Veykril/push-rnrxutwlvmlyLukas Wirth-23/+1174
Move loaded project MSRV back to 1.78, show notification for the warning
2025-03-07Pop up a notification for the MSRV project loading warningLukas Wirth-16/+29
2025-03-07Move project MSRV back to 1.78Lukas Wirth-7/+1145
2025-03-07Refactor relevance scoring to use a named constant BASE_SCORETongjun Gao-3/+5
Replace magic number with a named constant for improved readability and maintainability of the scoring logic
2025-03-07Fix logical error in relevance scoring implementationTongjun Gao-3/+3
2025-03-06Warn the user when a rename will change the meaning of the programChayim Refael Friedman-59/+509
Specifically, when a rename of a local will change some code that refers it to refer another local, or some code that refer another local to refer to it. We do it by introducing a dummy edit with an annotation. I'm not a fond of this approach, but I don't think LSP has a better way.
2025-03-06Use correct crate for trait env in `render_const_scalar()`Chayim Refael Friedman-5/+7
2025-03-06Pass the target crate in `HirFormatter`Chayim Refael Friedman-499/+824
This is required to format evaluated consts, because we need trait env, and it needs the crate (currently it uses the last crate in topological order, which is wrong, the next commit will fix that).