diff options
| author | bors <bors@rust-lang.org> | 2024-06-06 22:27:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-06 22:27:56 +0000 |
| commit | 76e7a0849c07d73e4d9afde8036ee8c450127cc8 (patch) | |
| tree | b57d69295365665c1531de08087f86d49c622ca9 /compiler | |
| parent | 98489f2487465f3765e5dd28d7305ebfd40f0865 (diff) | |
| parent | efd8959ab1bf30c098917af144db72ad08175bc6 (diff) | |
| download | rust-76e7a0849c07d73e4d9afde8036ee8c450127cc8.tar.gz rust-76e7a0849c07d73e4d9afde8036ee8c450127cc8.zip | |
Auto merge of #126104 - workingjubilee:rollup-t1ac2ld, r=workingjubilee
Rollup of 12 pull requests Successful merges: - #125220 (Repair several `riscv64gc-unknown-linux-gnu` codegen tests) - #126033 (CI: fix publishing of toolstate history) - #126034 (Clarify our tier 1 Windows Server support) - #126035 (Some minor query system cleanups) - #126051 (Clarify an `x fmt` error.) - #126059 (Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiB) - #126064 (Migrate `run-make/manual-crate-name` to `rmake.rs`) - #126072 (compiletest: Allow multiple `//@ run-flags:` headers) - #126073 (Port `tests/run-make-fulldeps/obtain-borrowck` to ui-fulldeps) - #126081 (Do not use relative paths to Rust source root in run-make tests) - #126086 (use windows compatible executable name for libcxx-version) - #126096 ([RFC-2011] Allow `core_intrinsics` when activated) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/assert/context.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_macros/src/query.rs | 21 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/graph.rs | 3 |
3 files changed, 20 insertions, 5 deletions
diff --git a/compiler/rustc_builtin_macros/src/assert/context.rs b/compiler/rustc_builtin_macros/src/assert/context.rs index 78144226114..a98cb6f0f76 100644 --- a/compiler/rustc_builtin_macros/src/assert/context.rs +++ b/compiler/rustc_builtin_macros/src/assert/context.rs @@ -57,7 +57,6 @@ impl<'cx, 'a> Context<'cx, 'a> { /// Builds the whole `assert!` expression. For example, `let elem = 1; assert!(elem == 1);` expands to: /// /// ```rust - /// #![feature(generic_assert_internals)] /// let elem = 1; /// { /// #[allow(unused_imports)] diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs index 25675e06e38..ceff1da9763 100644 --- a/compiler/rustc_macros/src/query.rs +++ b/compiler/rustc_macros/src/query.rs @@ -314,6 +314,17 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream { let mut query_description_stream = quote! {}; let mut query_cached_stream = quote! {}; let mut feedable_queries = quote! {}; + let mut errors = quote! {}; + + macro_rules! assert { + ( $cond:expr, $span:expr, $( $tt:tt )+ ) => { + if !$cond { + errors.extend( + Error::new($span, format!($($tt)+)).into_compile_error(), + ); + } + } + } for query in queries.0 { let Query { name, arg, modifiers, .. } = &query; @@ -369,10 +380,15 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream { [#attribute_stream] fn #name(#arg) #result, }); - if modifiers.feedable.is_some() { - assert!(modifiers.anon.is_none(), "Query {name} cannot be both `feedable` and `anon`."); + if let Some(feedable) = &modifiers.feedable { + assert!( + modifiers.anon.is_none(), + feedable.span(), + "Query {name} cannot be both `feedable` and `anon`." + ); assert!( modifiers.eval_always.is_none(), + feedable.span(), "Query {name} cannot be both `feedable` and `eval_always`." ); feedable_queries.extend(quote! { @@ -407,5 +423,6 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream { use super::*; #query_cached_stream } + #errors }) } diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index 76227a78c3d..66fb3136805 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -64,7 +64,6 @@ pub struct MarkFrame<'a> { parent: Option<&'a MarkFrame<'a>>, } -#[derive(PartialEq)] enum DepNodeColor { Red, Green(DepNodeIndex), @@ -925,7 +924,7 @@ impl<D: Deps> DepGraph<D> { /// Returns true if the given node has been marked as red during the /// current compilation session. Used in various assertions pub fn is_red(&self, dep_node: &DepNode) -> bool { - self.node_color(dep_node) == Some(DepNodeColor::Red) + matches!(self.node_color(dep_node), Some(DepNodeColor::Red)) } /// Returns true if the given node has been marked as green during the |
