Auto merge of #16311 - Veykril:rustc-deps, r=Veykril

internal: Remove `rustc_dependencies ` crate

The crate serves no purpose really
This commit is contained in:
bors 2024-01-09 09:37:48 +00:00
commit 25f71469f1
20 changed files with 68 additions and 125 deletions

21
Cargo.lock generated
View file

@ -513,7 +513,8 @@ dependencies = [
"mbe", "mbe",
"once_cell", "once_cell",
"profile", "profile",
"rustc-dependencies", "ra-ap-rustc_abi",
"ra-ap-rustc_parse_format",
"rustc-hash", "rustc-hash",
"smallvec", "smallvec",
"span", "span",
@ -579,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",
@ -1196,7 +1198,7 @@ dependencies = [
"drop_bomb", "drop_bomb",
"expect-test", "expect-test",
"limit", "limit",
"rustc-dependencies", "ra-ap-rustc_lexer",
"sourcegen", "sourcegen",
"stdx", "stdx",
] ]
@ -1540,7 +1542,6 @@ dependencies = [
"profile", "profile",
"project-model", "project-model",
"rayon", "rayon",
"rustc-dependencies",
"rustc-hash", "rustc-hash",
"scip", "scip",
"serde", "serde",
@ -1599,16 +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",
"ra-ap-rustc_lexer",
"ra-ap-rustc_parse_format",
]
[[package]] [[package]]
name = "rustc-hash" name = "rustc-hash"
version = "1.1.0" version = "1.1.0"
@ -1808,9 +1799,9 @@ dependencies = [
"proc-macro2", "proc-macro2",
"profile", "profile",
"quote", "quote",
"ra-ap-rustc_lexer",
"rayon", "rayon",
"rowan", "rowan",
"rustc-dependencies",
"rustc-hash", "rustc-hash",
"smol_str", "smol_str",
"sourcegen", "sourcegen",

View file

@ -78,7 +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_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

@ -29,7 +29,8 @@ smallvec.workspace = true
hashbrown.workspace = true hashbrown.workspace = true
triomphe.workspace = true triomphe.workspace = true
rustc-dependencies.workspace = true ra-ap-rustc_parse_format.workspace = true
ra-ap-rustc_abi.workspace = true
# local deps # local deps
stdx.workspace = true stdx.workspace = true
@ -53,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

@ -2,7 +2,7 @@
use std::mem; use std::mem;
use hir_expand::name::Name; use hir_expand::name::Name;
use rustc_dependencies::parse_format as parse; use rustc_parse_format as parse;
use stdx::TupleExt; use stdx::TupleExt;
use syntax::{ use syntax::{
ast::{self, IsString}, ast::{self, IsString},

View file

@ -10,10 +10,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_parse_format;
($($tt:tt)*) => { stdx::eprintln!($($tt)*) };
} #[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 db;
@ -49,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

@ -13,8 +13,7 @@ doctest = false
[dependencies] [dependencies]
drop_bomb = "0.1.5" drop_bomb = "0.1.5"
rustc-dependencies.workspace = true ra-ap-rustc_lexer.workspace = true
limit.workspace = true limit.workspace = true
[dev-dependencies] [dev-dependencies]
@ -24,7 +23,7 @@ stdx.workspace = true
sourcegen.workspace = true sourcegen.workspace = true
[features] [features]
in-rust-tree = ["rustc-dependencies/in-rust-tree"] in-rust-tree = []
[lints] [lints]
workspace = true workspace = true

View file

@ -8,8 +8,6 @@
//! Note that these tokens, unlike the tokens we feed into the parser, do //! Note that these tokens, unlike the tokens we feed into the parser, do
//! include info about comments and whitespace. //! include info about comments and whitespace.
use rustc_dependencies::lexer as rustc_lexer;
use std::ops; use std::ops;
use rustc_lexer::unescape::{EscapeError, Mode}; use rustc_lexer::unescape::{EscapeError, Mode};

View file

@ -21,6 +21,11 @@
#![allow(rustdoc::private_intra_doc_links)] #![allow(rustdoc::private_intra_doc_links)]
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#[cfg(not(feature = "in-rust-tree"))]
extern crate ra_ap_rustc_lexer as rustc_lexer;
#[cfg(feature = "in-rust-tree")]
extern crate rustc_lexer;
mod lexed_str; mod lexed_str;
mod token_set; mod token_set;
mod syntax_kind; mod syntax_kind;

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,23 +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_lexer = { version = "0.21.0" }
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 }
[features]
in-rust-tree = []
[lints]
workspace = true

View file

@ -1,48 +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_lexer;
pub mod lexer {
#[cfg(not(feature = "in-rust-tree"))]
pub use ::ra_ap_rustc_lexer::*;
#[cfg(feature = "in-rust-tree")]
pub use ::rustc_lexer::*;
}
#[cfg(feature = "in-rust-tree")]
extern crate rustc_parse_format;
pub mod parse_format {
#[cfg(not(feature = "in-rust-tree"))]
pub use ::ra_ap_rustc_parse_format::*;
#[cfg(feature = "in-rust-tree")]
pub use ::rustc_parse_format::*;
}
#[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::*;
}

View file

@ -23,7 +23,7 @@ indexmap.workspace = true
smol_str.workspace = true smol_str.workspace = true
triomphe.workspace = true triomphe.workspace = true
rustc-dependencies.workspace = true ra-ap-rustc_lexer.workspace = true
parser.workspace = true parser.workspace = true
profile.workspace = true profile.workspace = true
@ -41,7 +41,7 @@ test-utils.workspace = true
sourcegen.workspace = true sourcegen.workspace = true
[features] [features]
in-rust-tree = ["rustc-dependencies/in-rust-tree"] in-rust-tree = []
[lints] [lints]
workspace = true workspace = true

View file

@ -2,8 +2,6 @@
use std::borrow::Cow; use std::borrow::Cow;
use rustc_dependencies::lexer as rustc_lexer;
use rustc_lexer::unescape::{ use rustc_lexer::unescape::{
unescape_byte, unescape_c_string, unescape_char, unescape_literal, CStrUnit, Mode, unescape_byte, unescape_c_string, unescape_char, unescape_literal, CStrUnit, Mode,
}; };

View file

@ -22,6 +22,11 @@
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))] #![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
#![warn(rust_2018_idioms, unused_lifetimes)] #![warn(rust_2018_idioms, unused_lifetimes)]
#[cfg(not(feature = "in-rust-tree"))]
extern crate ra_ap_rustc_lexer as rustc_lexer;
#[cfg(feature = "in-rust-tree")]
extern crate rustc_lexer;
#[allow(unused)] #[allow(unused)]
macro_rules! eprintln { macro_rules! eprintln {
($($tt:tt)*) => { stdx::eprintln!($($tt)*) }; ($($tt:tt)*) => { stdx::eprintln!($($tt)*) };

View file

@ -5,7 +5,7 @@
mod block; mod block;
use rowan::Direction; use rowan::Direction;
use rustc_dependencies::lexer::unescape::{self, unescape_literal, Mode}; use rustc_lexer::unescape::{self, unescape_literal, Mode};
use crate::{ use crate::{
algo, algo,