Jonas Marcello
9942cc425b
Fix 14142: Annotate lifetime paramaters in doctest runnables
2023-02-27 18:08:17 +01:00
shilangyu
44e47fe408
Add check for extra path segments after an angled one
2023-02-25 16:16:49 +01:00
Lukas Wirth
026a8c976d
Simplify
2023-02-15 13:38:42 +01:00
Lukas Wirth
4aee911ce4
Slim down GenericArgs by one usize once more
2023-02-14 17:41:16 +01:00
Lukas Wirth
853ae1927d
Slim down GenericArgs by one usize
2023-02-14 17:40:24 +01:00
Lukas Wirth
4c2aef650a
Slim down AssociatedTypeBinding by one usize
2023-02-14 17:40:24 +01:00
bors
41db8c2b59
Auto merge of #14151 - Veykril:smallvec, r=Veykril
...
internal: Enable smallvec's `union` feature
2023-02-14 16:24:21 +00:00
Lukas Wirth
a18ebf40cb
Don't allocate the generic_args vec in hir_def::Path if it consists only of None
args
2023-02-14 17:01:38 +01:00
Lukas Wirth
3c0f20a7bd
internal: Enable smallvec's union
feature
2023-02-14 17:01:01 +01:00
bors
44568007d1
Auto merge of #14128 - Veykril:parser, r=Veykril
...
internal: Improve parser recovery for delimited lists
Closes https://github.com/rust-lang/rust-analyzer/issues/11188 , https://github.com/rust-lang/rust-analyzer/issues/10410 , https://github.com/rust-lang/rust-analyzer/issues/10173
Should probably be merged after the stable release as this might get the parser stuck if I missed something
2023-02-14 12:59:39 +00:00
Lukas Wirth
4f6b5f41d4
Recover better for more delimited sequences
2023-02-14 13:52:15 +01:00
bors
2a57b01980
Auto merge of #14122 - lowr:patch/abort-macro-expansion-on-overflow, r=Veykril
...
fix: Don't expand macros in the same expansion tree after overflow
This patch fixes 2 bugs:
- In `Expander::enter_expand_id()` (and in code paths it's called), we never check whether we've reached the recursion limit. Although it hasn't been reported as far as I'm aware, this may cause hangs or stack overflows if some malformed attribute macro is used on associated items.
- We keep expansion even when recursion limit is reached. Take the following for example:
```rust
macro_rules! foo { () => {{ foo!(); foo!(); }} }
fn main() { foo!(); }
```
We keep expanding the first `foo!()` in each expansion and would reach the limit at some point, *after which* we would try expanding the second `foo!()` in each expansion until it hits the limit again. This will (by default) lead to ~2^128 expansions.
This is essentially what's happening in #14074 . Unlike rustc, we don't just stop expanding macros when we fail as long as it produces some tokens so that we can provide completions and other services in incomplete macro calls.
This patch provides a method that takes care of recursion depths (`Expander::within_limit()`) and stops macro expansions in the whole macro expansion tree once it detects recursion depth overflow. To be honest, I'm not really satisfied with this fix because it can still be used in unintended ways to bypass overflow checks, and I'm still seeking ways such that misuses are caught by the compiler by leveraging types or something.
Fixes #14074
2023-02-14 07:37:53 +00:00
Laurențiu Nicola
354b1aaa50
Merge branch 'master' into sync-from-rust
2023-02-14 08:40:55 +02:00
Laurențiu Nicola
bc45c7659a
⬆️ rust-analyzer
2023-02-13 13:55:14 +02:00
Lukas Wirth
1be24e0899
internal: Improve parser recovery a bunch
2023-02-11 20:28:36 +01:00
Ryo Yoshida
ae7e62c50f
Don't expand macros in the same expansion tree after overflow
2023-02-11 18:19:08 +09:00
Lukas Wirth
e59487de38
Add tests for float access macro call inputs
2023-02-07 17:12:24 +01:00
Lukas Wirth
c6e7917d6e
Fix up token_tree_to_syntax_node float split handling
2023-02-07 15:21:37 +01:00
Lukas Wirth
41a46a78f2
Make tt generic over the span data
2023-01-31 14:58:16 +01:00
bors
06981d4b10
Auto merge of #14062 - WaffleLapkin:сurrent_edition, r=Veykril
...
internal: Set "current" edition to 2021
:p
2023-01-31 11:03:49 +00:00
Maybe Waffle
249ea9502d
Set "current" edition to 2021
2023-01-31 10:51:43 +00:00
Lukas Wirth
c65782e64a
Parse macros allow_internal_unsafe attribute
2023-01-30 15:41:08 +01:00
Lukas Wirth
4a677e91aa
minor: Remove unnecessary arg in LowerCtx::ast_id
2023-01-25 21:52:28 +01:00
Lukas Wirth
f8ed4d7ae4
Use lang item resolution instead of known paths
2023-01-21 19:03:36 +01:00
Lukas Wirth
1535881836
Replace SmolStr usage with lang item enum for lang items
2023-01-21 17:55:45 +01:00
Laurențiu Nicola
392a6ee422
Bump once_cell
2023-01-21 08:48:46 +02:00
bors
fa874627f0
Auto merge of #13969 - Veykril:workspace.dependencies, r=Veykril
...
Use workspace.dependencies to declare local dependencies
2023-01-17 10:29:27 +00:00
bors
62907858d5
Auto merge of #13964 - Veykril:workspace.package, r=Veykril
...
Specify authors, edition, license and rust-versian via workspace.package
2023-01-17 10:13:24 +00:00
Lukas Wirth
bed4db3c62
Use workspace.dependencies to declare local dependencies
2023-01-17 10:52:26 +01:00
hkalbasi
77efa0267d
Don't compute layout if TargetDataLayout
is not available
2023-01-16 22:43:27 +03:30
Lukas Wirth
e4858fe480
Specify authors, edition and license via workspace.package
2023-01-16 16:44:00 +01:00
Lukas Wirth
679df2adf1
Specify rust-version via workspace.package
2023-01-16 16:33:01 +01:00
bors
cdbe025232
Auto merge of #13922 - danieleades:loop-that-never-loops, r=lnicola
...
minor: loop-that-never-loops
closes #13921
2023-01-13 11:23:51 +00:00
Daniel Eades
7413a9954f
interior-mutable types should be 'static' rather than 'const
2023-01-12 10:48:10 +00:00
daniel.eades
a3114c3697
move loop index inside iterator
2023-01-11 16:07:35 +00:00
Albert Larsan
3e0e51c108
Change src/test
to tests
in source files, fix tidy and tests
2023-01-11 09:32:13 +00:00
Daniel Eades
95fc3ba41c
fixup
2023-01-10 19:51:21 +00:00
Daniel Eades
ac3844a0bb
a number of code simplifications
2023-01-10 18:48:51 +00:00
bors
c3b78f440e
Auto merge of #13917 - Veykril:raw-attrs, r=Veykril
...
Split out hir-def attribute handling parts into hir-expand
This should help with `cfg_attr` handling for macro inputs
2023-01-10 17:35:37 +00:00
Daniel Eades
6153ea8dce
loop-that-never-loops
2023-01-10 08:28:28 +00:00
Lukas Wirth
621e96bd6a
Encode one level of cfg_attr in attr_id
2023-01-09 21:06:13 +01:00
arcnmx
25242fe93f
⬆️ rust-analyzer
...
Merge commit '368e0bb32f1178cf162c2ce5f7e10b7ae211eb26'
2023-01-09 10:36:22 -08:00
Lukas Wirth
68723043db
Split out hir-def attribute handling parts into hir-expand
2023-01-09 19:29:28 +01:00
bors
e125bee055
Auto merge of #13890 - lowr:fix/unescape-inline-mod-name, r=Veykril
...
fix: unescape inline module names in module resolution
Fixes #13884
2023-01-09 15:07:06 +00:00
Ryo Yoshida
21ea0048cd
fix: unescape inline module names in module resolution
2023-01-04 18:22:01 +09:00
Daniel Eades
4f8ffd0ba4
remove unnecessary lifetimes that can be elided
2023-01-02 15:02:54 +00:00
Daniel Eades
efd2c20e96
remove useless conversions
2023-01-02 15:02:54 +00:00
Daniel Eades
cc80c5bd07
remove unnecessary lazy evaluations
2023-01-02 15:02:54 +00:00
Daniel Eades
ed128872eb
remove needless borrows
2023-01-02 14:52:32 +00:00
Daniel Eades
77051679d7
use inline format args
2023-01-02 14:52:32 +00:00