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

Commit 22b18b9

Browse files
committed
Auto merge of rust-lang#15616 - HKalbasi:rustc-deps, r=HKalbasi
Switch to in-tree rustc dependencies with a cfg flag We can use this flag to detect and prevent breakages in rustc CI. (see rust-lang#14846 and rust-lang#15569) ~The `IN_RUSTC_REPOSITORY` is just a placeholder. Is there any existing cfg flag that rustc CI sets?~
2 parents cdaadb6 + f4704bc commit 22b18b9

File tree

18 files changed

+118
-31
lines changed

18 files changed

+118
-31
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ toolchain = { path = "./crates/toolchain", version = "0.0.0" }
7979
tt = { path = "./crates/tt", version = "0.0.0" }
8080
vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
8181
vfs = { path = "./crates/vfs", version = "0.0.0" }
82+
rustc-dependencies = { path = "./crates/rustc-dependencies", version = "0.0.0" }
8283

8384
# local crates that aren't published to crates.io. These should not have versions.
8485
proc-macro-test = { path = "./crates/proc-macro-test" }
@@ -90,9 +91,9 @@ lsp-server = { version = "0.7.4" }
9091

9192
# non-local crates
9293
smallvec = { version = "1.10.0", features = [
93-
"const_new",
94-
"union",
95-
"const_generics",
94+
"const_new",
95+
"union",
96+
"const_generics",
9697
] }
9798
smol_str = "0.2.0"
9899
nohash-hasher = "0.2.0"
@@ -101,11 +102,6 @@ serde = { version = "1.0.156", features = ["derive"] }
101102
serde_json = "1.0.96"
102103
triomphe = { version = "0.1.8", default-features = false, features = ["std"] }
103104
# can't upgrade due to dashmap depending on 0.12.3 currently
104-
hashbrown = { version = "0.12.3", features = ["inline-more"], default-features = false }
105-
106-
rustc_lexer = { version = "0.10.0", package = "ra-ap-rustc_lexer" }
107-
rustc_parse_format = { version = "0.10.0", package = "ra-ap-rustc_parse_format", default-features = false }
108-
109-
# Upstream broke this for us so we can't update it
110-
rustc_abi = { version = "0.0.20221221", package = "hkalbasi-rustc-ap-rustc_abi", default-features = false }
111-
rustc_index = { version = "0.0.20221221", package = "hkalbasi-rustc-ap-rustc_index", default-features = false }
105+
hashbrown = { version = "0.12.3", features = [
106+
"inline-more",
107+
], default-features = false }

crates/hir-def/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ smallvec.workspace = true
3131
hashbrown.workspace = true
3232
triomphe.workspace = true
3333

34-
rustc_abi.workspace = true
35-
rustc_index.workspace = true
36-
rustc_parse_format.workspace = true
37-
34+
rustc-dependencies.workspace = true
3835

3936
# local deps
4037
stdx.workspace = true
@@ -53,3 +50,6 @@ expect-test = "1.4.0"
5350

5451
# local deps
5552
test-utils.workspace = true
53+
54+
[features]
55+
in-rust-tree = ["rustc-dependencies/in-rust-tree"]

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_abi::{Align, Integer, IntegerType, ReprFlags, ReprOptions};
14+
use rustc_dependencies::abi::{Align, Integer, IntegerType, ReprFlags, ReprOptions};
1515
use syntax::ast::{self, HasName, HasVisibility};
1616
use triomphe::Arc;
1717

crates/hir-def/src/hir/format_args.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use std::mem;
33

44
use hir_expand::name::Name;
5-
use rustc_parse_format as parse;
5+
use rustc_dependencies::parse_format as parse;
66
use syntax::{
77
ast::{self, IsString},
88
AstToken, SmolStr, TextRange,

crates/hir-def/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//! actually true.
99
1010
#![warn(rust_2018_idioms, unused_lifetimes, semicolon_in_expressions_from_macros)]
11+
#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]
1112

1213
#[allow(unused)]
1314
macro_rules! eprintln {
@@ -48,7 +49,7 @@ pub mod visibility;
4849
pub mod find_path;
4950
pub mod import_map;
5051

51-
pub use rustc_abi as layout;
52+
pub use rustc_dependencies::abi as layout;
5253
use triomphe::Arc;
5354

5455
#[cfg(test)]

crates/hir-ty/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ triomphe.workspace = true
3333
nohash-hasher.workspace = true
3434
typed-arena = "2.0.1"
3535

36-
rustc_index.workspace = true
36+
rustc-dependencies.workspace = true
3737

3838
# local deps
3939
stdx.workspace = true
@@ -56,3 +56,6 @@ project-model = { path = "../project-model" }
5656

5757
# local deps
5858
test-utils.workspace = true
59+
60+
[features]
61+
in-rust-tree = ["rustc-dependencies/in-rust-tree"]

crates/hir-ty/src/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mod target;
3434
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
3535
pub struct RustcEnumVariantIdx(pub LocalEnumVariantId);
3636

37-
impl rustc_index::vec::Idx for RustcEnumVariantIdx {
37+
impl rustc_dependencies::index::vec::Idx for RustcEnumVariantIdx {
3838
fn new(idx: usize) -> Self {
3939
RustcEnumVariantIdx(Idx::from_raw(RawIdx::from(idx as u32)))
4040
}

crates/parser/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ doctest = false
1313

1414
[dependencies]
1515
drop_bomb = "0.1.5"
16-
rustc_lexer.workspace = true
16+
rustc-dependencies.workspace = true
1717

1818
limit.workspace = true
1919

@@ -22,3 +22,6 @@ expect-test = "1.4.0"
2222

2323
stdx.workspace = true
2424
sourcegen.workspace = true
25+
26+
[features]
27+
in-rust-tree = ["rustc-dependencies/in-rust-tree"]

crates/parser/src/lexed_str.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//! Note that these tokens, unlike the tokens we feed into the parser, do
99
//! include info about comments and whitespace.
1010
11+
use rustc_dependencies::lexer as rustc_lexer;
1112
use std::ops;
1213

1314
use crate::{

0 commit comments

Comments
 (0)