summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates
AgeCommit message (Collapse)AuthorLines
2025-05-08Auto merge of #140106 - dianne:deref-pat-usefulness, r=Nadrierilbors-0/+3
allow deref patterns to participate in exhaustiveness analysis Per [this proposal](https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Exhaustiveness), this PR allows deref patterns to participate in exhaustiveness analysis. Currently all deref patterns enforce `DerefPure` bounds on their scrutinees, so this assumes all patterns it's analyzing are well-behaved. This also doesn't support [mixed exhaustiveness](https://hackmd.io/4qDDMcvyQ-GDB089IPcHGg#Mixed-exhaustiveness), and instead emits an error if deref patterns are used together with normal constructors. I think mixed exhaustiveness would be nice to have (especially if we eventually want to support arbitrary `Deref` impls[^1]), but it'd require more work to get reasonable diagnostics[^2]. Tracking issue for deref patterns: #87121 r? `@Nadrieril` [^1]: Regardless of whether we support limited exhaustiveness checking for untrusted `Deref` or always require other arms to be exhaustive, I think it'd be useful to allow mixed matching for user-defined smart pointers. And it'd be strange if it worked there but not for `Cow`. [^2]: I think listing out witnesses of non-exhaustiveness can be confusing when they're not necessarily disjoint, and when you only need to cover some of them, so we'd probably want special formatting and/or explanatory subdiagnostics. And if it's implemented similarly to unions, we'd probably also want some way of merging witnesses; the way witnesses for unions can appear duplicated is pretty unfortunate. I'm not sure yet how the diagnostics should look, especially for deeply nested patterns.
2025-05-07Auto merge of #137995 - hkBst:parse_format_reuse_unescape, r=nnethercotebors-3/+3
Remove duplicate impl of string unescape from parse_format r? `@nnethercote`
2025-05-06add stubbed-out cases for rust-analyzerdianne-0/+3
rust-analyzer doesn't construct `DerefPattern(_)` constructors, so these shouldn't crash. It looks like this is how slice patterns are implemented too.
2025-05-06Remove duplicate impl of string unescapeMarijn Schouten-3/+3
2025-05-06Rollup merge of #140035 - fee1-dead-contrib:push-oszwkkvmpkks, ↵Stuart Cook-1/+17
r=jieyouxu,wesleywiser Implement RFC 3503: frontmatters Tracking issue: #136889 Supercedes #137193. This implements [RFC 3503](https://github.com/rust-lang/rfcs/blob/master/text/3503-frontmatter.md). This might break rust-analyzer. Will look into how to fix that. Suggestions welcome for how to improve diagnostics.
2025-05-05Implement RFC 3503: frontmattersDeadbeef-1/+17
Supercedes #137193
2025-05-04Merge pull request #19739 from Veykril/push-kpozprqnsmkkLukas Wirth-12/+12
Disable fixpoint for variance computation temporarily
2025-05-04Disable fixpoint for variance computation temporarilyLukas Wirth-12/+12
2025-05-03Improve let snippetA4-Tacks-6/+6
2025-05-03Improve the let code snippetA4-Tacks-6/+101
2025-05-02Merge pull request #19733 from ShoyuVanilla/issue-19724Lukas Wirth-13/+82
fix: Implement mut to const ptr cast for method resolution
2025-05-02Merge pull request #19732 from ShoyuVanilla/issue-19730Lukas Wirth-1/+27
fix: Correct assoc ty bound var starting index
2025-05-03fix: Implement mut to const ptr cast for method resolutionShoyu Vanilla-13/+82
2025-05-02Merge pull request #19731 from Veykril/push-mmvowomkpwxyLukas Wirth-175/+112
refactor: Simplify macro call id construction
2025-05-03fix: Correct assoc ty bound var starting indexShoyu Vanilla-1/+27
2025-05-02refactor: Simplify macro call id constructionLukas Wirth-175/+112
2025-05-02Render more lifetimesLukas Wirth-149/+201
2025-05-01remove a couple of clonesMatthias Krüger-90/+71
2025-05-01Merge from rust-lang/rustLaurențiu Nicola-1/+1
2025-04-30Merge pull request #19723 from Veykril/push-skswknpxtzlzLukas Wirth-20/+86
fix: Improve parser recovery a bit
2025-04-30fix: Improve parser recovery a bitLukas Wirth-20/+86
2025-04-30Merge pull request #19247 from alibektas/19172_very_newLukas Wirth-82/+146
fix: Correct span info for mir::Operand
2025-04-30chore: Adjust panic context printingLukas Wirth-12/+10
2025-04-29Split out salsa_macrosLukas Wirth-47/+55
Does not do much yet due to tracing pulling syn but oh well
2025-04-29Update salsaLukas Wirth-25/+67
2025-04-29refactor: Remove unnecessary extension traitLukas Wirth-68/+59
2025-04-29Cleanup cfg check handling in expression store loweringLukas Wirth-188/+234
2025-04-29refactor: Clean up cache priming cancellation handlingLukas Wirth-39/+54
2025-04-28Merge pull request #19699 from ChayimFriedman2/escape-labelDavid Barsky-7/+36
fix: Escape raw names in labels properly
2025-04-28base-db: add more details to panicDavid Barsky-9/+20
2025-04-28Merge pull request #19708 from Veykril/push-wrmyowrzkxzzLukas Wirth-255/+188
refactor: De-arc lang item queries
2025-04-28Merge pull request #19542 from snprajwal/let-else-to-matchLukas Wirth-142/+335
refactor: migrate `let_else_to_match` to editor
2025-04-28refactor: De-arc lang item queriesLukas Wirth-255/+188
2025-04-28refactor: migrate `merge_imports` to syntax editorPrajwal S N-43/+25
Co-authored-by: Tarek <tareknaser360@gmail.com> Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28chore: rename `unmerge_use` to `unmerge_imports`Prajwal S N-44/+44
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28fix: migrate `unmerge_use` to syntax editorPrajwal S N-16/+108
Also ensures that attributes on the use item are applied to the new use item when unmerging. Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28refactor: migrate `let_else_to_match` to editorPrajwal S N-142/+335
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28Unelide lifetimeLaurențiu Nicola-1/+1
2025-04-28Merge pull request #19706 from Veykril/push-nkpmknlvzyomLukas Wirth-24/+19
fix: Address minor FIXME
2025-04-28fix: Address minor FIXMELukas Wirth-24/+19
2025-04-28Merge pull request #19704 from Veykril/push-wrvznvvpvtvpLukas Wirth-122/+169
Add expression fill mode variant for filling with underscore expressions
2025-04-28Add expression fill mode variant for filling with underscore expressionsLukas Wirth-122/+169
2025-04-28Format codeLaurențiu Nicola-1/+3
2025-04-28Merge from rust-lang/rustLaurențiu Nicola-195/+37
2025-04-26Merge pull request #19692 from vishruth-thimmaiah/remove_underscore_for_used_varChayim Refael Friedman-0/+212
feat: adds an assist to remove underscores from used variables
2025-04-27feat: adds an assist to remove underscores from used variablesVishruth-Thimmaiah-0/+212
adds an assist that suggests removing any underscore prefixes from used variables.
2025-04-26Don't escape `'static`Chayim Refael Friedman-2/+10
As it is a valid lifetime without escaping. It does need to be escaped as a label, but we have no way to distinguish that.
2025-04-26Escape raw names in labels properlyChayim Refael Friedman-5/+26
2025-04-25Clarify text for add_braces assistWilfred Hughes-3/+3
"to arm expression" is hard to parse, because "arm" can be a verb. Not all Rust users may know that "arm" refers to a `match` expression either. Tweak the wording to make the sentence easier to parse, and clarify that this assist refers to `match`. Use the same wording style for the closure version too.
2025-04-25Merge pull request #19690 from ChayimFriedman2/preallocate-inputChayim Refael Friedman-3/+10
minor: Preallocate `parser::Input`