Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add proc macro ABI for rustc 1.58 #10769

Merged
merged 1 commit into from
Nov 16, 2021

Conversation

alexjg
Copy link
Contributor

@alexjg alexjg commented Nov 15, 2021

This fixes #10766.

I do have some concerns here. The proc macro server API has added three methods to TokenStream which I don't really know how to implement in RustcServer. Namely expand_expr, before, and after. You'll see that these are currently unimplemented! in crates/proc_macro_server/src/abis/abi_1_58/rustc_server.rs. I don't have the expertise to fill in the blanks here, it may be necessary to pull in someone who knows a bit more about the proc macro crate.

I think this will only be a problem when actually attempting to expand a macro, so this is probably strictly better than not including the updated ABI at all.

@alexjg
Copy link
Contributor Author

alexjg commented Nov 16, 2021

Thanks @Veykril

@lnicola
Copy link
Member

lnicola commented Nov 16, 2021

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 16, 2021

@bors bors bot merged commit 35ed853 into rust-lang:master Nov 16, 2021
@lnicola lnicola changed the title Add proc macro ABI for rustc 1.58 feat: Add proc macro ABI for rustc 1.58 Nov 17, 2021
@jonas-schievink
Copy link
Contributor

...however, expand_expr was added in 1.58.0, not 1.57.0, so we don't use the correct ABI there, leading to #10570. I'm working on a fix.

bors bot added a commit that referenced this pull request Mar 23, 2022
11797: fix: fix "unwrap on a `None` value" in proc macros built with Rust 1.57.0 r=jonas-schievink a=jonas-schievink

Closes #10570

cc #10769 (comment)

bors r+

Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failed to write request: Broken pipe (os error 32)rust-analyzermacro-error
4 participants