1
Fork 0

Never regard macro rules with compile_error! invocations as unused

The very point of compile_error! is to never be reached, and one of
the use cases of the macro, currently also listed as examples in the
documentation of compile_error, is to create nicer errors for wrong
macro invocations. Thus, we shuuld never warn about unused macro arms
that contain invocations of compile_error.
This commit is contained in:
est31 2022-06-09 04:46:51 +02:00
parent fee3a459dd
commit eb3c611e1d
6 changed files with 92 additions and 6 deletions

View file

@ -870,7 +870,7 @@ impl<'a> Resolver<'a> {
&mut self,
item: &ast::Item,
edition: Edition,
) -> (SyntaxExtension, Vec<Span>) {
) -> (SyntaxExtension, Vec<(usize, Span)>) {
let (mut result, mut rule_spans) = compile_declarative_macro(
&self.session,
self.session.features_untracked(),