Commit graph

889 commits

Author SHA1 Message Date
Lukas Wirth
2a4be8d1f7 Bump Cargo.lock 2024-05-14 10:57:02 +02:00
Lukas Wirth
56552f4839 Push macro-parsing error calculation out of fundamental queries 2024-05-13 16:56:26 +02:00
bors
ecba59d69c Auto merge of #17175 - Veykril:fix-implicit-ty-args, r=Veykril
fix: Fix implicit ty args being lowered where they shouldn't

Fixes https://github.com/rust-lang/rust-analyzer/issues/17173
2024-05-02 10:04:13 +00:00
Lukas Wirth
8241d8a0b8 fix: Fix implicit ty args being lowered where they shouldn't 2024-05-02 11:53:53 +02:00
Lukas Wirth
a268eaf053 fix: Correctly handle no_core/no_std for preludes 2024-05-02 10:50:28 +02:00
Lukas Wirth
da0fb75d10
Use RefCell::take 2024-04-30 14:19:56 +02:00
dfireBird
40a677ddf0
implement creating generics for impl traits in associated types 2024-04-29 23:55:02 +05:30
Lukas Wirth
36c1c77cf9 fix: Fix doc comment desugaring for proc-macros 2024-04-27 13:30:51 +02:00
Lukas Wirth
bfe59bbdc8 fix: Fix attributes on generic parameters colliding in item tree 2024-04-27 13:15:36 +02:00
Lukas Wirth
ac389ce2ef fix: Fix expression scopes not being calculated for inline consts 2024-04-25 09:49:19 +02:00
bors
4c08e2d32f Auto merge of #16938 - Nilstrieb:dont-panic-tests, r=Veykril
Implement `BeginPanic` handling in const eval

for #16935, needs some figuring out of how to write these tests correctly
2024-04-21 16:22:02 +00:00
Laurențiu Nicola
4c94e69115 Add in-rust-tree feature to hir-expand 2024-04-20 18:44:27 +03:00
roife
a543516ea4 fix: handle escaped chars in doc comments 2024-04-19 14:57:37 +08:00
Lukas Wirth
a9140e197c Fix #[rustc_const_panic_str] functions not actually being hooked 2024-04-18 15:49:08 +02:00
Lukas Wirth
5df690e13f Fixup some issues with minicore 2024-04-18 12:20:54 +02:00
Lukas Wirth
531a270d91 Generally optimize diagnostics performance 2024-04-15 22:15:41 +02:00
Lukas Wirth
94e38261b3 Optimize exhaustiveness checking perf a bit 2024-04-15 19:35:48 +02:00
Lukas Wirth
a483d3bc37 internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros 2024-04-14 16:02:38 +02:00
Lukas Wirth
83370fe5d7 Use Edition::CURRENT 2024-04-14 15:30:29 +02:00
Johann Hemmann
2cf5d8811a Raise edition one more level 2024-04-14 15:11:33 +02:00
Lukas Wirth
a82e028e30 Cleanup util::Generics method names 2024-04-06 14:29:40 +02:00
Lukas Wirth
f3567bb604 Arc CrateData::cfg_options 2024-04-06 13:55:10 +02:00
Lukas Wirth
13890697eb Simplify 2024-04-06 13:12:07 +02:00
Lukas Wirth
5957835cdf Consider exported_name="main" functions in test modules as tests 2024-04-04 14:51:10 +02:00
Lukas Wirth
2b62d4b2ba Fix some cfg censoring bugs 2024-04-03 16:43:08 +02:00
Lukas Wirth
707be6b99c Adjust display impls to respect lifetime bounds 2024-04-02 14:51:08 +02:00
Lukas Wirth
0927f86247 Replace static_lifetime usages with error_lifetime, lower outlives goals 2024-04-02 14:51:06 +02:00
dfireBird
69c4ac6304
implement len and is_empty method in generic_params 2024-03-29 18:26:46 +05:30
bors
0583aaa555 Auto merge of #16805 - dfireBird:lifetime_lowering, r=Veykril
feat: Implement resolving and lowering of Lifetimes (no inference yet)
2024-03-26 07:58:43 +00:00
dfireBird
0e54e2b55a
use references in Generics iter methods 2024-03-26 13:04:54 +05:30
Lukas Wirth
8e324e98a1 Rename ProcMacroKind::FuncLike to Bang 2024-03-22 11:20:56 +01:00
bors
16c8deeb86 Auto merge of #16835 - wyatt-herkamp:use_one_tt_for_a_derive, r=Veykril
Have Derive Attribute share a token tree with it's proc macros.

The goal of this PR is to stop creating a token tree for each derive proc macro.

This is done by giving the derive proc macros an id to its parent derive element.

From running the analysis stat on the rust analyzer project I did see a small memory decrease.

```
Inference:           42.80s, 362ginstr, 591mb
MIR lowering:        8.67s, 67ginstr, 291mb
Mir failed bodies: 18 (0%)
Data layouts:        85.81ms, 609minstr, 8mb
Failed data layouts: 135 (6%)
Const evaluation:    440.57ms, 5235minstr, 13mb
Failed const evals: 1 (0%)
Total:               64.16s, 552ginstr, 1731mb
```
After Change
```
Inference:           40.32s, 340ginstr, 593mb
MIR lowering:        7.95s, 62ginstr, 292mb
Mir failed bodies: 18 (0%)
Data layouts:        87.97ms, 591minstr, 8mb
Failed data layouts: 135 (6%)
Const evaluation:    433.38ms, 5226minstr, 14mb
Failed const evals: 1 (0%)
Total:               60.49s, 523ginstr, 1680mb
```

Currently this breaks the expansion for the actual derive attribute.

## TODO
- [x] Pick a better name for the function `smart_macro_arg`
2024-03-21 18:04:38 +00:00
Wyatt Herkamp
c381d0fc64 Review Updates 2024-03-21 13:41:46 -04:00
Wyatt Herkamp
262e06f1ef Remove MacroCallKind::DeriveAttr 2024-03-21 12:50:58 -04:00
Wyatt Herkamp
c376addfcc Cleanup 2024-03-21 08:12:26 -04:00
Wyatt Herkamp
2c2bbe07fd Treat Derive Macro specially. 2024-03-21 08:07:54 -04:00
Wyatt Herkamp
4bd2f948bb Formatting 2024-03-21 08:07:54 -04:00
Wyatt Herkamp
15d183be79 Initial Attempt limiting number of token tree in macro expansion. 2024-03-21 08:06:43 -04:00
Lukas Wirth
928d847cc2 Keep the span for Attr::Literal 2024-03-21 10:28:25 +01:00
Lukas Wirth
6d1071962f Resolve whether $pat is $pat_param or not via 🌟hygiene🌟 2024-03-21 10:22:45 +01:00
Lukas Wirth
255a8aef92 Move Edition into span crate 2024-03-21 10:21:44 +01:00
dfireBird
13301e7a1a
replace static_lifetime with new_lifetime_var where necessary
implemented suggested fixes and changes and fix merge conflicts
2024-03-18 17:53:09 +05:30
dfireBird
a6c8cbfd91
update Generics iter methods to return GenericParamId 2024-03-18 17:18:08 +05:30
dfireBird
f95b3d4cd2
implement resolving and lowering of Lifetimes 2024-03-18 17:18:06 +05:30
Lukas Wirth
b59c8c76db Repalce Span with SyntaxContextId in MacroCallLoc 2024-03-15 12:47:05 +01:00
Lukas Wirth
3b1ad2379d internal: Make def site span for proc-macro more invalidation resistant 2024-03-15 10:14:00 +01:00
Lukas Wirth
d085ade631 Remove dead test code 2024-03-14 16:24:51 +01:00
Lukas Wirth
d2f8eae2ec feat: Support macro calls in eager macros for IDE features 2024-03-14 15:40:35 +01:00
Lukas Wirth
9767156a29 Simplify 2024-03-13 20:02:21 +01:00
Lukas Wirth
abe3177445 Shrink MacroCallLoc 2024-03-13 18:05:27 +01:00