Aleksey Kladov
6a77ec7bbe
Rename ra_hir_ty -> hir_ty
2020-08-13 16:35:29 +02:00
Aleksey Kladov
a1c187eef3
Rename ra_syntax -> syntax
2020-08-12 18:30:53 +02:00
Laurențiu Nicola
f7e4b99d15
Replace remaining insta uses
2020-07-21 13:11:46 +03:00
Aleksey Kladov
bbc4dc9956
Update the rest of the tests
2020-06-29 17:23:01 +02:00
Aleksey Kladov
d016cb4867
Use only one code-path for parsing fixtures
...
This removes leading newlines everywhere, shifting all ranges in tests
by one
2020-06-24 00:48:38 +02:00
Florian Diebold
fe7bf993aa
Implement better handling of divergence
...
Divergence here means that for some reason, the end of a block will not be
reached. We tried to model this just using the never type, but that doesn't work
fully (e.g. in `let x = { loop {}; "foo" };` x should still have type `&str`);
so this introduces a `diverges` flag that the type checker keeps track of, like
rustc does.
2020-05-08 18:15:24 +02:00
Edwin Cheng
92665358cd
Rename ImplItem to AssocItem
2020-05-05 23:56:10 +08:00
bors[bot]
fb8fb65131
Merge #4234
...
4234: Support local_inner_macros r=jonas-schievink a=edwin0cheng
This PR implements `#[macro_export(local_inner_macros)]` support.
Note that the rustc implementation is quite [hacky][1] too. :)
[1]: 614f273e93/src/librustc_resolve/macros.rs (L456)
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-05-02 10:30:49 +00:00
Edwin Cheng
1635d22a35
Add test
2020-05-01 20:01:17 +08:00
Edwin Cheng
e4267967a8
Support local_inner_macros
2020-05-01 11:23:03 +08:00
Edwin Cheng
6d3b0af900
Use empty-deps tricks to detect it is core
2020-04-28 03:32:47 +08:00
Edwin Cheng
213d208e2d
Add test
2020-04-28 02:10:17 +08:00
Edwin Cheng
6a5014329a
Use core instead of std for builtin derive macros
2020-04-28 01:48:55 +08:00
Aleksey Kladov
8843588fca
Convert tests to text-size
2020-04-25 11:59:18 +02:00
Aleksey Kladov
5e2f29af85
Add failing test
2020-04-10 19:43:37 +02:00
Aleksey Kladov
da8eb29a2f
Macro patterns are not confused with expressions.
...
We treat macro calls as expressions (there's appropriate Into impl),
which causes problem if there's expresison and non-expression macro in
the same node (like in the match arm).
We fix this problem by nesting macor patterns into another node (the
same way we nest path into PathExpr or PathPat). Ideally, we probably
should add a similar nesting for macro expressions, but that needs
some careful thinking about macros in blocks: `{ am_i_expression!() }`.
2020-04-03 16:12:38 +02:00
Edwin Cheng
2adc9a8d5f
Remove collect proc_macro definitions
2020-03-25 20:14:22 +08:00
Edwin Cheng
5bd3aa05d6
Fix trailling whitespace
2020-03-25 19:50:12 +08:00
Edwin Cheng
34dc8d25c1
Add basic custom derive lowering
2020-03-25 19:50:12 +08:00
Florian Diebold
b973158aeb
Make MBE expansion more resilient (WIP)
2020-03-16 18:38:19 +01:00
Edwin Cheng
fe78a14bbb
Support local macro_rules
2020-03-14 14:25:51 +08:00
Edwin Cheng
5a292309c5
Add and fix tests
2020-03-11 01:06:01 +08:00
Edwin Cheng
18f88ad10b
Prevent include! macro include itself
2020-03-07 19:08:42 +08:00
Edwin Cheng
36c7684687
Use a not so dummy implementation of env macro
2020-03-07 12:53:40 +08:00
Edwin Cheng
0a06c7e6e6
Implment include macro
2020-03-06 22:58:45 +08:00
Edwin Cheng
e04c0f4222
Fix panic on eager expansion
2020-03-04 02:41:33 +08:00
Edwin Cheng
fe04c28b59
Add test
2020-03-04 01:21:14 +08:00
Aleksey Kladov
a1e1869554
Rename ast::ImplBlock -> ast::ImplDef
2020-02-29 21:33:15 +01:00
Edwin Cheng
6ebb1edf21
Use dummy value for line! and column! macro
2020-01-15 01:47:01 +08:00
Florian Diebold
dd6ec81d65
Add test for macro expansion in various expressions
2020-01-10 22:08:02 +01:00
Edwin Cheng
360de5ba71
Recursive collect macros in impl items
2019-12-21 05:02:31 +08:00
Edwin Cheng
ad81d1dbc1
Add support macros in impl blocks
2019-12-21 03:37:03 +08:00
Edwin Cheng
76ff5b7c15
Add tests
2019-12-06 23:48:45 +08:00
Florian Diebold
db8a00bd99
Implement derive(Copy, Clone) properly (well, kind of)
2019-12-05 19:29:57 +01:00
Florian Diebold
9747156f6c
Split up ty tests a bit
2019-12-03 18:00:29 +01:00