Skip to content

Commit

Permalink
Auto merge of rust-lang#103693 - HKalbasi:master, r=oli-obk
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Nov 24, 2022
2 parents 5dfb4b0 + 390a637 commit b3bc6bf
Show file tree
Hide file tree
Showing 31 changed files with 2,725 additions and 2,538 deletions.
18 changes: 16 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3202,6 +3202,20 @@ dependencies = [
"winapi",
]

[[package]]
name = "rustc_abi"
version = "0.0.0"
dependencies = [
"bitflags",
"rand 0.8.5",
"rand_xoshiro",
"rustc_data_structures",
"rustc_index",
"rustc_macros",
"rustc_serialize",
"tracing",
]

[[package]]
name = "rustc_apfloat"
version = "0.0.0"
Expand Down Expand Up @@ -4281,6 +4295,7 @@ name = "rustc_target"
version = "0.0.0"
dependencies = [
"bitflags",
"rustc_abi",
"rustc_data_structures",
"rustc_feature",
"rustc_index",
Expand Down Expand Up @@ -4336,6 +4351,7 @@ dependencies = [
"rustc_infer",
"rustc_middle",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
"smallvec",
"tracing",
Expand All @@ -4360,8 +4376,6 @@ dependencies = [
name = "rustc_ty_utils"
version = "0.0.0"
dependencies = [
"rand 0.8.5",
"rand_xoshiro",
"rustc_data_structures",
"rustc_errors",
"rustc_hir",
Expand Down
24 changes: 24 additions & 0 deletions compiler/rustc_abi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "rustc_abi"
version = "0.0.0"
edition = "2021"

[dependencies]
bitflags = "1.2.1"
tracing = "0.1"
rand = { version = "0.8.4", default-features = false, optional = true }
rand_xoshiro = { version = "0.6.0", optional = true }
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
rustc_index = { path = "../rustc_index", default-features = false }
rustc_macros = { path = "../rustc_macros", optional = true }
rustc_serialize = { path = "../rustc_serialize", optional = true }

[features]
default = ["nightly", "randomize"]
randomize = ["rand", "rand_xoshiro"]
nightly = [
"rustc_data_structures",
"rustc_index/nightly",
"rustc_macros",
"rustc_serialize",
]
Loading

0 comments on commit b3bc6bf

Please sign in to comment.