diff options
| author | hkalbasi <hamidrezakalbasi@protonmail.com> | 2023-09-15 18:10:11 +0330 |
|---|---|---|
| committer | hkalbasi <hamidrezakalbasi@protonmail.com> | 2023-09-15 18:10:11 +0330 |
| commit | f4704bc8ae92d150b2801e391692d9503f0c6126 (patch) | |
| tree | a357fef0a66536f086612b87aaf38b6f0b9e4749 /crates/syntax | |
| parent | 12e28c35758051dd6bc9cdf419a50dff80fab64d (diff) | |
| download | rust-f4704bc8ae92d150b2801e391692d9503f0c6126.tar.gz rust-f4704bc8ae92d150b2801e391692d9503f0c6126.zip | |
Switch to in-tree rustc dependencies with a cfg flag
Diffstat (limited to 'crates/syntax')
| -rw-r--r-- | crates/syntax/Cargo.toml | 4 | ||||
| -rw-r--r-- | crates/syntax/src/ast/token_ext.rs | 2 | ||||
| -rw-r--r-- | crates/syntax/src/lib.rs | 1 | ||||
| -rw-r--r-- | crates/syntax/src/validation.rs | 2 |
4 files changed, 6 insertions, 3 deletions
diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index 5ee0c479284..dc92366d1c7 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml @@ -23,7 +23,7 @@ indexmap = "2.0.0" smol_str.workspace = true triomphe.workspace = true -rustc_lexer.workspace = true +rustc-dependencies.workspace = true parser.workspace = true profile.workspace = true @@ -41,4 +41,4 @@ test-utils.workspace = true sourcegen.workspace = true [features] -in-rust-tree = [] +in-rust-tree = ["rustc-dependencies/in-rust-tree"] diff --git a/crates/syntax/src/ast/token_ext.rs b/crates/syntax/src/ast/token_ext.rs index 87fd51d703c..8cc271d226c 100644 --- a/crates/syntax/src/ast/token_ext.rs +++ b/crates/syntax/src/ast/token_ext.rs @@ -2,6 +2,8 @@ use std::borrow::Cow; +use rustc_dependencies::lexer as rustc_lexer; + use rustc_lexer::unescape::{ unescape_byte, unescape_c_string, unescape_char, unescape_literal, CStrUnit, Mode, }; diff --git a/crates/syntax/src/lib.rs b/crates/syntax/src/lib.rs index 27c8a13e58d..2cd82e3762e 100644 --- a/crates/syntax/src/lib.rs +++ b/crates/syntax/src/lib.rs @@ -19,6 +19,7 @@ //! [RFC]: <https://github.com/rust-lang/rfcs/pull/2256> //! [Swift]: <https://github.com/apple/swift/blob/13d593df6f359d0cb2fc81cfaac273297c539455/lib/Syntax/README.md> +#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] #![warn(rust_2018_idioms, unused_lifetimes, semicolon_in_expressions_from_macros)] #[allow(unused)] diff --git a/crates/syntax/src/validation.rs b/crates/syntax/src/validation.rs index e0ec6a242ff..2b1bbac08e5 100644 --- a/crates/syntax/src/validation.rs +++ b/crates/syntax/src/validation.rs @@ -5,7 +5,7 @@ mod block; use rowan::Direction; -use rustc_lexer::unescape::{self, unescape_literal, Mode}; +use rustc_dependencies::lexer::unescape::{self, unescape_literal, Mode}; use crate::{ algo, |
