Commit graph

156 commits

Author SHA1 Message Date
Lukas Wirth
bbd9e41606 Don't add --all-targets to runnables for no-std crates 2023-05-28 14:18:44 +02:00
hkalbasi
b0f17668f7 use ::core instead of $crate in option_env! 2023-05-25 18:46:34 +03:30
Lukas Wirth
c7ef6c25b7 internal: Replace Display impl for Name 2023-05-24 20:55:12 +02:00
bors
2f840c2236 Auto merge of #14874 - Veykril:crate-cfg, r=Veykril
expand: Change how `#![cfg(FALSE)]` behaves on crate root

Closes https://github.com/rust-lang/rust-analyzer/issues/14769
2023-05-24 16:06:09 +00:00
Lukas Wirth
74d6826858 expand: Change how #![cfg(FALSE)] behaves on crate root 2023-05-24 13:02:38 +02:00
Lukas Wirth
14dc1ac3bf internal: Shrink ProcMacroExpander from 8 to 4 bytes 2023-05-20 11:31:28 +02:00
hkalbasi
4adfbbfbad partially support panic message in MirEvalError 2023-05-18 18:30:49 +03:30
bors
034d7c8537 Auto merge of #14787 - HKalbasi:mir2, r=HKalbasi
MIR episode 5

This PR inits drop support (it is very broken at this stage, some things are dropped multiple time, drop scopes are wrong, ...) and adds stdout support (`println!` doesn't work since its expansion is dummy, but `stdout().write(b"hello world\n")` works if you use `RA_SYSROOT_HACK`) for interpreting. There is no useful unit test that it can interpret yet, but it is a good sign that it didn't hit a major road block yet.

In MIR lowering, it adds support for slice pattern and anonymous const blocks, and some fixes so that we can evaluate `SmolStr::new_inline` in const eval. With these changes, 57 failed mir body remains.
2023-05-18 09:44:26 +00:00
bors
f9be79603a Auto merge of #14820 - HKalbasi:format-args, r=HKalbasi
Expand `format_args!` with more details
2023-05-18 09:09:06 +00:00
hkalbasi
5c83e222a3 fix format_args expansion error with raw strings 2023-05-18 12:32:41 +03:30
Lukas Wirth
d6dcfa5744 internal: Less file parsing for symbol index generation 2023-05-18 08:25:06 +02:00
hkalbasi
a6e5a912f9 Expand format_args! with more details 2023-05-16 19:12:40 +03:30
hkalbasi
cbcafd3539 MIR episode 5 2023-05-12 18:17:15 +03:30
hkalbasi
7da80d4f67 Use double reference in debug derive 2023-05-12 12:36:57 +03:30
Ryo Yoshida
34a9129333
fix: column!() and line!() built-in macros return u32 2023-05-11 21:13:05 +09:00
hkalbasi
d9f4cbbe8f Emit function bodies in expanding builtin derives 2023-05-03 14:14:47 +03:30
Laurențiu Nicola
7197a27028 Use triomphe Arc 2023-05-02 20:02:43 +03:00
bors
e46d7a030f Auto merge of #14651 - Veykril:workspace-vscode-fix, r=Veykril
fix: Fix vscode workspaces not working properly

Fixes https://github.com/rust-lang/rust-analyzer/issues/14571
2023-04-25 09:09:31 +00:00
Lukas Wirth
49fcd4edda fix: Fix vscode workspaces not working properly 2023-04-25 10:47:33 +02:00
bors
707382c21d Auto merge of #14652 - Veykril:pat2021, r=Veykril
fix: Fix pat fragment handling in 2021 edition

Fixes https://github.com/rust-lang/rust-analyzer/issues/9055

The fix isn't that great, but we are kind of forced to do it the quick and hacky way right now since std has changed the `matches` macro to make use of this now. And for a proper fix we need to track hygiene for identifiers which is a long way off anyways
2023-04-24 20:36:45 +00:00
Lukas Wirth
d1ca505525 fix: Fix pat fragment handling in 2021 edition 2023-04-24 22:21:37 +02:00
Lukas Wirth
cebc018e2a Remove unnecessary is_derive field from MacroCallKind::Attr 2023-04-22 14:29:28 +02:00
bors
5750d81e30 Auto merge of #14632 - Veykril:lru-macro, r=lnicola
internal: Increase LRU cache size for parse_expansion and macro_expand queries
2023-04-22 11:13:35 +00:00
Lukas Wirth
6253fc031b Increase LRU cache size for parse_expansion and macro_expand queries 2023-04-22 11:28:56 +02:00
Ryo Yoshida
85e76542fe
Cache Hygiene in DefCollector 2023-04-22 18:22:29 +09:00
Ryo Yoshida
cf72b6232b
Resolve $crate in derive paths 2023-04-20 15:50:17 +09:00
bors
2400b36a2e Auto merge of #14577 - jsoref:spelling, r=lnicola
Spelling

This PR corrects misspellings identified by the [check-spelling action](https://github.com/marketplace/actions/check-spelling).

The misspellings have been reported at https://github.com/jsoref/rust-analyzer/actions/runs/4699991040#summary-12751355796

The action reports that the changes in this PR would make it happy: https://github.com/jsoref/rust-analyzer/actions/runs/4699991284#summary-12751356293

closes #14567
2023-04-19 14:05:40 +00:00
Josh Soref
bc7d84c3ce Spelling
* a rule
* access
* after
* amount
* annotations
* assignment
* assist
* associated
* attribute
* borrowed
* built-in type
* clarification
* command
* const
* constructor
* corresponding
* counterparts
* curlies
* dependencies
* deterministic
* diagnostic
* duplicates
* edge
* edited
* efficient
* elsewhere
* execution
* expression
* extensions
* extracted
* fill
* github
* helper
* heuristic
* incomplete
* indent end
* inlay
* invocation
* lifetime
* looking
* maybe
* move
* mutability
* mutable
* necessarily
* necessary
* negative
* nonexistent
* occurred
* offsets
* offsetted
* overridden
* parameters
* params
* params_and_where_preds_in_scope
* paredit
* parent
* parentheses
* prepended if
* punctuation
* receive
* receiver
* referring
* repeated
* representing
* semantically
* separately
* shouldnot
* siblings
* similar
* something's
* statement
* struct
* structure
* surprise
* the
* this
* transparent
* unimplemented
* unnamed
* unnecessary
* unneeded
* unreachable
* unterminated
* utilities
* variant
* variants
* visibility
* work around (v)
* workaround

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-19 09:45:55 -04:00
Lukas Wirth
4ea5d7f6a0 Re-introduce option for macro_arg to prevent calling macros with empty inputs 2023-04-16 20:26:26 +02:00
Lukas Wirth
a2a3fecae3 Option begone part 2 2023-04-16 19:20:48 +02:00
Lukas Wirth
96a774261f Option begone part 1 2023-04-16 19:20:42 +02:00
Lukas Wirth
0f4ffaa5af Fix duplicate eager expansion errors 2023-04-16 19:20:35 +02:00
Lukas Wirth
d1632c2727 Report syntax errors from item level macro expansions 2023-04-16 17:22:06 +02:00
Lukas Wirth
71b50f9f09 Record eager expansion errors in EagerCallInfo 2023-04-16 16:11:59 +02:00
Lukas Wirth
6ae8d49e15 Simplify eager macro error handling 2023-04-16 15:46:12 +02:00
Lukas Wirth
a5558cdfe5 internal: Report macro definition errors on the definition 2023-04-16 14:15:59 +02:00
Lukas Wirth
ed3a5eac3c internal: Put Attrs behind a query instead of AttsWithOwner 2023-04-14 12:47:33 +02:00
Jonas Schievink
901c8a4259 Map tokens from include! expansion to the included file 2023-04-13 17:41:24 +02:00
hkalbasi
c54cb88950 Add bounds for associated types in derive macro 2023-04-07 19:33:14 +03:30
Lukas Wirth
435d585d0c
Revert "Add bounds for fields in derive macro" 2023-04-07 11:01:17 +02:00
bors
d73161b491 Auto merge of #14524 - Veykril:hir-pretty, r=Veykril
internal: Render function parameters in hir-def pretty printing
2023-04-07 07:34:45 +00:00
Lukas Wirth
513d4a9c9a Render function parameters in hir-def pretty printing 2023-04-07 09:34:04 +02:00
hkalbasi
0241b52dad Add bounds for fields in derive macro 2023-04-07 02:21:46 +03:30
Lukas Wirth
0e7117900c internal: Resolve labels in body lowering 2023-04-06 14:21:20 +02:00
bors
d1c7984396 Auto merge of #14407 - Veykril:rename-fix, r=Veykril
fix: Fix renames of locals being broken in macro calls

Fixes https://github.com/rust-lang/rust-analyzer/issues/14379
2023-03-25 18:35:13 +00:00
Lukas Wirth
0daf069b0e fix: Fix renames of locals being broken in macro calls 2023-03-25 18:37:18 +01:00
Lukas Wirth
d154ea88f9 Split out proc-macros from the CrateGraph 2023-03-25 16:46:44 +01:00
hkalbasi
8e73ea5253 Desugar try blocks 2023-03-19 13:02:51 +03:30
hkalbasi
a063f000ff Support function pointer MIR lowering 2023-03-17 13:08:35 +03:30
Lukas Wirth
9fe206956f fix: Fix ast::IfExpr child accessors 2023-03-15 14:34:31 +01:00