Skip to content

Commit 6624dc4

Browse files
committed
Make librustc_query_system compile.
1 parent a7e2641 commit 6624dc4

File tree

12 files changed

+358
-604
lines changed

12 files changed

+358
-604
lines changed

Cargo.lock

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3116,6 +3116,7 @@ dependencies = [
31163116
"rustc_hir",
31173117
"rustc_index",
31183118
"rustc_macros",
3119+
"rustc_query_system",
31193120
"rustc_session",
31203121
"rustc_span",
31213122
"rustc_target",
@@ -4021,6 +4022,22 @@ dependencies = [
40214022
"rustc_typeck",
40224023
]
40234024

4025+
[[package]]
4026+
name = "rustc_query_system"
4027+
version = "0.0.0"
4028+
dependencies = [
4029+
"log",
4030+
"parking_lot 0.9.0",
4031+
"rustc_ast",
4032+
"rustc_data_structures",
4033+
"rustc_errors",
4034+
"rustc_hir",
4035+
"rustc_index",
4036+
"rustc_macros",
4037+
"serialize",
4038+
"smallvec 1.0.0",
4039+
]
4040+
40244041
[[package]]
40254042
name = "rustc_resolve"
40264043
version = "0.0.0"

src/librustc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ rustc_hir = { path = "../librustc_hir" }
2525
rustc_target = { path = "../librustc_target" }
2626
rustc_macros = { path = "../librustc_macros" }
2727
rustc_data_structures = { path = "../librustc_data_structures" }
28+
rustc_query_system = { path = "../librustc_query_system" }
2829
rustc_errors = { path = "../librustc_errors" }
2930
rustc_index = { path = "../librustc_index" }
3031
rustc_serialize = { path = "../libserialize", package = "serialize" }

src/librustc_query_system/Cargo.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
authors = ["The Rust Project Developers"]
3+
name = "rustc_query_system"
4+
version = "0.0.0"
5+
edition = "2018"
6+
7+
[lib]
8+
name = "rustc_query_system"
9+
path = "lib.rs"
10+
doctest = false
11+
12+
[dependencies]
13+
log = { version = "0.4", features = ["release_max_level_info", "std"] }
14+
rustc_ast = { path = "../librustc_ast" }
15+
rustc_data_structures = { path = "../librustc_data_structures" }
16+
rustc_errors = { path = "../librustc_errors" }
17+
rustc_hir = { path = "../librustc_hir" }
18+
rustc_index = { path = "../librustc_index" }
19+
rustc_macros = { path = "../librustc_macros" }
20+
rustc_serialize = { path = "../libserialize", package = "serialize" }
21+
parking_lot = "0.9"
22+
smallvec = { version = "1.0", features = ["union", "may_dangle"] }

src/librustc_query_system/dep_graph/debug.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Code for debugging the dep-graph.
22
3-
use super::dep_node::DepNode;
3+
use super::{DepKind, DepNode};
44
use std::error::Error;
55

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

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

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

0 commit comments

Comments
 (0)