about summary refs log tree commit diff
path: root/compiler/rustc_macros/src/query.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-10-29 13:04:38 +0000
committerCamille GILLOT <gillot.camille@gmail.com>2022-11-29 18:42:23 +0000
commit9f2c6b0b09c1f93f922f6fcd46649c3e2110f42b (patch)
tree6a8625ddd4cb0647e5ddb3501dfa7540fc06a98e /compiler/rustc_macros/src/query.rs
parentee7a9a8641b79329ed4c221a2ae0e1e0c3d3d75d (diff)
downloadrust-9f2c6b0b09c1f93f922f6fcd46649c3e2110f42b.tar.gz
rust-9f2c6b0b09c1f93f922f6fcd46649c3e2110f42b.zip
Sanity check computed value for feeable queries.
Diffstat (limited to 'compiler/rustc_macros/src/query.rs')
-rw-r--r--compiler/rustc_macros/src/query.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs
index 30c42757dbe..4047969724a 100644
--- a/compiler/rustc_macros/src/query.rs
+++ b/compiler/rustc_macros/src/query.rs
@@ -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,