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", "mbe",
"once_cell", "once_cell",
"profile", "profile",
"ra-ap-rustc_abi",
"ra-ap-rustc_parse_format", "ra-ap-rustc_parse_format",
"rustc-dependencies",
"rustc-hash", "rustc-hash",
"smallvec", "smallvec",
"span", "span",
@ -580,7 +580,8 @@ dependencies = [
"oorandom", "oorandom",
"profile", "profile",
"project-model", "project-model",
"rustc-dependencies", "ra-ap-rustc_abi",
"ra-ap-rustc_index",
"rustc-hash", "rustc-hash",
"scoped-tls", "scoped-tls",
"smallvec", "smallvec",
@ -1541,7 +1542,6 @@ dependencies = [
"profile", "profile",
"project-model", "project-model",
"rayon", "rayon",
"rustc-dependencies",
"rustc-hash", "rustc-hash",
"scip", "scip",
"serde", "serde",
@ -1600,14 +1600,6 @@ version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
[[package]]
name = "rustc-dependencies"
version = "0.0.0"
dependencies = [
"ra-ap-rustc_abi",
"ra-ap-rustc_index",
]
[[package]] [[package]]
name = "rustc-hash" name = "rustc-hash"
version = "1.1.0" 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" } tt = { path = "./crates/tt", version = "0.0.0" }
vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" } vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
vfs = { path = "./crates/vfs", 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_lexer = { version = "0.21.0", default-features = false }
ra-ap-rustc_parse_format = { 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. # local crates that aren't published to crates.io. These should not have versions.
sourcegen = { path = "./crates/sourcegen" } sourcegen = { path = "./crates/sourcegen" }

View File

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

View File

@ -11,7 +11,7 @@ use hir_expand::{
}; };
use intern::Interned; use intern::Interned;
use la_arena::{Arena, ArenaMap}; 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 syntax::ast::{self, HasName, HasVisibility};
use triomphe::Arc; use triomphe::Arc;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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::*;
}