Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f972da7

Browse files
committed
Remove rustc_dependencies crate
1 parent e25e0dd commit f972da7

File tree

12 files changed

+37
-79
lines changed

12 files changed

+37
-79
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +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" }
8281

8382
ra-ap-rustc_lexer = { version = "0.21.0", default-features = false }
8483
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 }
8586

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

crates/hir-def/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ hashbrown.workspace = true
3030
triomphe.workspace = true
3131

3232
ra-ap-rustc_parse_format.workspace = true
33-
rustc-dependencies.workspace = true
33+
ra-ap-rustc_abi.workspace = true
3434

3535
# local deps
3636
stdx.workspace = true
@@ -54,7 +54,7 @@ test-utils.workspace = true
5454
test-fixture.workspace = true
5555

5656
[features]
57-
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
57+
in-rust-tree = []
5858

5959
[lints]
6060
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/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ extern crate rustc_parse_format;
1616
#[cfg(not(feature = "in-rust-tree"))]
1717
extern crate ra_ap_rustc_parse_format as rustc_parse_format;
1818

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;
24+
1925
pub mod db;
2026

2127
pub mod attr;
@@ -50,7 +56,7 @@ pub mod visibility;
5056
pub mod find_path;
5157
pub mod import_map;
5258

53-
pub use rustc_dependencies::abi as layout;
59+
pub use rustc_abi as layout;
5460
use triomphe::Arc;
5561

5662
#[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;

crates/rust-analyzer/Cargo.toml

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

Lines changed: 0 additions & 21 deletions
This file was deleted.

crates/rustc-dependencies/src/lib.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)