summaryrefslogtreecommitdiffstats
path: root/src/tools/rust-analyzer/crates/cfg
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/rust-analyzer/crates/cfg')
-rw-r--r--src/tools/rust-analyzer/crates/cfg/Cargo.toml21
-rw-r--r--src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs4
2 files changed, 15 insertions, 10 deletions
diff --git a/src/tools/rust-analyzer/crates/cfg/Cargo.toml b/src/tools/rust-analyzer/crates/cfg/Cargo.toml
index 2857420c2..0880bc239 100644
--- a/src/tools/rust-analyzer/crates/cfg/Cargo.toml
+++ b/src/tools/rust-analyzer/crates/cfg/Cargo.toml
@@ -2,9 +2,11 @@
name = "cfg"
version = "0.0.0"
description = "TBD"
-license = "MIT OR Apache-2.0"
-edition = "2021"
-rust-version = "1.65"
+
+authors.workspace = true
+edition.workspace = true
+license.workspace = true
+rust-version.workspace = true
[lib]
doctest = false
@@ -12,15 +14,18 @@ doctest = false
[dependencies]
rustc-hash = "1.1.0"
-tt = { path = "../tt", version = "0.0.0" }
+# locals deps
+tt.workspace = true
[dev-dependencies]
-mbe = { path = "../mbe" }
-syntax = { path = "../syntax" }
expect-test = "1.4.0"
oorandom = "11.1.3"
# We depend on both individually instead of using `features = ["derive"]` to microoptimize the
# build graph: if the feature was enabled, syn would be built early on in the graph if `smolstr`
# supports `arbitrary`. This way, we avoid feature unification.
-arbitrary = "1.1.7"
-derive_arbitrary = "1.1.6"
+arbitrary = "1.2.2"
+derive_arbitrary = "1.2.2"
+
+# local deps
+mbe.workspace = true
+syntax.workspace = true
diff --git a/src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs b/src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs
index 5f4eefa83..fb7505ba2 100644
--- a/src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs
+++ b/src/tools/rust-analyzer/crates/cfg/src/cfg_expr.rs
@@ -66,7 +66,7 @@ impl From<CfgAtom> for CfgExpr {
}
impl CfgExpr {
- pub fn parse(tt: &tt::Subtree) -> CfgExpr {
+ pub fn parse<S>(tt: &tt::Subtree<S>) -> CfgExpr {
next_cfg_expr(&mut tt.token_trees.iter()).unwrap_or(CfgExpr::Invalid)
}
/// Fold the cfg by querying all basic `Atom` and `KeyValue` predicates.
@@ -85,7 +85,7 @@ impl CfgExpr {
}
}
-fn next_cfg_expr(it: &mut SliceIter<'_, tt::TokenTree>) -> Option<CfgExpr> {
+fn next_cfg_expr<S>(it: &mut SliceIter<'_, tt::TokenTree<S>>) -> Option<CfgExpr> {
let name = match it.next() {
None => return None,
Some(tt::TokenTree::Leaf(tt::Leaf::Ident(ident))) => ident.text.clone(),