33353 Commits

Author SHA1 Message Date
León Orell Valerian Liehr
07804f1937
Rollup merge of #135625 - c410-f3r:cfg-match-foo-bar-baz, r=tgross35,jhpratt
[cfg_match] Document the use of expressions.

cc #115585

Adds documentation to this new feature introduced in #133720.
2025-01-29 03:12:18 +01:00
Ali Bektas
dd461203a6 call infer_pats from infer::expr with context 2025-01-29 00:54:18 +01:00
Ali Bektas
7befcb32e4 Equip infer_pat_* with declaration origin 2025-01-29 00:54:18 +01:00
Ali Bektas
5a3488a43e add test, bless tests 2025-01-29 00:54:18 +01:00
Ali Bektas
d092918b55 try to infer array type from slice pattern
rust-analyzer equivalent of rust-lang/rust#2827aa97
2025-01-29 00:54:18 +01:00
Marijn Schouten
e766255067 parse_format optimize import use 2025-01-28 19:33:00 +01:00
David Barsky
bc10a44798
Merge pull request #19063 from davidbarsky/davidbarsky/backout-struct-default-fields
internal: backout `hir-*` changes from #19001
2025-01-28 16:45:45 +00:00
David Richey
a81712b9a6 Update lsif_contains_generated_constant 2025-01-28 10:44:32 -06:00
Shoyu Vanilla
461ee092bf feat: Implement default-field-values only in parser 2025-01-28 11:30:47 -05:00
Lukas Wirth
07a09c154e
Merge pull request #19015 from Wilfred/mdbook
manual: Convert to mdbook
2025-01-28 16:19:37 +00:00
David Richey
9462322f20 Fix scip symbols for implicit modules 2025-01-28 10:14:04 -06:00
Lukas Wirth
9f1ad04e72
Merge pull request #19056 from Giga-Bowser/fix-syntax-tree-crlf
fix: Properly handle CRLF line endings in the syntax tree view
2025-01-28 16:04:21 +00:00
Lukas Wirth
68edc96046
Merge pull request #19057 from darichey/status-bar-in-output
Show status bar in RA output
2025-01-28 16:02:15 +00:00
David Richey
a329b6ac2c Fix scip crate symbol name 2025-01-28 09:34:23 -06:00
Lukas Wirth
1f86729f29
Merge pull request #19061 from Veykril/push-rwyqqtqmnput
Disable `Receiver` based autoderef temporarily
2025-01-28
2025-01-28 14:08:49 +00:00
Lukas Wirth
8a9992cef4 Disable Receiver based autoderef temporarily 2025-01-28 14:54:02 +01:00
bors
7066f1a68a Auto merge of #134290 - tgross35:windows-i128-callconv, r=bjorn3,wesleywiser
Windows x86: Change i128 to return via the vector ABI

Clang and GCC both return `i128` in xmm0 on windows-msvc and windows-gnu. Currently, Rust returns the type on the stack. Add a calling convention adjustment so we also return scalar `i128`s using the vector ABI, which makes our `i128` compatible with C.

In the future, Clang may change to return `i128` on the stack for its `-msvc` targets (more at [1]). If this happens, the change here will need to be adjusted to only affect MinGW.

Link: https://github.com/rust-lang/rust/issues/134288 (does not fix) [1]

try-job: x86_64-msvc
try-job: x86_64-msvc-ext1
try-job: x86_64-mingw-1
try-job: x86_64-mingw-2
2025-01-28 06:11:13 +00:00
David Richey
50172919a6 Fix scip inherent impl overflow 2025-01-27 23:20:16 -06:00
David Barsky
be3307450f Back out "feat: Implement default-field-values"
This backs out commit 7de0b2e75a541b98f735ee6fcd12d326be38d23f.
2025-01-27 17:30:35 -05:00
David Barsky
35f6123059 Back out "Handle missing fields diagnostics"
This backs out commit e6a103ae50699db1dbb0676d075a4bcda2247939.
2025-01-27 17:30:35 -05:00
David Barsky
f3451d54d6 Back out "Merge record lit's ellipsis into pre-existing spread's variant"
This backs out commit c134b20c9cbc88a36e77acb8522e8dc4573bd906.
2025-01-27 17:30:35 -05:00
David Barsky
77c1507048 Back out "Compute diagnostics of a field body iff it has one"
This backs out commit b4d4d02db8a95f5507fbd0aa90904d7b774f0027.
2025-01-27 17:30:35 -05:00
David Barsky
e1b9a01c69 Back out "Implement HasResolver and HasModule for FieldId"
This backs out commit ce9da9063097c26006886b3f403a0c50790c285a.
2025-01-27 17:30:34 -05:00
David Barsky
52ee4ee1df Back out "Add a test for field default value body as defining usage of TAIT"
This backs out commit 4fe18a6fb5a1181a04c47391f558ebab5b8b0f39.
2025-01-27 17:30:34 -05:00
David Barsky
34d05b3bd0 Back out "Fix a mistake in condition"
This backs out commit e5c38558f5dbc37cbc91f9fda58144ce02e1f5aa.
2025-01-27 17:30:34 -05:00
David Barsky
55d3851820 Back out "Remove has_default from FieldId"
This backs out commit 8aa6c09fcee6270c787a6f00615d76343fbe5c07.
2025-01-27 17:30:34 -05:00
David Richey
fc1ead1312 Show status bar in RA output 2025-01-27 14:20:05 -06:00
Chayim Refael Friedman
a995319633
Merge pull request #19055 from vkrivopalov/fix-testdir-unused-variable-warning-on-freebsd
Add FreeBSD as a target OS for TestDir to avoid warnings
2025-01-27 20:16:57 +00:00
Giga Bowser
027363fef1 fix: Properly handle CRLF line endings in the syntax tree view 2025-01-27 15:09:58 -05:00
Vladimir Krivopalov
538f4faafb Add FreeBSD as a target OS for TestDir to avoid warnings
Currently, running rust-analyzer tests on FreeBSD produces an "unused
variable" warning. The code is fully compatible with FreeBSD and doesn't
have to be omitted.

Signed-off-by: Vladimir Krivopalov <vladimir@krivopalov.ru>
2025-01-27 14:53:56 -05:00
Lukas Wirth
7c387ed3a7
Merge pull request #19051 from ChayimFriedman2/fn-ptr-unsafe
fix: Report calling unsafe fn pointer as unsafe
2025-01-27 17:42:06 +00:00
Lukas Wirth
b27c5b4cae
Merge pull request #19050 from ChayimFriedman2/iter-self
fix: Don't suggest `into_iter().method()` on iterators
2025-01-27 17:41:02 +00:00
Lukas Wirth
8384bc5c55
Merge pull request #19049 from ChayimFriedman2/add-reference-ty
minor: Remove duplicate method from `hir::Type`
2025-01-27 17:40:09 +00:00
Lukas Wirth
fe253df5f0
Merge pull request #19052 from Veykril/push-yqwutllwwyyp
Prioritize formatting thread tasks in main_loop
2025-01-27 17:40:07 +00:00
Lukas Wirth
ec06a9d1d4 Prioritize formatting thread tasks in main_loop 2025-01-27 18:23:42 +01:00
Chayim Refael Friedman
9c27e0251c Report calling unsafe fn pointer as unsafe 2025-01-27 18:57:31 +02:00
Chayim Refael Friedman
cdc3f89a3f Don't suggest into_iter().method() on iterators 2025-01-27 18:48:20 +02:00
Chayim Refael Friedman
028c47999d Remove duplicate method from hir::Type
I added it by mistake in #18927.

I chose to keep the method as not static, because it's more comfortable, and keep the name `add_reference()` and not `reference()`, because it is clearer and better matches `strip_reference[s]()`.
2025-01-27 18:40:01 +02:00
Laurențiu Nicola
606cfeffa2
Merge pull request #19047 from lnicola/rename-highlight
fix: Fix syntactic highlighting for renames
2025-01-27 14:33:04 +00:00
Laurențiu Nicola
7d8f53d55c Fix syntactic highlighting for renames 2025-01-27 15:51:51 +02:00
Lukas Wirth
2f672dd037
Merge pull request #19044 from ChayimFriedman2/deprecated-safe
fix: Fix #[rustc_deprecated_safe_2024]
2025-01-27 13:29:22 +00:00
Lukas Wirth
ac6015fafa
Merge pull request #19045 from ChayimFriedman2/missing-token
fix: Fix a missing standard token in semantic highlighting
2025-01-27 13:23:42 +00:00
Chayim Refael Friedman
783fa8eb9d Fix a missing standard token in semantic highlighting
That was used as a fallback, causing a panic when the fallback was chosen.

I also made sure this won't happen again by guaranteeing in the macro generating the tokens that they all exist.
2025-01-27 15:08:00 +02:00
Chayim Refael Friedman
55c63abc59 Fix #[rustc_deprecated_safe_2024]
It should be considered by the edition of the caller, not the callee.

Technically we still don't do it correctly - we need the span of the method name (if it comes from a macro), but we don't keep it and this is good enough for now.
2025-01-27 14:35:20 +02:00
Lukas Wirth
6862329068
Merge pull request #19001 from ShoyuVanilla/default-field-values
feat: Implement `default-field-values`
2025-01-27 11:45:07 +00:00
Shoyu Vanilla
8aa6c09fce Remove has_default from FieldId 2025-01-27 19:41:58 +09:00
Shoyu Vanilla
e5c38558f5 Fix a mistake in condition 2025-01-27 19:41:58 +09:00
Shoyu Vanilla
4fe18a6fb5 Add a test for field default value body as defining usage of TAIT 2025-01-27 19:41:58 +09:00
Shoyu Vanilla
ce9da90630 Implement HasResolver and HasModule for FieldId 2025-01-27 19:41:58 +09:00
Shoyu Vanilla
b4d4d02db8 Compute diagnostics of a field body iff it has one 2025-01-27 19:41:57 +09:00