about summary refs log tree commit diff
path: root/crates/parser
diff options
context:
space:
mode:
authorhkalbasi <hamidrezakalbasi@protonmail.com>2023-09-15 18:10:11 +0330
committerhkalbasi <hamidrezakalbasi@protonmail.com>2023-09-15 18:10:11 +0330
commitf4704bc8ae92d150b2801e391692d9503f0c6126 (patch)
treea357fef0a66536f086612b87aaf38b6f0b9e4749 /crates/parser
parent12e28c35758051dd6bc9cdf419a50dff80fab64d (diff)
downloadrust-f4704bc8ae92d150b2801e391692d9503f0c6126.tar.gz
rust-f4704bc8ae92d150b2801e391692d9503f0c6126.zip
Switch to in-tree rustc dependencies with a cfg flag
Diffstat (limited to 'crates/parser')
-rw-r--r--crates/parser/Cargo.toml5
-rw-r--r--crates/parser/src/lexed_str.rs1
-rw-r--r--crates/parser/src/lib.rs1
3 files changed, 6 insertions, 1 deletions
diff --git a/crates/parser/Cargo.toml b/crates/parser/Cargo.toml
index 09e62c35278..efb326323f9 100644
--- a/crates/parser/Cargo.toml
+++ b/crates/parser/Cargo.toml
@@ -13,7 +13,7 @@ doctest = false
 
 [dependencies]
 drop_bomb = "0.1.5"
-rustc_lexer.workspace = true
+rustc-dependencies.workspace = true
 
 limit.workspace = true
 
@@ -22,3 +22,6 @@ expect-test = "1.4.0"
 
 stdx.workspace = true
 sourcegen.workspace = true
+
+[features]
+in-rust-tree = ["rustc-dependencies/in-rust-tree"]
diff --git a/crates/parser/src/lexed_str.rs b/crates/parser/src/lexed_str.rs
index 36c52953a02..30c1c4f8c75 100644
--- a/crates/parser/src/lexed_str.rs
+++ b/crates/parser/src/lexed_str.rs
@@ -8,6 +8,7 @@
 //! Note that these tokens, unlike the tokens we feed into the parser, do
 //! include info about comments and whitespace.
 
+use rustc_dependencies::lexer as rustc_lexer;
 use std::ops;
 
 use crate::{
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs
index c155e8aaf67..fcfd1a50719 100644
--- a/crates/parser/src/lib.rs
+++ b/crates/parser/src/lib.rs
@@ -19,6 +19,7 @@
 
 #![warn(rust_2018_idioms, unused_lifetimes, semicolon_in_expressions_from_macros)]
 #![allow(rustdoc::private_intra_doc_links)]
+#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
 
 mod lexed_str;
 mod token_set;