Make MBE expansion more resilient (WIP)

This commit is contained in:
Florian Diebold 2020-03-13 13:03:31 +01:00 committed by Florian Diebold
parent d3773ec152
commit b973158aeb
10 changed files with 167 additions and 90 deletions

View file

@ -1430,7 +1430,8 @@ impl MacroFixture {
let (invocation_tt, _) =
ast_to_token_tree(&macro_invocation.token_tree().unwrap()).unwrap();
self.rules.expand(&invocation_tt)
let (tt, err) = self.rules.expand(&invocation_tt);
err.map(Err).unwrap_or(Ok(tt))
}
fn assert_expand_err(&self, invocation: &str, err: &ExpandError) {