bors
0ae42bd425
Auto merge of #17814 - ShoyuVanilla:object-safety, r=Veykril
...
feat: Implement object safety and its hovering hint
Resolves #17779
- [x] Fill missing implementations
- [x] Hover rendering
- [x] Implement object safety's own test suite, like layout
- [x] Add test cases (from rustc maybe)
- [x] Clean up ugly codes
- [x] Add doc string
2024-08-29 13:24:54 +00:00
Shoyu Vanilla
6520a43ca3
feat: Implement object safety
2024-08-29 22:22:21 +09:00
Chayim Refael Friedman
0e4f4d3f9c
Create an assist to convert closure to freestanding fn
...
The assist converts all captures to parameters.
2024-08-27 17:07:55 +03:00
Chayim Refael Friedman
e6d59e65ec
Add helper methods to retrieve Future::Output
and Iterator::Item
2024-08-24 23:46:32 +03:00
Chayim Refael Friedman
da931e7398
Fix few bugs in closure capture computation, and add tests
...
Also create a test infrastructure for capture computation.
2024-08-24 22:35:49 +03:00
Lukas Wirth
64064907ce
Fully remove old macro descension API
2024-08-22 16:18:01 +02:00
Chayim Refael Friedman
9d3368f2c2
Properly account for editions in names
...
This PR touches a lot of parts. But the main changes are changing
`hir_expand::Name` to be raw edition-dependently and only when necessary
(unrelated to how the user originally wrote the identifier),
and changing `is_keyword()` and `is_raw_identifier()` to be edition-aware
(this was done in #17896 , but the FIXMEs were fixed here).
It is possible that I missed some cases, but most IDE parts should properly
escape (or not escape) identifiers now.
The rules of thumb are:
- If we show the identifier to the user, its rawness should be determined
by the edition of the edited crate. This is nice for IDE features,
but really important for changes we insert to the source code.
- For tests, I chose `Edition::CURRENT` (so we only have to (maybe) update
tests when an edition becomes stable, to avoid churn).
- For debugging tools (helper methods and logs), I used `Edition::LATEST`.
2024-08-16 16:46:24 +03:00
Lukas Wirth
ded3e21fdd
fix: Correctly support #[rustc_deprecated_safe_2024]
2024-08-12 10:56:59 +02:00
Vincent Esche
ddb9686246
Fix spelling of "object-oriented"
2024-08-06 00:25:02 +02:00
Shoyu Vanilla
8a51419a2d
feat: Implement diagnostic for await
outside of async
2024-08-05 21:47:57 +09:00
Lukas Wirth
d46060b168
Fix error spans for include! and compile_error!
2024-07-29 15:57:01 +02:00
Lukas Wirth
ae9c553902
Make basic use of spans for macro expansion errors
2024-07-29 14:52:40 +02:00
Lukas Wirth
7beac14cba
Internal: Cleanup proc-macro error handling
2024-07-26 14:38:19 +02:00
Lukas Wirth
9cbafa2d49
Remove Params and Fields from AstIdMap
2024-07-25 10:22:05 +02:00
Vincent Esche
acb50efb3a
Add method Impl::all_in_module(…)
for supporting more localized querying
2024-07-23 14:43:38 +02:00
Lukas Wirth
7c374a10bd
internal: Shrink size of Binding
2024-07-22 17:14:17 +02:00
Lukas Wirth
5806950712
Remove incorrect never! invocations
2024-07-22 10:53:18 +02:00
Lukas Wirth
5264f86242
Encode edition within FileId in the hir layer
2024-07-18 08:49:10 +02:00
Lukas Wirth
2346a80ab4
Remove Name::to_smol_str
2024-07-16 12:43:58 +02:00
Lukas Wirth
df5f1777b8
More symbol usage
2024-07-16 12:05:16 +02:00
Lukas Wirth
93024ad411
Switch token trees to use Symbols
2024-07-16 10:11:59 +02:00
Lukas Wirth
f2d51073d2
Use statics + clone instead of const until const can access statics
2024-07-14 17:52:59 +02:00
Lukas Wirth
3fe815b0f3
Use Symbol in Name
2024-07-12 16:06:44 +02:00
beetrees
d5db933f9d
Add f16
and f128
support
2024-07-10 10:43:14 +01:00
Lukas Wirth
966798b7ba
Make GenericParams::lifetimes private
2024-07-02 13:45:53 +02:00
Lukas Wirth
372e2d22e6
Make GenericParams::type_or_consts private
2024-07-02 13:45:48 +02:00
Lukas Wirth
1a929d6485
Fix lifetime parameters moving paramter defaults
2024-07-02 12:34:32 +02:00
Lukas Wirth
21a3d01875
Remove inline rust_2018_idioms, unused_lifetimes
lint warn, Cargo.toml already enforces this
2024-06-30 15:23:54 +02:00
Lukas Wirth
8df034d453
Shrink mbe's Op
2024-06-24 10:07:32 +02:00
Lukas Wirth
3168ab5b99
Enum variants are not generic def ids
2024-06-24 10:07:31 +02:00
roife
d5bb2f0cba
fix: use ItemInNs::Macros to convert ModuleItem to ItemInNs
2024-06-21 21:05:14 +08:00
Lukas Wirth
8520a0c585
Thread more HasSource::source calls through Semantics for caching
2024-06-10 10:33:07 +02:00
Wilfred Hughes
27182bb96b
chore: Prefer tracing span shorthand macros
2024-06-06 16:52:25 -07:00
Lukas Wirth
9349045e09
Use dyn cache for Semantics macro resolution
2024-06-04 16:25:38 +02:00
Lukas Wirth
6f0207d594
Cleanup some inert attribute stuff
2024-06-04 12:38:20 +02:00
bors
cb6b808185
Auto merge of #17315 - hamirmahal:style/simplify-string-interpolation, r=Veykril
...
style: simplify string interpolation
2024-06-03 12:29:27 +00:00
Hamir Mahal
7c34eb3880
style: simplify string interpolation
2024-05-30 16:18:49 -07:00
Vincent Esche
7b75f1113c
Add Function::fn_ptr_type(…)
for obtaining name-erased function type
2024-05-29 19:41:55 +02:00
David Barsky
a0d3a81a19
fix: ensure implied bounds from associated types are considered in autocomplete
2024-05-22 16:16:20 -04:00
David Barsky
b75301cec8
internal: refactor prefer_no_std
/prefer_prelude
bools into a struct
2024-05-22 20:46:30 +02:00
bors
6a16749eb0
Auto merge of #17277 - Veykril:find-path-fixes, r=Veykril
...
fix: Various find path fixes
Fixes https://github.com/rust-lang/rust-analyzer/issues/17271
2024-05-22 18:22:32 +00:00
Lukas Wirth
c88b421853
fix: Fix general find-path inconsistencies
2024-05-22 14:05:24 +02:00
Lukas Wirth
7bd343e085
Show fn traits in signature info for trait implementors
2024-05-18 16:22:59 +02:00
Lukas Wirth
ff79903cf6
Render closure fn trait kind in siganture help
2024-05-18 15:01:37 +02:00
Lukas Wirth
7c6f31a45b
Allow hir::Param to refer to other entity params aside from functions
2024-05-18 12:35:55 +02:00
Lukas Wirth
cd9e90cc71
Update builtin tool list
2024-05-18 10:52:05 +02:00
Lukas Wirth
aaa5426fec
internal: Add StaticLifetime to hir API
2024-05-16 08:02:51 +02:00
bors
b98690ba74
Auto merge of #17221 - Veykril:lazier-validation, r=Veykril
...
internal: Lazier macro parse tree validation
2024-05-13 15:16:46 +00:00
Lukas Wirth
caddcccea5
parse_macro_expansion_error
almost never contains values so Option
it
2024-05-13 17:02:08 +02:00
Lukas Wirth
56552f4839
Push macro-parsing error calculation out of fundamental queries
2024-05-13 16:56:26 +02:00