785 Commits

Author SHA1 Message Date
Shoyu Vanilla
b7b4dd5afc fix: Resolve projection types before checking casts 2025-02-07 09:51:32 +09:00
Chayim Refael Friedman
9db2499bb9 Add a FIXME for feature(adt_const_params) 2025-02-04 21:28:19 +02:00
Lukas Wirth
13c17db07b
Merge pull request #19066 from alibektas/slice_pattern_type_inference
fix: try to infer array type from slice pattern
2025-02-03 14:03:50 +00:00
Lukas Wirth
d6645d11da Fix some mir eval/lowerings 2025-02-03 14:42:41 +01:00
Lukas Wirth
465844c3be Do not use make use of InferenceResult::has_errors flag for mir building
It generaly does not work as expected right now as we fallback type parameters to errors
2025-02-03 12:26:06 +01:00
Ali Bektas
135fca9efe Revert tests::patterns::infer_pattern
And apply requested changes
2025-02-03 12:23:13 +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
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
Lukas Wirth
8a9992cef4 Disable Receiver based autoderef temporarily 2025-01-28 14:54:02 +01: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
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
Chayim Refael Friedman
9c27e0251c Report calling unsafe fn pointer as unsafe 2025-01-27 18:57:31 +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
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
b4d4d02db8 Compute diagnostics of a field body iff it has one 2025-01-27 19:41:57 +09:00
Shoyu Vanilla
c134b20c9c Merge record lit's ellipsis into pre-existing spread's variant 2025-01-27 19:41:54 +09:00
Shoyu Vanilla
e6a103ae50 Handle missing fields diagnostics 2025-01-27 19:38:39 +09:00
Shoyu Vanilla
7de0b2e75a feat: Implement default-field-values 2025-01-27 19:38:35 +09:00
Lukas Wirth
35b55fd67f
Merge pull request #19036 from Veykril/push-nprltlwvryxw
Split out `ExpressionStore` from `Body`
2025-01-27 07:54:44 +00:00
Chayim Refael Friedman
791b1ebfd4 Support RFC 2396
AKA. target_feature 1.1, or non unsafe target_feature.
2025-01-26 23:31:58 +02:00
Lukas Wirth
3bb0ff3480 Add GenericDefId::StaticId 2025-01-26 11:07:54 +01:00
Lukas Wirth
55d1d5dd8b Split out ExpressionStore from Body 2025-01-26 11:02:00 +01:00
Lukas Wirth
90bf50c011
Merge pull request #19020 from ShoyuVanilla/issues-19007
fix: Prevent infinite recursion of bounds formatting
2025-01-25 19:03:54 +00:00
Shoyu Vanilla
3fe7415c83 fix: Prevent infinite recursion of bounds formatting 2025-01-26 03:37:00 +09:00
Lukas Wirth
b31f53e0d6 Fix flyimport not filtering via stability of import path 2025-01-25 12:18:54 +01:00
Shoyu Vanilla
f4dfbc38c8 feat: Implement arbitrary-self-types 2025-01-24 22:50:59 +09:00
Teodor Tanasoaia
90533a0ad5
increase AUTODEREF_RECURSION_LIMIT to 20
The limit was introduced in https://github.com/rust-lang/rust-analyzer/pull/1408#discussion_r294059044 to avoid infinite cycles but it effectively caps the number of derefs to 10. Types like `ID3D12Device14` from the `windows` crate run into this because it derefs to `ID3D12Device13`, 13 to 12 and so on. Increasing it to 20 is a quick fix; a better cycle detection method would be nicer long term.
2025-01-22 22:21:02 +01:00
Lukas Wirth
76585539f5 Cleanup Name string rendering 2025-01-21 10:05:32 +01:00
Lukas Wirth
93a5846784
Merge pull request #18967 from Veykril/push-pwonkmwqmmol
Properly record meaningful imports as re-exports in symbol index
2025-01-20 13:46:52 +00:00
Lukas Wirth
40ba51cb02
Merge pull request #18976 from ChayimFriedman2/non-module-generic-args
fix: Fix a bug where enum variants were not considered properly in type ns resolution
2025-01-20 13:35:03 +00:00
Lukas Wirth
0480ebef75 Preserve impl assoc names in ImplData 2025-01-20 14:29:11 +01:00
Laurențiu Nicola
a9e1e65ae8 Merge from rust-lang/rust 2025-01-20 11:09:36 +02:00
Chayim Refael Friedman
044c831f7f Fix a bug where enum variants were not considered properly in type ns resolution
They should be considered just as well as in value ns, for example for struct literals.
2025-01-19 06:31:23 +02:00
Lukas Wirth
5530167a1e feat: Render type parameter projection target bounds in inlays 2025-01-15 08:54:38 +01:00
Lukas Wirth
4f35021ca9
Merge pull request #18907 from Veykril/push-uqlzpttmvurv
Implement `#[rust_analyzer::skip]` for bodies
2025-01-10 13:59:23 +00:00
Lukas Wirth
f209d50dcf Implement #[rust_analyzer::skip] for bodies 2025-01-10 14:41:27 +01:00
Lukas Wirth
bf669dab84 Re-implement rust string highlighting via tool attribute 2025-01-10 13:49:35 +01:00
The 8472
7b368b97ba also initialize Layout field in rust-analyzer 2025-01-10 02:22:57 +01:00
Lukas Wirth
72b9427162
Merge pull request #18846 from Veykril/push-kmspklwynynu
minor: New clippy lints
2025-01-06 17:12:14 +00:00
Lukas Wirth
4b6007115a minor: New clippy lints 2025-01-06 17:57:17 +01:00