Dietrich Daroch
3faf03f6b4
Split duration_constructors to get non-controversial bits out faster.
2025-05-09 22:52:39 -04:00
bors
4c2b4ca4f2
Auto merge of #140106 - dianne:deref-pat-usefulness, r=Nadrieril
...
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-08 02:16:45 +00:00
bors
24390f60d6
Auto merge of #137995 - hkBst:parse_format_reuse_unescape, r=nnethercote
...
Remove duplicate impl of string unescape from parse_format
r? `@nnethercote`
2025-05-07 06:18:39 +00:00
dianne
eb446f92fd
add stubbed-out cases for rust-analyzer
...
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-06 18:53:55 -07:00
Marijn Schouten
618c3de146
Remove duplicate impl of string unescape
2025-05-06 10:00:22 +00:00
Stuart Cook
9f4e2cc51d
Rollup merge of #140035 - fee1-dead-contrib:push-oszwkkvmpkks, 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-06 16:28:39 +10:00
Deadbeef
9fce1dfac5
Implement RFC 3503: frontmatters
...
Supercedes #137193
2025-05-05 23:10:08 +08:00
Lukas Wirth
3b57c00151
Merge pull request #19739 from Veykril/push-kpozprqnsmkk
...
Disable fixpoint for variance computation temporarily
2025-05-04 04:26:25 +00:00
Lukas Wirth
7d51ec376a
Disable fixpoint for variance computation temporarily
2025-05-04 06:09:34 +02:00
A4-Tacks
850d122fd4
Improve let snippet
2025-05-03 17:04:11 +08:00
A4-Tacks
d922c20158
Improve the let code snippet
2025-05-03 13:15:32 +08:00
Lukas Wirth
6f9c62dfec
Merge pull request #19733 from ShoyuVanilla/issue-19724
...
fix: Implement mut to const ptr cast for method resolution
2025-05-02 20:48:24 +00:00
Lukas Wirth
3bf5d7f7f9
Merge pull request #19732 from ShoyuVanilla/issue-19730
...
fix: Correct assoc ty bound var starting index
2025-05-02 20:46:54 +00:00
Shoyu Vanilla
4aa98bf1d7
fix: Implement mut to const ptr cast for method resolution
2025-05-03 03:01:40 +09:00
Lukas Wirth
be7433328e
Merge pull request #19731 from Veykril/push-mmvowomkpwxy
...
refactor: Simplify macro call id construction
2025-05-02 15:38:17 +00:00
Shoyu Vanilla
9f60884db7
fix: Correct assoc ty bound var starting index
2025-05-03 00:31:33 +09:00
Lukas Wirth
5d43e752ad
refactor: Simplify macro call id construction
2025-05-02 17:26:48 +02:00
Lukas Wirth
235d88bf42
Render more lifetimes
2025-05-02 14:36:18 +02:00
Matthias Krüger
573c47c9ba
remove a couple of clones
2025-05-01 11:41:42 +02:00
Laurențiu Nicola
b3fd9bc081
Merge from rust-lang/rust
2025-05-01 10:22:16 +03:00
Lukas Wirth
5d66d45005
Merge pull request #19723 from Veykril/push-skswknpxtzlz
...
fix: Improve parser recovery a bit
2025-04-30 14:51:18 +00:00
Lukas Wirth
e0dca847ad
fix: Improve parser recovery a bit
2025-04-30 16:40:01 +02:00
Lukas Wirth
1ad31eff67
Merge pull request #19247 from alibektas/19172_very_new
...
fix: Correct span info for mir::Operand
2025-04-30 10:13:02 +00:00
Lukas Wirth
62e7e2b489
chore: Adjust panic context printing
2025-04-30 07:40:11 +02:00
Lukas Wirth
996d6ed1a3
Split out salsa_macros
...
Does not do much yet due to tracing pulling syn but oh well
2025-04-29 19:43:36 +02:00
Lukas Wirth
9fa647c129
Update salsa
2025-04-29 19:26:19 +02:00
Lukas Wirth
4cc6ee3f01
refactor: Remove unnecessary extension trait
2025-04-29 13:53:57 +02:00
Lukas Wirth
d11dbf648f
Cleanup cfg check handling in expression store lowering
2025-04-29 11:44:11 +02:00
Lukas Wirth
7d9b839f9c
refactor: Clean up cache priming cancellation handling
2025-04-29 10:40:31 +02:00
David Barsky
fe7b4f2ad9
Merge pull request #19699 from ChayimFriedman2/escape-label
...
fix: Escape raw names in labels properly
2025-04-28 21:12:21 +00:00
David Barsky
9e3bbd8acc
base-db: add more details to panic
2025-04-28 13:30:33 -07:00
Lukas Wirth
f6dd41e9e2
Merge pull request #19708 from Veykril/push-wrmyowrzkxzz
...
refactor: De-arc lang item queries
2025-04-28 15:28:51 +00:00
Lukas Wirth
c5051019b4
Merge pull request #19542 from snprajwal/let-else-to-match
...
refactor: migrate `let_else_to_match` to editor
2025-04-28 15:27:28 +00:00
Lukas Wirth
6355df9c57
refactor: De-arc lang item queries
2025-04-28 17:17:39 +02:00
Prajwal S N
d25c175b3e
refactor: migrate merge_imports
to syntax editor
...
Co-authored-by: Tarek <tareknaser360@gmail.com>
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28 17:32:36 +05:30
Prajwal S N
c6ae7b3541
chore: rename unmerge_use
to unmerge_imports
...
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28 17:32:05 +05:30
Prajwal S N
bb493649d2
fix: migrate unmerge_use
to syntax editor
...
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-28 17:31:23 +05:30
Prajwal S N
2eb7389b63
refactor: migrate let_else_to_match
to editor
...
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28 17:19:17 +05:30
Laurențiu Nicola
a058c340ef
Unelide lifetime
2025-04-28 14:16:43 +03:00
Lukas Wirth
5adee2ad2c
Merge pull request #19706 from Veykril/push-nkpmknlvzyom
...
fix: Address minor FIXME
2025-04-28 10:12:20 +00:00
Lukas Wirth
48fb00c19d
fix: Address minor FIXME
2025-04-28 11:55:26 +02:00
Lukas Wirth
0fee71065b
Merge pull request #19704 from Veykril/push-wrvznvvpvtvp
...
Add expression fill mode variant for filling with underscore expressions
2025-04-28 09:45:04 +00:00
Lukas Wirth
7e526b6be7
Add expression fill mode variant for filling with underscore expressions
2025-04-28 10:39:36 +02:00
Laurențiu Nicola
1f727edb2d
Format code
2025-04-28 11:11:47 +03:00
Laurențiu Nicola
6225bb9c44
Merge from rust-lang/rust
2025-04-28 11:06:53 +03:00
Chayim Refael Friedman
d8887c0758
Merge pull request #19692 from vishruth-thimmaiah/remove_underscore_for_used_var
...
feat: adds an assist to remove underscores from used variables
2025-04-26 19:00:49 +00:00
Vishruth-Thimmaiah
47c22bf916
feat: adds an assist to remove underscores from used variables
...
adds an assist that suggests removing any underscore prefixes from used
variables.
2025-04-27 00:13:42 +05:30
Chayim Refael Friedman
e6ebf0b8a1
Don't escape 'static
...
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-26 21:20:43 +03:00
Chayim Refael Friedman
d781d02cf4
Escape raw names in labels properly
2025-04-26 21:10:43 +03:00
Wilfred Hughes
eb23af9e73
Clarify text for add_braces assist
...
"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-25 22:15:22 -07:00