Remove rustc_dependencies crate

This commit is contained in:
Lukas Wirth 2024-01-08 15:39:35 +01:00
parent e25e0dd0ad
commit f972da70d4
12 changed files with 37 additions and 79 deletions

14
Cargo.lock generated
View file

@ -513,8 +513,8 @@ dependencies = [
"mbe",
"once_cell",
"profile",
"ra-ap-rustc_abi",
"ra-ap-rustc_parse_format",
"rustc-dependencies",
"rustc-hash",
"smallvec",
"span",
@ -580,7 +580,8 @@ dependencies = [
"oorandom",
"profile",
"project-model",
"rustc-dependencies",
"ra-ap-rustc_abi",
"ra-ap-rustc_index",
"rustc-hash",
"scoped-tls",
"smallvec",
@ -1541,7 +1542,6 @@ dependencies = [
"profile",
"project-model",
"rayon",
"rustc-dependencies",
"rustc-hash",
"scip",
"serde",
@ -1600,14 +1600,6 @@ version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
[[package]]
name = "rustc-dependencies"
version = "0.0.0"
dependencies = [
"ra-ap-rustc_abi",
"ra-ap-rustc_index",
]
[[package]]
name = "rustc-hash"
version = "1.1.0"

View file

@ -78,10 +78,11 @@ toolchain = { path = "./crates/toolchain", version = "0.0.0" }
tt = { path = "./crates/tt", version = "0.0.0" }
vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
vfs = { path = "./crates/vfs", version = "0.0.0" }
rustc-dependencies = { path = "./crates/rustc-dependencies", version = "0.0.0" }
ra-ap-rustc_lexer = { version = "0.21.0", default-features = false }
ra-ap-rustc_parse_format = { version = "0.21.0", default-features = false }
ra-ap-rustc_index = { version = "0.21.0", default-features = false }
ra-ap-rustc_abi = { version = "0.21.0", default-features = false }
# local crates that aren't published to crates.io. These should not have versions.
sourcegen = { path = "./crates/sourcegen" }

View file

@ -30,7 +30,7 @@ hashbrown.workspace = true
triomphe.workspace = true
ra-ap-rustc_parse_format.workspace = true
rustc-dependencies.workspace = true
ra-ap-rustc_abi.workspace = true
# local deps
stdx.workspace = true
@ -54,7 +54,7 @@ test-utils.workspace = true
test-fixture.workspace = true
[features]
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
in-rust-tree = []
[lints]
workspace = true

View file

@ -11,7 +11,7 @@ use hir_expand::{
};
use intern::Interned;
use la_arena::{Arena, ArenaMap};
use rustc_dependencies::abi::{Align, Integer, IntegerType, ReprFlags, ReprOptions};
use rustc_abi::{Align, Integer, IntegerType, ReprFlags, ReprOptions};
use syntax::ast::{self, HasName, HasVisibility};
use triomphe::Arc;

View file

@ -16,6 +16,12 @@ extern crate rustc_parse_format;
#[cfg(not(feature = "in-rust-tree"))]
extern crate ra_ap_rustc_parse_format as rustc_parse_format;
#[cfg(feature = "in-rust-tree")]
extern crate rustc_abi;
#[cfg(not(feature = "in-rust-tree"))]
extern crate ra_ap_rustc_abi as rustc_abi;
pub mod db;
pub mod attr;
@ -50,7 +56,7 @@ pub mod visibility;
pub mod find_path;
pub mod import_map;
pub use rustc_dependencies::abi as layout;
pub use rustc_abi as layout;
use triomphe::Arc;
#[cfg(test)]

View file

@ -34,7 +34,9 @@ nohash-hasher.workspace = true
typed-arena = "2.0.1"
indexmap.workspace = true
rustc-dependencies.workspace = true
ra-ap-rustc_abi.workspace = true
ra-ap-rustc_index.workspace = true
# local deps
stdx.workspace = true
@ -58,7 +60,7 @@ test-utils.workspace = true
test-fixture.workspace = true
[features]
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
in-rust-tree = []
[lints]
workspace = true

View file

@ -12,10 +12,9 @@ use hir_def::{
LocalEnumVariantId, LocalFieldId, StructId,
};
use la_arena::{Idx, RawIdx};
use rustc_dependencies::{
abi::AddressSpace,
index::{IndexSlice, IndexVec},
};
use rustc_abi::AddressSpace;
use rustc_index::{IndexSlice, IndexVec};
use stdx::never;
use triomphe::Arc;
@ -35,7 +34,7 @@ mod target;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct RustcEnumVariantIdx(pub LocalEnumVariantId);
impl rustc_dependencies::index::Idx for RustcEnumVariantIdx {
impl rustc_index::Idx for RustcEnumVariantIdx {
fn new(idx: usize) -> Self {
RustcEnumVariantIdx(Idx::from_raw(RawIdx::from(idx as u32)))
}
@ -54,7 +53,7 @@ impl RustcFieldIdx {
}
}
impl rustc_dependencies::index::Idx for RustcFieldIdx {
impl rustc_index::Idx for RustcFieldIdx {
fn new(idx: usize) -> Self {
RustcFieldIdx(Idx::from_raw(RawIdx::from(idx as u32)))
}

View file

@ -9,7 +9,7 @@ use hir_def::{
AdtId, EnumVariantId, LocalEnumVariantId, VariantId,
};
use la_arena::RawIdx;
use rustc_dependencies::index::IndexVec;
use rustc_index::IndexVec;
use smallvec::SmallVec;
use triomphe::Arc;

View file

@ -3,10 +3,17 @@
#![warn(rust_2018_idioms, unused_lifetimes)]
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[allow(unused)]
macro_rules! eprintln {
($($tt:tt)*) => { stdx::eprintln!($($tt)*) };
}
#[cfg(feature = "in-rust-tree")]
extern crate rustc_index;
#[cfg(not(feature = "in-rust-tree"))]
extern crate ra_ap_rustc_index as rustc_index;
#[cfg(feature = "in-rust-tree")]
extern crate rustc_abi;
#[cfg(not(feature = "in-rust-tree"))]
extern crate ra_ap_rustc_abi as rustc_abi;
mod builder;
mod chalk_db;

View file

@ -49,7 +49,6 @@ flycheck.workspace = true
hir-def.workspace = true
hir-ty.workspace = true
hir.workspace = true
rustc-dependencies.workspace = true
ide-db.workspace = true
# This should only be used in CLI
ide-ssr.workspace = true
@ -89,11 +88,10 @@ in-rust-tree = [
"ide/in-rust-tree",
"syntax/in-rust-tree",
"parser/in-rust-tree",
"rustc-dependencies/in-rust-tree",
"hir/in-rust-tree",
"hir-def/in-rust-tree",
"hir-ty/in-rust-tree",
]
[lints]
workspace = true
workspace = true

View file

@ -1,21 +0,0 @@
[package]
name = "rustc-dependencies"
version = "0.0.0"
description = "TBD"
rust-version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ra-ap-rustc_index = { version = "0.21.0", default-features = false }
ra-ap-rustc_abi = { version = "0.21.0", default-features = false }
[features]
in-rust-tree = []
[lints]
workspace = true

View file

@ -1,26 +0,0 @@
//! A wrapper around rustc internal crates, which enables switching between compiler provided
//! ones and stable ones published in crates.io
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[cfg(feature = "in-rust-tree")]
extern crate rustc_abi;
pub mod abi {
#[cfg(not(feature = "in-rust-tree"))]
pub use ::ra_ap_rustc_abi::*;
#[cfg(feature = "in-rust-tree")]
pub use ::rustc_abi::*;
}
#[cfg(feature = "in-rust-tree")]
extern crate rustc_index;
pub mod index {
#[cfg(not(feature = "in-rust-tree"))]
pub use ::ra_ap_rustc_index::*;
#[cfg(feature = "in-rust-tree")]
pub use ::rustc_index::*;
}