Skip to content

Conversation

@edwin0cheng
Copy link
Contributor

@edwin0cheng edwin0cheng commented Apr 18, 2020

This PRs does the following things:

  1. Fixed thread '<unnamed>' panicked at 'called Option::unwrap() on a None value', crates/ra_mbe/src/subtree_source.rs:155:16 #4001 by splitting LIFETIME lexer token to two mbe tokens. It is because rustc token stream expects LIFETIME as a combination of punct and ident, but RA tt:TokenTree treats it as a single Ident previously.
  2. Fixed thread '<unnamed>' panicked at 'MacroDef without ast_id', crates/ra_hir/src/has_source.rs:109:22 #4003, by skipping proc-macro for completion. It is because currently we don't have AstNode for proc-macro. We would need to redesign how to implement HasSource for proc-macro.
  3. Fixed a bug how empty TokenStream merging in proc-macro-srv such that no L_DOLLAR and R_DOLLAR will be emitted accidentally.

@edwin0cheng
Copy link
Contributor Author

I found that serde defined a try! macro in the expanded code such that it is syntax error (#2241) in RA currently.

@matklad
Copy link
Contributor

matklad commented Apr 18, 2020

bors r+

Would be good to add a test for lifetime splitting though!

@bors
Copy link
Contributor

bors bot commented Apr 18, 2020

@bors bors bot merged commit 98819d8 into rust-lang:master Apr 18, 2020
@edwin0cheng edwin0cheng deleted the fix-proc-macro-bugs branch April 18, 2020 18:29
@edwin0cheng
Copy link
Contributor Author

lifetime splitting test added in #4032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants