Lukas Wirth
98cff6572d
Don't discard attributed items when a proc-macro unexpectedly fails to expand
2021-10-29 15:10:44 +02:00
Lukas Wirth
a044175412
Simplify
2021-09-13 18:50:19 +02:00
Aleksey Kladov
d8a3d6f378
internal: cleanup proc macro server error handlig
...
When dealing with proc macros, there are two very different kinds of
errors:
* first, usual errors of "proc macro panicked on this particular input"
* second, the proc macro server might day if the user, eg, kills it
First kind of errors are expected and are a normal output, while the
second kind are genuine IO-errors.
For this reason, we use a curious nested result here: `Result<Result<T,
E1>, E2>` pattern, which is 100% inspired by http://sled.rs/errors.html
2021-08-31 19:01:39 +03:00
Aleksey Kladov
722a2a4690
minor: improve readability
...
naming, layout & comments help!
2021-08-31 15:46:00 +03:00
Aleksey Kladov
0d5c671d76
minor: reformat
2021-08-28 23:38:39 +03:00
Aleksey Kladov
c639fe333f
internal: improve compilation critical path a bit
2021-08-28 22:43:37 +03:00
Aleksey Kladov
55e9476e4b
internal: more production-ready proc-macro RPC deserialization
...
* avoid arbitrary nested JSON tree (danger of stack overflow)
* use more compact representation.
2021-08-28 22:43:37 +03:00
Aleksey Kladov
e86388689f
internal: remove unreasonable crate dependency
...
Proc macro expansion shouldn't know about salsa at all.
2021-08-22 14:05:12 +03:00
Aleksey Kladov
8df38aa797
internal: make sure that proc macro machinery doesn't depend on cwd
2021-07-17 17:55:16 +03:00
Aleksey Kladov
9318c643f1
internal: make it easier to isolate IO
2021-07-17 17:55:16 +03:00
Jonas Schievink
29db33ce76
Address review comments
2021-07-12 15:19:53 +02:00
Jonas Schievink
5a9ca311e3
Remove proc macro management thread
2021-07-08 16:43:39 +02:00
Laurențiu Nicola
6b187af337
Add profiling spans under cargo_to_crate_graph
2021-04-22 21:25:29 +03:00
Edwin Cheng
a8c9c88292
Add test for proc-macro meta info retrieval
2021-03-15 23:38:22 +08:00
Edwin Cheng
cc8c40480a
Print warning if proc-macro built by old rustc
2021-03-04 14:47:34 +08:00
Jay Somedon
0669abda4a
Revise error message regarding metadata version
...
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2021-03-04 09:15:28 +08:00
Jay Somedon
a8f7326ee5
Update condition check code style
...
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-03-04 09:11:43 +08:00
Jay Somedon
c92db2abf9
Update comment
...
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-03-04 09:11:43 +08:00
Jay Somedon
55d73bc675
Fix multiple issues from code review
...
* check metadata version
* use memmap
* use Result instead of unwrap
with Jay Somedon <jay.somedon@outlook.com>
2021-03-04 09:11:33 +08:00
Jay Somedon
6608acef71
Read version of rustc that compiled proc macro
...
With Jay Somedon <jay.somedon@outlook.com>
2021-03-04 09:05:23 +08:00
Jonas Schievink
70877428a8
Pass crate environment to proc macros
2020-12-27 15:29:47 +01:00
Jonas Schievink
798968e1e3
Move TokenExpander to base_db and rename it
...
It's only used to break the dependency to proc_macro_api
2020-12-27 15:29:47 +01:00
Jonas Schievink
2b2318e695
Remove dummy ProcMacroClient in favor of Option
2020-12-07 17:16:50 +01:00
Jonas Schievink
fb21a215be
Retain types of proc macros and allow attr. macros
2020-12-07 17:06:14 +01:00
Jonas Schievink
e8a19e24ea
Make ProcMacroProcessExpander
private
2020-12-07 14:11:17 +01:00
Jonas Schievink
e42e6f9ab9
ProcMacroProcessExpander: support attribute macros
2020-12-07 14:02:27 +01:00
Jonas Schievink
bee56e68a3
Hacky support for fn-like proc macros
2020-08-15 15:34:56 +02:00
Aleksey Kladov
2119dc23e8
Rename ra_proc_macro -> proc_macro_api
2020-08-13 12:39:27 +02:00