Skip to content

Commit b3bc6bf

Browse files
committed
Auto merge of #103693 - HKalbasi:master, r=oli-obk
Make rustc_target usable outside of rustc I'm working on showing type size in rust-analyzer (rust-lang/rust-analyzer#13490) and I currently copied rustc code inside rust-analyzer, which works, but is bad. With this change, I would become able to use `rustc_target` and `rustc_index` directly in r-a, reducing the amount of copy needed. This PR contains some feature flag to put nightly features behind them to make crates buildable on the stable compiler + makes layout related types generic over index type + removes interning of nested layouts.
2 parents 5dfb4b0 + 390a637 commit b3bc6bf

File tree

31 files changed

+2725
-2538
lines changed

31 files changed

+2725
-2538
lines changed

Cargo.lock

+16-2
Original file line numberDiff line numberDiff line change
@@ -3202,6 +3202,20 @@ dependencies = [
32023202
"winapi",
32033203
]
32043204

3205+
[[package]]
3206+
name = "rustc_abi"
3207+
version = "0.0.0"
3208+
dependencies = [
3209+
"bitflags",
3210+
"rand 0.8.5",
3211+
"rand_xoshiro",
3212+
"rustc_data_structures",
3213+
"rustc_index",
3214+
"rustc_macros",
3215+
"rustc_serialize",
3216+
"tracing",
3217+
]
3218+
32053219
[[package]]
32063220
name = "rustc_apfloat"
32073221
version = "0.0.0"
@@ -4281,6 +4295,7 @@ name = "rustc_target"
42814295
version = "0.0.0"
42824296
dependencies = [
42834297
"bitflags",
4298+
"rustc_abi",
42844299
"rustc_data_structures",
42854300
"rustc_feature",
42864301
"rustc_index",
@@ -4336,6 +4351,7 @@ dependencies = [
43364351
"rustc_infer",
43374352
"rustc_middle",
43384353
"rustc_span",
4354+
"rustc_target",
43394355
"rustc_trait_selection",
43404356
"smallvec",
43414357
"tracing",
@@ -4360,8 +4376,6 @@ dependencies = [
43604376
name = "rustc_ty_utils"
43614377
version = "0.0.0"
43624378
dependencies = [
4363-
"rand 0.8.5",
4364-
"rand_xoshiro",
43654379
"rustc_data_structures",
43664380
"rustc_errors",
43674381
"rustc_hir",

compiler/rustc_abi/Cargo.toml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[package]
2+
name = "rustc_abi"
3+
version = "0.0.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
bitflags = "1.2.1"
8+
tracing = "0.1"
9+
rand = { version = "0.8.4", default-features = false, optional = true }
10+
rand_xoshiro = { version = "0.6.0", optional = true }
11+
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
12+
rustc_index = { path = "../rustc_index", default-features = false }
13+
rustc_macros = { path = "../rustc_macros", optional = true }
14+
rustc_serialize = { path = "../rustc_serialize", optional = true }
15+
16+
[features]
17+
default = ["nightly", "randomize"]
18+
randomize = ["rand", "rand_xoshiro"]
19+
nightly = [
20+
"rustc_data_structures",
21+
"rustc_index/nightly",
22+
"rustc_macros",
23+
"rustc_serialize",
24+
]

0 commit comments

Comments
 (0)