Skip to content

Commit 25f7146

Browse files
committed
Auto merge of rust-lang#16311 - Veykril:rustc-deps, r=Veykril
internal: Remove `rustc_dependencies ` crate The crate serves no purpose really
2 parents f5f7dda + f972da7 commit 25f7146

File tree

20 files changed

+68
-125
lines changed

20 files changed

+68
-125
lines changed

Cargo.lock

+6-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ toolchain = { path = "./crates/toolchain", version = "0.0.0" }
7878
tt = { path = "./crates/tt", version = "0.0.0" }
7979
vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
8080
vfs = { path = "./crates/vfs", version = "0.0.0" }
81-
rustc-dependencies = { path = "./crates/rustc-dependencies", version = "0.0.0" }
81+
82+
ra-ap-rustc_lexer = { version = "0.21.0", default-features = false }
83+
ra-ap-rustc_parse_format = { version = "0.21.0", default-features = false }
84+
ra-ap-rustc_index = { version = "0.21.0", default-features = false }
85+
ra-ap-rustc_abi = { version = "0.21.0", default-features = false }
8286

8387
# local crates that aren't published to crates.io. These should not have versions.
8488
sourcegen = { path = "./crates/sourcegen" }

crates/hir-def/Cargo.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ smallvec.workspace = true
2929
hashbrown.workspace = true
3030
triomphe.workspace = true
3131

32-
rustc-dependencies.workspace = true
32+
ra-ap-rustc_parse_format.workspace = true
33+
ra-ap-rustc_abi.workspace = true
3334

3435
# local deps
3536
stdx.workspace = true
@@ -53,7 +54,7 @@ test-utils.workspace = true
5354
test-fixture.workspace = true
5455

5556
[features]
56-
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
57+
in-rust-tree = []
5758

5859
[lints]
59-
workspace = true
60+
workspace = true

crates/hir-def/src/data/adt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use hir_expand::{
1111
};
1212
use intern::Interned;
1313
use la_arena::{Arena, ArenaMap};
14-
use rustc_dependencies::abi::{Align, Integer, IntegerType, ReprFlags, ReprOptions};
14+
use rustc_abi::{Align, Integer, IntegerType, ReprFlags, ReprOptions};
1515
use syntax::ast::{self, HasName, HasVisibility};
1616
use triomphe::Arc;
1717

crates/hir-def/src/hir/format_args.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use std::mem;
33

44
use hir_expand::name::Name;
5-
use rustc_dependencies::parse_format as parse;
5+
use rustc_parse_format as parse;
66
use stdx::TupleExt;
77
use syntax::{
88
ast::{self, IsString},

crates/hir-def/src/lib.rs

+12-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@
1010
#![warn(rust_2018_idioms, unused_lifetimes)]
1111
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
1212

13-
#[allow(unused)]
14-
macro_rules! eprintln {
15-
($($tt:tt)*) => { stdx::eprintln!($($tt)*) };
16-
}
13+
#[cfg(feature = "in-rust-tree")]
14+
extern crate rustc_parse_format;
15+
16+
#[cfg(not(feature = "in-rust-tree"))]
17+
extern crate ra_ap_rustc_parse_format as rustc_parse_format;
18+
19+
#[cfg(feature = "in-rust-tree")]
20+
extern crate rustc_abi;
21+
22+
#[cfg(not(feature = "in-rust-tree"))]
23+
extern crate ra_ap_rustc_abi as rustc_abi;
1724

1825
pub mod db;
1926

@@ -49,7 +56,7 @@ pub mod visibility;
4956
pub mod find_path;
5057
pub mod import_map;
5158

52-
pub use rustc_dependencies::abi as layout;
59+
pub use rustc_abi as layout;
5360
use triomphe::Arc;
5461

5562
#[cfg(test)]

crates/hir-ty/Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ nohash-hasher.workspace = true
3434
typed-arena = "2.0.1"
3535
indexmap.workspace = true
3636

37-
rustc-dependencies.workspace = true
37+
ra-ap-rustc_abi.workspace = true
38+
ra-ap-rustc_index.workspace = true
39+
3840

3941
# local deps
4042
stdx.workspace = true
@@ -58,7 +60,7 @@ test-utils.workspace = true
5860
test-fixture.workspace = true
5961

6062
[features]
61-
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
63+
in-rust-tree = []
6264

6365
[lints]
6466
workspace = true

crates/hir-ty/src/layout.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ use hir_def::{
1212
LocalEnumVariantId, LocalFieldId, StructId,
1313
};
1414
use la_arena::{Idx, RawIdx};
15-
use rustc_dependencies::{
16-
abi::AddressSpace,
17-
index::{IndexSlice, IndexVec},
18-
};
15+
use rustc_abi::AddressSpace;
16+
use rustc_index::{IndexSlice, IndexVec};
17+
1918
use stdx::never;
2019
use triomphe::Arc;
2120

@@ -35,7 +34,7 @@ mod target;
3534
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
3635
pub struct RustcEnumVariantIdx(pub LocalEnumVariantId);
3736

38-
impl rustc_dependencies::index::Idx for RustcEnumVariantIdx {
37+
impl rustc_index::Idx for RustcEnumVariantIdx {
3938
fn new(idx: usize) -> Self {
4039
RustcEnumVariantIdx(Idx::from_raw(RawIdx::from(idx as u32)))
4140
}
@@ -54,7 +53,7 @@ impl RustcFieldIdx {
5453
}
5554
}
5655

57-
impl rustc_dependencies::index::Idx for RustcFieldIdx {
56+
impl rustc_index::Idx for RustcFieldIdx {
5857
fn new(idx: usize) -> Self {
5958
RustcFieldIdx(Idx::from_raw(RawIdx::from(idx as u32)))
6059
}

crates/hir-ty/src/layout/adt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use hir_def::{
99
AdtId, EnumVariantId, LocalEnumVariantId, VariantId,
1010
};
1111
use la_arena::RawIdx;
12-
use rustc_dependencies::index::IndexVec;
12+
use rustc_index::IndexVec;
1313
use smallvec::SmallVec;
1414
use triomphe::Arc;
1515

crates/hir-ty/src/lib.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@
33
#![warn(rust_2018_idioms, unused_lifetimes)]
44
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
55

6-
#[allow(unused)]
7-
macro_rules! eprintln {
8-
($($tt:tt)*) => { stdx::eprintln!($($tt)*) };
9-
}
6+
#[cfg(feature = "in-rust-tree")]
7+
extern crate rustc_index;
8+
9+
#[cfg(not(feature = "in-rust-tree"))]
10+
extern crate ra_ap_rustc_index as rustc_index;
11+
12+
#[cfg(feature = "in-rust-tree")]
13+
extern crate rustc_abi;
14+
15+
#[cfg(not(feature = "in-rust-tree"))]
16+
extern crate ra_ap_rustc_abi as rustc_abi;
1017

1118
mod builder;
1219
mod chalk_db;

crates/parser/Cargo.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ doctest = false
1313

1414
[dependencies]
1515
drop_bomb = "0.1.5"
16-
rustc-dependencies.workspace = true
17-
16+
ra-ap-rustc_lexer.workspace = true
1817
limit.workspace = true
1918

2019
[dev-dependencies]
@@ -24,7 +23,7 @@ stdx.workspace = true
2423
sourcegen.workspace = true
2524

2625
[features]
27-
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
26+
in-rust-tree = []
2827

2928
[lints]
30-
workspace = true
29+
workspace = true

crates/parser/src/lexed_str.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
//! Note that these tokens, unlike the tokens we feed into the parser, do
99
//! include info about comments and whitespace.
1010
11-
use rustc_dependencies::lexer as rustc_lexer;
12-
1311
use std::ops;
1412

1513
use rustc_lexer::unescape::{EscapeError, Mode};

crates/parser/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
#![allow(rustdoc::private_intra_doc_links)]
2222
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
2323

24+
#[cfg(not(feature = "in-rust-tree"))]
25+
extern crate ra_ap_rustc_lexer as rustc_lexer;
26+
#[cfg(feature = "in-rust-tree")]
27+
extern crate rustc_lexer;
28+
2429
mod lexed_str;
2530
mod token_set;
2631
mod syntax_kind;

crates/rust-analyzer/Cargo.toml

+1-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ flycheck.workspace = true
4949
hir-def.workspace = true
5050
hir-ty.workspace = true
5151
hir.workspace = true
52-
rustc-dependencies.workspace = true
5352
ide-db.workspace = true
5453
# This should only be used in CLI
5554
ide-ssr.workspace = true
@@ -89,11 +88,10 @@ in-rust-tree = [
8988
"ide/in-rust-tree",
9089
"syntax/in-rust-tree",
9190
"parser/in-rust-tree",
92-
"rustc-dependencies/in-rust-tree",
9391
"hir/in-rust-tree",
9492
"hir-def/in-rust-tree",
9593
"hir-ty/in-rust-tree",
9694
]
9795

9896
[lints]
99-
workspace = true
97+
workspace = true

crates/rustc-dependencies/Cargo.toml

-23
This file was deleted.

crates/rustc-dependencies/src/lib.rs

-48
This file was deleted.

crates/syntax/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ indexmap.workspace = true
2323
smol_str.workspace = true
2424
triomphe.workspace = true
2525

26-
rustc-dependencies.workspace = true
26+
ra-ap-rustc_lexer.workspace = true
2727

2828
parser.workspace = true
2929
profile.workspace = true
@@ -41,7 +41,7 @@ test-utils.workspace = true
4141
sourcegen.workspace = true
4242

4343
[features]
44-
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
44+
in-rust-tree = []
4545

4646
[lints]
47-
workspace = true
47+
workspace = true

crates/syntax/src/ast/token_ext.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
33
use std::borrow::Cow;
44

5-
use rustc_dependencies::lexer as rustc_lexer;
6-
75
use rustc_lexer::unescape::{
86
unescape_byte, unescape_c_string, unescape_char, unescape_literal, CStrUnit, Mode,
97
};

0 commit comments

Comments
 (0)