diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-02 14:39:36 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-07 09:35:47 +1100 |
| commit | 1183d60cd5427a8369fb406d8bbac7fcc7a21fc1 (patch) | |
| tree | c2d9292e949fd64cea8fb77eeee0af67b686650b | |
| parent | 8f707c3a98367c43455797e781793baef4a3579b (diff) | |
| download | rust-1183d60cd5427a8369fb406d8bbac7fcc7a21fc1.tar.gz rust-1183d60cd5427a8369fb406d8bbac7fcc7a21fc1.zip | |
Remove `def_id!`.
| -rw-r--r-- | src/librustc/ty/query/plumbing.rs | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs index e0ebb071ed2..2590f96f855 100644 --- a/src/librustc/ty/query/plumbing.rs +++ b/src/librustc/ty/query/plumbing.rs @@ -1191,17 +1191,6 @@ pub fn force_from_dep_node(tcx: TyCtxt<'_>, dep_node: &DepNode) -> bool { return false } - macro_rules! def_id { - () => { - if let Some(def_id) = dep_node.extract_def_id(tcx) { - def_id - } else { - // Return from the whole function. - return false - } - } - }; - macro_rules! force_ex { ($tcx:expr, $query:ident, $key:expr) => { { @@ -1232,7 +1221,15 @@ pub fn force_from_dep_node(tcx: TyCtxt<'_>, dep_node: &DepNode) -> bool { bug!("force_from_dep_node: encountered {:?}", dep_node) } - DepKind::Analysis => { force_ex!(tcx, analysis, def_id!().krate); } + DepKind::Analysis => { + let def_id = if let Some(def_id) = dep_node.extract_def_id(tcx) { + def_id + } else { + // Return from the whole function. + return false + }; + force_ex!(tcx, analysis, def_id.krate); + } ); true |
