Sanity check computed value for feeable queries.

This commit is contained in:
Camille GILLOT 2022-10-29 13:04:38 +00:00
parent ee7a9a8641
commit 9f2c6b0b09
4 changed files with 42 additions and 3 deletions

View file

@ -359,6 +359,15 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
});
if modifiers.feedable.is_some() {
assert!(modifiers.anon.is_none(), "Query {name} cannot be both `feedable` and `anon`.");
assert!(
modifiers.eval_always.is_none(),
"Query {name} cannot be both `feedable` and `eval_always`."
);
assert!(
modifiers.no_hash.is_none(),
"Query {name} cannot be both `feedable` and `no_hash`."
);
feedable_queries.extend(quote! {
#(#doc_comments)*
[#attribute_stream] fn #name(#arg) #result,