rust/crates
bors[bot] 0b2b9a5508
Merge #5766
5766: Hacky support for fn-like proc macros r=matklad a=jonas-schievink

It turns out that this is all that's needed to get something like this working:

```rust
#[proc_macro]
pub fn function_like_macro(_args: TokenStream) -> TokenStream {
    TokenStream::from_str("fn fn_success() {}").unwrap()
}
```

```rust
function_like_macro!();

fn f() {
    fn_success();
}
```

The drawback is that it also makes this work, because there is no distinction between different proc macro kinds in the rest of r-a:

```rust
#[derive(function_like_macro)]
struct S {}

fn f() {
    fn_success();
}
```

Another issue is that it seems to panic, and then panic, when using this on the rustc code base, due to some issue in the inscrutable proc macro bridge code.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2020-08-16 20:03:06 +00:00
..
arena Rename ra_arena 2020-08-12 16:22:05 +02:00
assists Don't expose hir::Path out of hir 2020-08-15 18:50:41 +02:00
base_db Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
cfg Rename ra_cfg -> cfg 2020-08-13 10:36:04 +02:00
expect Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
flycheck Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
hir Don't expose hir::Path out of hir 2020-08-15 18:50:41 +02:00
hir_def Remove deprecated Path::from_ast 2020-08-15 18:22:16 +02:00
hir_expand Rename ra_hir_expand -> hir_expand 2020-08-13 16:29:33 +02:00
hir_ty Chalk 0.23 2020-08-16 12:15:44 -04:00
ide Fix typo in comment 2020-08-15 16:37:44 -04:00
ide_db Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
mbe Rename ra_mbe -> mbe 2020-08-13 10:36:04 +02:00
parser Better recovery in use foo::; 2020-08-13 18:50:21 +02:00
paths Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
proc_macro_api Hacky support for fn-like proc macros 2020-08-15 15:34:56 +02:00
proc_macro_srv Add a proc_macro_test crate 2020-08-15 00:27:32 +02:00
proc_macro_test Add a proc_macro_test crate 2020-08-15 00:27:32 +02:00
profile Rename ra_prof -> profile 2020-08-12 16:35:29 +02:00
project_model Rename ra_db -> base_db 2020-08-13 16:29:33 +02:00
rust-analyzer Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
ssr Rename hypothetical -> speculative 2020-08-14 15:23:27 +02:00
stdx Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
syntax Bump rustc_lexer 2020-08-16 11:57:10 -04:00
test_utils Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
text_edit Rename ra_text_edit -> text_edit 2020-08-12 17:03:06 +02:00
toolchain Rename ra_toolchain -> toolchain 2020-08-12 16:52:28 +02:00
tt Rename ra_tt -> tt 2020-08-12 16:46:54 +02:00
vfs Sophisticate Windows path encoding 2020-08-14 02:03:54 +02:00
vfs-notify Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00