Skip to content

Commit 25f7146

Browse files
committed
Auto merge of #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

Lines changed: 6 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 1 deletion
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

Lines changed: 4 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 12 additions & 5 deletions
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

Lines changed: 4 additions & 2 deletions
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

Lines changed: 5 additions & 6 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 11 additions & 4 deletions
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;

0 commit comments

Comments
 (0)