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
Lukas Wirth
e462ee79e4
fix: Handle newstyle rustc_intrinsic
safety correctly
2025-01-06 09:47:31 +01:00
Lukas Wirth
b67de74de9
Merge pull request #18825 from Veykril/push-sllokkprznkq
...
minor: Encode TraitData bools as bitflags
2025-01-03 12:01:08 +00:00
Lukas Wirth
4d66fa797f
minor: Encode TraitData bools as bitflags
2025-01-03 12:46:07 +01:00
Lukas Wirth
b6910ed1b2
Merge pull request #18327 from ChayimFriedman2/flat-tt
...
Store token trees in contiguous `Vec` instead of as a tree
2025-01-03 11:31:58 +00:00
Chayim Refael Friedman
ceba289f80
Store token trees in contiguous Vec
instead of as a tree
...
I expected this to be faster (due to less allocations and better cache locality), but benchmarked it is not (neither it is slower). Memory usage, however, drops by ~50mb (of `analysis-stats .`). I guess tt construction is just not hot.
This also simplifies using even less memory for token trees by compressing equal span, which I plan to do right after.
Some workflows are more easily expressed with a flat tt, while some are better expressed with a tree. With the right helpers, though (which was mostly a matter of trial and error), even the worst workflows become very easy indeed.
2025-01-02 19:21:46 +02:00
Chayim Refael Friedman
bb400ca121
Fix overflow detection in MIR evaluation
...
With a bit of higher-order macros everything sorts out well.
And also fix a discovered bug when comparing long strings.
2025-01-02 11:51:12 +02:00
Chayim Refael Friedman
7e6ade117c
Allow excluding specific traits from completion
...
To be accurate, only their methods are excluded, the trait themselves are still available.
I also excluded a bunch of std traits by default. Some less opinionated, like `AsRef`, which should never be used directly except in generic scenarios (and won't be excluded there), some more opinionated, like the ops traits, which I know some users sometimes want to use directly. Either way it's configurable.
It should be pretty easy to extend support to excluding only specific methods, but I didn't do that currently.
Traits configured to be excluded are resolved in each completion request from scratch. If this proves too expensive, it is easy enough to cache them in the DB.
2025-01-01 13:49:35 +01:00
Lukas Wirth
add0963033
Merge pull request #18758 from mgsloan/scip-unique-symbols
...
Improve SCIP symbols
2024-12-31 09:25:30 +00:00
Michael Sloan
03cb63cc75
Make impl HirDisplay for TraitRef
provide just the trait type
2024-12-30 13:34:02 -07:00
Lukas Wirth
90b724afad
Merge pull request #18785 from Veykril/push-uvsqposqyvmo
...
Cleanup toolchain info fetching
2024-12-29 12:57:31 +00:00
Lukas Wirth
11b351f44b
Merge pull request #18774 from Veykril/push-ysppqxpuknnw
...
Implement parameter variance inference
2024-12-29 12:34:48 +00:00
Lukas Wirth
f5fb2b9e9f
Force a current dir to be supplied for rustc info fetching
2024-12-29 13:26:04 +01:00
Lukas Wirth
0f95e60da3
Cleanup toolchain info fetching
2024-12-29 12:25:51 +01:00
Lukas Wirth
2d299ab8a4
Describe variance resolution approach differences to rustc
2024-12-29 10:53:17 +01:00
Chayim Refael Friedman
664e1a18c9
Consider Enum::Variant
even when it comes from a different crate
2024-12-28 22:43:51 +02:00
Lukas Wirth
bb921fbe94
Show variance of parameters on hover
2024-12-28 20:31:20 +01:00
Lukas Wirth
60e28c6bd9
Simplify
2024-12-28 19:54:22 +01:00
Lukas Wirth
9419e199d8
Get rid of constrain and solve steps
2024-12-28 19:54:22 +01:00