4139: Add check for rules that no repetition which could match an empty token r=matklad a=edwin0cheng
Fix#4103
for `/ui/issues/issue-57597.rs`
This is `ParseError` of the macro rules , because it is how rustc handle it :
a58b1ed44f/src/librustc_expand/mbe/macro_rules.rs (L558)
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4134: Special case for empty comments in doc comment kind r=matklad a=edwin0cheng
Part of #4103
Fix `ui/empty/empty-comment.rs macros`
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3513: Completion in macros r=matklad a=flodiebold
I experimented a bit with completion in macros. It's kind of working, but there are a lot of rough edges.
- I'm trying to expand the macro call with the inserted fake token. This requires some hacky additions on the HIR level to be able to do "hypothetical" expansions. There should probably be a nicer API for this, if we want to do it this way. I'm not sure whether it's worth it, because we still can't do a lot if the original macro call didn't expand in nearly the same way. E.g. if we have something like `println!("", x<|>)` the expansions will look the same and everything is fine; but in that case we could maybe have achieved the same result in a simpler way. If we have something like `m!(<|>)` where `m!()` doesn't even expand or expands to something very different, we don't really know what to do anyway.
- Relatedly, there are a lot of cases where this doesn't work because either the original call or the hypothetical call doesn't expand. E.g. if we have `m!(x.<|>)` the original token tree doesn't parse as an expression; if we have `m!(match x { <|> })` the hypothetical token tree doesn't parse. It would be nice if we could have better error recovery in these cases.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>