Skip to content

Commit

Permalink
Make librustc_query_system compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Mar 23, 2020
1 parent a7e2641 commit 6624dc4
Show file tree
Hide file tree
Showing 12 changed files with 358 additions and 604 deletions.
17 changes: 17 additions & 0 deletions Cargo.lock
Expand Up @@ -3116,6 +3116,7 @@ dependencies = [
"rustc_hir",
"rustc_index",
"rustc_macros",
"rustc_query_system",
"rustc_session",
"rustc_span",
"rustc_target",
Expand Down Expand Up @@ -4021,6 +4022,22 @@ dependencies = [
"rustc_typeck",
]

[[package]]
name = "rustc_query_system"
version = "0.0.0"
dependencies = [
"log",
"parking_lot 0.9.0",
"rustc_ast",
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
"rustc_index",
"rustc_macros",
"serialize",
"smallvec 1.0.0",
]

[[package]]
name = "rustc_resolve"
version = "0.0.0"
Expand Down
1 change: 1 addition & 0 deletions src/librustc/Cargo.toml
Expand Up @@ -25,6 +25,7 @@ rustc_hir = { path = "../librustc_hir" }
rustc_target = { path = "../librustc_target" }
rustc_macros = { path = "../librustc_macros" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_query_system = { path = "../librustc_query_system" }
rustc_errors = { path = "../librustc_errors" }
rustc_index = { path = "../librustc_index" }
rustc_serialize = { path = "../libserialize", package = "serialize" }
Expand Down
22 changes: 22 additions & 0 deletions src/librustc_query_system/Cargo.toml
@@ -0,0 +1,22 @@
[package]
authors = ["The Rust Project Developers"]
name = "rustc_query_system"
version = "0.0.0"
edition = "2018"

[lib]
name = "rustc_query_system"
path = "lib.rs"
doctest = false

[dependencies]
log = { version = "0.4", features = ["release_max_level_info", "std"] }
rustc_ast = { path = "../librustc_ast" }
rustc_data_structures = { path = "../librustc_data_structures" }
rustc_errors = { path = "../librustc_errors" }
rustc_hir = { path = "../librustc_hir" }
rustc_index = { path = "../librustc_index" }
rustc_macros = { path = "../librustc_macros" }
rustc_serialize = { path = "../libserialize", package = "serialize" }
parking_lot = "0.9"
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
6 changes: 3 additions & 3 deletions src/librustc_query_system/dep_graph/debug.rs
@@ -1,6 +1,6 @@
//! Code for debugging the dep-graph.

use super::dep_node::DepNode;
use super::{DepKind, DepNode};
use std::error::Error;

/// A dep-node filter goes from a user-defined string to a query over
Expand All @@ -26,7 +26,7 @@ impl DepNodeFilter {
}

/// Tests whether `node` meets the filter, returning true if so.
pub fn test(&self, node: &DepNode) -> bool {
pub fn test<K: DepKind>(&self, node: &DepNode<K>) -> bool {
let debug_str = format!("{:?}", node);
self.text.split('&').map(|s| s.trim()).all(|f| debug_str.contains(f))
}
Expand All @@ -52,7 +52,7 @@ impl EdgeFilter {
}
}

pub fn test(&self, source: &DepNode, target: &DepNode) -> bool {
pub fn test<K: DepKind>(&self, source: &DepNode<K>, target: &DepNode<K>) -> bool {
self.source.test(source) && self.target.test(target)
}
}

0 comments on commit 6624dc4

Please sign in to comment.