From 1836c1fbbdf0d6902da9a2d2473dbc72f371eb2e Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 26 Oct 2023 17:30:53 +0000 Subject: Stash and cancel cycle errors for auto trait leakage in opaques --- compiler/rustc_macros/src/query.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'compiler/rustc_macros/src') diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs index d8a695b131b..ad1980136f3 100644 --- a/compiler/rustc_macros/src/query.rs +++ b/compiler/rustc_macros/src/query.rs @@ -97,6 +97,9 @@ struct QueryModifiers { /// A cycle error results in a delay_bug call cycle_delay_bug: Option, + /// A cycle error results in a stashed cycle error that can be unstashed and canceled later + cycle_stash: Option, + /// Don't hash the result, instead just mark a query red if it runs no_hash: Option, @@ -127,6 +130,7 @@ fn parse_query_modifiers(input: ParseStream<'_>) -> Result { let mut desc = None; let mut fatal_cycle = None; let mut cycle_delay_bug = None; + let mut cycle_stash = None; let mut no_hash = None; let mut anon = None; let mut eval_always = None; @@ -181,6 +185,8 @@ fn parse_query_modifiers(input: ParseStream<'_>) -> Result { try_insert!(fatal_cycle = modifier); } else if modifier == "cycle_delay_bug" { try_insert!(cycle_delay_bug = modifier); + } else if modifier == "cycle_stash" { + try_insert!(cycle_stash = modifier); } else if modifier == "no_hash" { try_insert!(no_hash = modifier); } else if modifier == "anon" { @@ -208,6 +214,7 @@ fn parse_query_modifiers(input: ParseStream<'_>) -> Result { desc, fatal_cycle, cycle_delay_bug, + cycle_stash, no_hash, anon, eval_always, @@ -329,6 +336,7 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream { fatal_cycle, arena_cache, cycle_delay_bug, + cycle_stash, no_hash, anon, eval_always, -- cgit 1.4.1-3-g733a5