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

View file

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

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

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

View file

@ -10,10 +10,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_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;
@ -49,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

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

View file

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

View file

@ -21,6 +21,11 @@
#![allow(rustdoc::private_intra_doc_links)]
#![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 token_set;
mod syntax_kind;

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,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
triomphe.workspace = true
rustc-dependencies.workspace = true
ra-ap-rustc_lexer.workspace = true
parser.workspace = true
profile.workspace = true
@ -41,7 +41,7 @@ test-utils.workspace = true
sourcegen.workspace = true
[features]
in-rust-tree = ["rustc-dependencies/in-rust-tree"]
in-rust-tree = []
[lints]
workspace = true
workspace = true

View file

@ -2,8 +2,6 @@
use std::borrow::Cow;
use rustc_dependencies::lexer as rustc_lexer;
use rustc_lexer::unescape::{
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))]
#![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)]
macro_rules! eprintln {
($($tt:tt)*) => { stdx::eprintln!($($tt)*) };

View file

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