Lukas Wirth
88a00bf49d
Shrink PatPtr by swapping its AstPtr and Either wrap order
2023-10-06 12:32:37 +02:00
Lukas Wirth
fe398163b6
Recognize custom main function as binary entrypoint for runnables
2023-10-04 12:07:41 +02:00
Lukas Wirth
2b9dde14ab
Allocate ast ids for parameters
2023-09-28 13:16:11 +02:00
bors
4a8622c8fa
Auto merge of #15652 - Veykril:format_to, r=lnicola
...
minor: Various small fixes
2023-09-22 09:06:06 +00:00
Lukas Wirth
556f0c6704
Various small fixes
2023-09-22 10:13:51 +02:00
bors
22b18b9f77
Auto merge of #15616 - HKalbasi:rustc-deps, r=HKalbasi
...
Switch to in-tree rustc dependencies with a cfg flag
We can use this flag to detect and prevent breakages in rustc CI. (see #14846 and #15569 )
~The `IN_RUSTC_REPOSITORY` is just a placeholder. Is there any existing cfg flag that rustc CI sets?~
2023-09-19 17:41:12 +00:00
Laurențiu Nicola
d39b45a58d
Merge branch 'master' into sync-from-rust
2023-09-18 12:04:59 +03:00
hkalbasi
f4704bc8ae
Switch to in-tree rustc dependencies with a cfg flag
2023-09-15 18:10:11 +03:30
Lukas Wirth
e63e323823
Prefer stable paths over unstable ones in import path calculation
2023-09-14 11:03:41 +02:00
Lukas Wirth
cfcef69072
shrink_to_fit body source map
2023-09-09 14:40:56 +02:00
Lukas Wirth
8f5fee4a5a
Diagnose incorrect and private fields in record structs
2023-09-09 10:45:29 +02:00
Lukas Wirth
55c75450fb
Diagnose private fields in record constructor
2023-09-08 23:19:30 +02:00
Andy Caldwell
7e786ea4cf
Rework no_coverage to coverage(off)
2023-09-08 12:46:06 +01:00
Lukas Wirth
10b0cd7047
Replace format-args parser with upstream fork
2023-09-07 11:37:59 +02:00
bors
f29867bd26
Auto merge of #15559 - Veykril:builtin-format-args, r=Veykril
...
Implement builtin#format_args, using rustc's format_args parser
`format_args!` now expands to `builtin#format_args(template, args...)`, the actual expansion now instead happens in lowering where we desugar this expression by using lang paths.
As a bonus, we no longer need to evaluate `format_args` as an eager macro which means less macro expansions overall -> less cache thrashing!
Fixes https://github.com/rust-lang/rust-analyzer/issues/15082
2023-09-06 17:44:33 +00:00
Lukas Wirth
96f19231d3
Fix hir pretty printing emitting trailing whitespace
2023-09-06 19:31:48 +02:00
Lukas Wirth
5046889f43
Don't allocate the format_args template string as an expression
2023-09-06 19:18:12 +02:00
Lukas Wirth
c0e402637e
Emit builtin#format_args in builtin format_args expander
2023-09-06 18:08:20 +02:00
Lukas Wirth
5fdd1e36e3
Remove todo!()
s
2023-09-06 15:30:44 +02:00
Lukas Wirth
e243a03da1
Desugar builtin#format_args
2023-09-06 15:21:41 +02:00
Lukas Wirth
abe8f1ece4
Implement builtin#format_args, using rustc's format_args parser
2023-09-05 19:19:46 +02:00
bors
caeea45999
Auto merge of #15557 - Veykril:builtin-syntax, r=Veykril
...
Parse builtin# syntax and add typechecking for builtin#offset_of expression
Also removes box syntax, fixes https://github.com/rust-lang/rust-analyzer/issues/14504
cc https://github.com/rust-lang/compiler-team/issues/580 https://github.com/rust-lang/rust-analyzer/issues/15082
2023-09-05 12:10:31 +00:00
Lukas Wirth
3431d586e5
Insert builtin#asm into asm! expansion
2023-09-05 14:00:49 +02:00
Lukas Wirth
15048304e3
Implement offset_of in hir-def and hir-ty
2023-09-05 12:27:52 +02:00
Lukas Wirth
9b8eb807a3
Parse builtin# syntax
2023-09-05 10:36:35 +02:00
bors
99686d56a8
Auto merge of #15551 - Veykril:docs, r=Veykril
...
Move doc comment handling into ide-db
2023-09-02 15:28:07 +00:00
Lukas Wirth
81f0108067
Remove markdown module from rust-analyzer crate
2023-09-02 17:27:52 +02:00
Lukas Wirth
b1575528c0
Move doc comment handling into ide-db
2023-09-02 16:27:26 +02:00
cui fliter
056b6b9416
remove the repetitive word
...
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-09-02 14:18:10 +08:00
Lukas Wirth
c09f175d59
Less once_cell
more std
2023-09-01 17:30:59 +02:00
xffxff
204bc2cb60
fix: diagnostics for 'while let' loop with label in condition
2023-08-26 10:41:19 +08:00
hkalbasi
fa76f60cc1
Run cargo fmt on 1.72
2023-08-25 22:24:41 +03:30
Laurențiu Nicola
30d8aa1bec
Merge commit '9b3d03408c66749d56466bb09baf2a7177deb6ce' into sync-from-ra
2023-08-21 12:44:09 +03:00
Jessie Chatham Spencer
37e0e8af10
Implement extern crate completion
2023-08-20 16:36:59 +00:00
Lukas Wirth
eb6244c5f9
Record import aliases in symbol index
2023-08-18 11:46:35 +02:00
Lukas Wirth
637f496a81
fix: Fix auto-import (and completions) importing #[doc(hidden)]
items
2023-08-17 12:30:19 +02:00
bors
49716e681a
Auto merge of #15472 - Veykril:import-ide-support, r=Veykril
...
internal: Record import origins in ItemScope and PerNS
This records the import items definitions come from in the module scope (as well as what an import resolves to in an ItemScope). It does ignore glob imports as thats a lot more work for little to no gain, glob imports act as if the importing items are "inlined" into the scope which suffices for almost all use cases I believe (to my knowledge, attributes on them have little effect).
There is still a lot of work needed to make this available to the IDE layer, but this lays out the ground work for havin IDE layer support.
cc https://github.com/rust-lang/rust-analyzer/issues/14079
2023-08-17 09:56:42 +00:00
Lukas Wirth
a17d73ad36
Thread imports through the resolver
2023-08-17 10:52:13 +02:00
Lukas Wirth
c4e9b5ac64
Add import info to item scope dumps
2023-08-17 09:33:15 +02:00
Lukas Wirth
af8048266c
Prepare ItemScope for IDE import resolution
2023-08-16 11:33:42 +02:00
bors
b771de3fdc
Auto merge of #15179 - ponyii:fix/default-values-of-const-params-are-ignored, r=HKalbasi
...
the "add missing members" assists: implemented substitution of default values of const params
To achieve this, I've made `hir::ConstParamData` store the default values
2023-08-15 10:17:43 +00:00
bors
2fbe69d117
Auto merge of #15438 - Veykril:eager-parser-stuck, r=Veykril
...
fix: Fix parser being stuck in eager macro inputs
Fixes https://github.com/rust-lang/rust-analyzer/issues/15437
2023-08-12 14:30:38 +00:00
Lukas Wirth
9ac88d8d36
Fix parser being stuck in eager macro inputs
2023-08-12 08:27:27 +02:00
Lukas Wirth
9adff006e8
Simplify
2023-08-10 20:10:19 +02:00
Lukas Wirth
bfad781a77
Memoize block_item_tree_query
2023-08-10 19:24:39 +02:00
Lukas Wirth
fde2d9b47c
Deduplicate FileId field in ModuleOrigin
2023-08-10 19:04:46 +02:00
Lukas Wirth
e5b23e3bc1
Derive block attributes from block item tree
2023-08-10 18:52:27 +02:00
bors
05b0612051
Auto merge of #15428 - Veykril:lsp-types-pin, r=Veykril
...
Fix pinned version of lsp-types
lsp-types published a new patch version that breaks semver with the proposed feature set (this is intended and documented), we unfortunately forgot to specify the patch version for the pinned version so this breaks us.
2023-08-09 18:07:44 +00:00
Lukas Wirth
7e04142f25
Fix pinned version of lsp-types
2023-08-09 20:06:08 +02:00
Lukas Wirth
63aba76735
Remove unnecessary ItemTreeId field in ImportSource
2023-08-09 17:06:52 +02:00