Skip to content

Commit

Permalink
Remove force_ex!.
Browse files Browse the repository at this point in the history
  • Loading branch information
nnethercote committed Oct 7, 2019
1 parent 1183d60 commit 9267d9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
18 changes: 5 additions & 13 deletions src/librustc/ty/query/plumbing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1191,18 +1191,6 @@ pub fn force_from_dep_node(tcx: TyCtxt<'_>, dep_node: &DepNode) -> bool {
return false
}

macro_rules! force_ex {
($tcx:expr, $query:ident, $key:expr) => {
{
$tcx.force_query::<crate::ty::query::queries::$query<'_>>(
$key,
DUMMY_SP,
*dep_node
);
}
}
};

rustc_dep_node_force!([dep_node, tcx]
// These are inputs that are expected to be pre-allocated and that
// should therefore always be red or green already.
Expand All @@ -1228,7 +1216,11 @@ pub fn force_from_dep_node(tcx: TyCtxt<'_>, dep_node: &DepNode) -> bool {
// Return from the whole function.
return false
};
force_ex!(tcx, analysis, def_id.krate);
tcx.force_query::<crate::ty::query::queries::analysis<'_>>(
def_id.krate,
DUMMY_SP,
*dep_node
);
}
);

Expand Down
6 changes: 5 additions & 1 deletion src/librustc_macros/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,11 @@ pub fn rustc_queries(input: TokenStream) -> TokenStream {
dep_node_force_stream.extend(quote! {
DepKind::#name => {
if let Some(key) = RecoverKey::recover($tcx, $dep_node) {
force_ex!($tcx, #name, key);
$tcx.force_query::<crate::ty::query::queries::#name<'_>>(
key,
DUMMY_SP,
*$dep_node
);
} else {
return false;
}
Expand Down

0 comments on commit 9267d9f

Please sign in to comment.