Skip to content

Commit acf5795

Browse files
committed
rename stable_mir to rustc_public, and rustc_smir to rustc_public_shim
1 parent ad635e5 commit acf5795

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+277
-267
lines changed

Cargo.lock

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3271,8 +3271,8 @@ dependencies = [
32713271
"rustc_codegen_ssa",
32723272
"rustc_driver",
32733273
"rustc_driver_impl",
3274-
"rustc_smir",
3275-
"stable_mir",
3274+
"rustc_public",
3275+
"rustc_public_bridge",
32763276
"tikv-jemalloc-sys",
32773277
]
32783278

@@ -3709,6 +3709,7 @@ dependencies = [
37093709
"rustc_passes",
37103710
"rustc_pattern_analysis",
37113711
"rustc_privacy",
3712+
"rustc_public",
37123713
"rustc_query_system",
37133714
"rustc_resolve",
37143715
"rustc_session",
@@ -3718,7 +3719,6 @@ dependencies = [
37183719
"rustc_ty_utils",
37193720
"serde_json",
37203721
"shlex",
3721-
"stable_mir",
37223722
"tracing",
37233723
"windows 0.61.3",
37243724
]
@@ -4415,6 +4415,36 @@ dependencies = [
44154415
"rustc-literal-escaper",
44164416
]
44174417

4418+
[[package]]
4419+
name = "rustc_public"
4420+
version = "0.1.0-preview"
4421+
dependencies = [
4422+
"rustc_abi",
4423+
"rustc_hir",
4424+
"rustc_middle",
4425+
"rustc_public_bridge",
4426+
"rustc_session",
4427+
"rustc_span",
4428+
"rustc_target",
4429+
"scoped-tls",
4430+
"serde",
4431+
"tracing",
4432+
]
4433+
4434+
[[package]]
4435+
name = "rustc_public_bridge"
4436+
version = "0.0.0"
4437+
dependencies = [
4438+
"rustc_abi",
4439+
"rustc_data_structures",
4440+
"rustc_hir",
4441+
"rustc_hir_pretty",
4442+
"rustc_middle",
4443+
"rustc_session",
4444+
"rustc_span",
4445+
"rustc_target",
4446+
]
4447+
44184448
[[package]]
44194449
name = "rustc_query_impl"
44204450
version = "0.0.0"
@@ -4542,20 +4572,6 @@ dependencies = [
45424572
"windows 0.61.3",
45434573
]
45444574

4545-
[[package]]
4546-
name = "rustc_smir"
4547-
version = "0.0.0"
4548-
dependencies = [
4549-
"rustc_abi",
4550-
"rustc_data_structures",
4551-
"rustc_hir",
4552-
"rustc_hir_pretty",
4553-
"rustc_middle",
4554-
"rustc_session",
4555-
"rustc_span",
4556-
"rustc_target",
4557-
]
4558-
45594575
[[package]]
45604576
name = "rustc_span"
45614577
version = "0.0.0"
@@ -5103,22 +5119,6 @@ version = "1.2.0"
51035119
source = "registry+https://github.com/rust-lang/crates.io-index"
51045120
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
51055121

5106-
[[package]]
5107-
name = "stable_mir"
5108-
version = "0.1.0-preview"
5109-
dependencies = [
5110-
"rustc_abi",
5111-
"rustc_hir",
5112-
"rustc_middle",
5113-
"rustc_session",
5114-
"rustc_smir",
5115-
"rustc_span",
5116-
"rustc_target",
5117-
"scoped-tls",
5118-
"serde",
5119-
"tracing",
5120-
]
5121-
51225122
[[package]]
51235123
name = "stacker"
51245124
version = "0.1.21"

compiler/rustc/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
1313
rustc_driver = { path = "../rustc_driver" }
1414
rustc_driver_impl = { path = "../rustc_driver_impl" }
1515

16-
# Make sure rustc_smir ends up in the sysroot, because this
17-
# crate is intended to be used by stable MIR consumers, which are not in-tree.
18-
rustc_smir = { path = "../rustc_smir" }
16+
rustc_public = { path = "../rustc_public" }
1917

20-
stable_mir = { path = "../stable_mir" }
18+
# Make sure rustc_public_bridge ends up in the sysroot, because this
19+
# crate is intended to be used by stable MIR consumers, which are not in-tree.
20+
rustc_public_bridge = { path = "../rustc_public_bridge" }
2121
# tidy-alphabetical-end
2222

2323
[dependencies.tikv-jemalloc-sys]

compiler/rustc_driver_impl/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ rustc_parse = { path = "../rustc_parse" }
4141
rustc_passes = { path = "../rustc_passes" }
4242
rustc_pattern_analysis = { path = "../rustc_pattern_analysis" }
4343
rustc_privacy = { path = "../rustc_privacy" }
44+
rustc_public = { path = "../rustc_public", features = ["rustc_internal"] }
4445
rustc_query_system = { path = "../rustc_query_system" }
4546
rustc_resolve = { path = "../rustc_resolve" }
4647
rustc_session = { path = "../rustc_session" }
@@ -50,7 +51,6 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
5051
rustc_ty_utils = { path = "../rustc_ty_utils" }
5152
serde_json = "1.0.59"
5253
shlex = "1.0"
53-
stable_mir = { path = "../stable_mir", features = ["rustc_internal"] }
5454
tracing = { version = "0.1.35" }
5555
# tidy-alphabetical-end
5656

compiler/rustc_driver_impl/src/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use rustc_middle::bug;
88
use rustc_middle::mir::{write_mir_graphviz, write_mir_pretty};
99
use rustc_middle::ty::{self, TyCtxt};
1010
use rustc_mir_build::thir::print::{thir_flat, thir_tree};
11+
use rustc_public::rustc_internal::pretty::write_smir_pretty;
1112
use rustc_session::Session;
1213
use rustc_session::config::{OutFileName, PpHirMode, PpMode, PpSourceMode};
1314
use rustc_span::{FileName, Ident};
14-
use stable_mir::rustc_internal::pretty::write_smir_pretty;
1515
use tracing::debug;
1616
use {rustc_ast as ast, rustc_hir_pretty as pprust_hir};
1717

compiler/stable_mir/Cargo.toml renamed to compiler/rustc_public/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "stable_mir"
2+
name = "rustc_public"
33
version = "0.1.0-preview"
44
edition = "2024"
55

@@ -8,8 +8,8 @@ edition = "2024"
88
rustc_abi = { path = "../rustc_abi" }
99
rustc_hir = { path = "../rustc_hir" }
1010
rustc_middle = { path = "../rustc_middle" }
11+
rustc_public_bridge = { path = "../rustc_public_bridge" }
1112
rustc_session = { path = "../rustc_session" }
12-
rustc_smir = { path = "../rustc_smir" }
1313
rustc_span = { path = "../rustc_span" }
1414
rustc_target = { path = "../rustc_target" }
1515
scoped-tls = "1.0"
File renamed without changes.
File renamed without changes.

compiler/stable_mir/src/alloc.rs renamed to compiler/rustc_public/src/alloc.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
//!
33
//! This module is responsible for constructing stable components.
44
//! All operations requiring rustc queries must be delegated
5-
//! to `rustc_smir::alloc` to maintain stability guarantees.
5+
//! to `rustc_public_bridge::alloc` to maintain stability guarantees.
66
77
use rustc_abi::Align;
88
use rustc_middle::mir::ConstValue;
99
use rustc_middle::mir::interpret::AllocRange;
10-
use rustc_smir::bridge::SmirError;
11-
use rustc_smir::context::SmirCtxt;
12-
use rustc_smir::{Tables, alloc};
10+
use rustc_public_bridge::bridge::SmirError;
11+
use rustc_public_bridge::context::SmirCtxt;
12+
use rustc_public_bridge::{Tables, alloc};
1313

1414
use super::Error;
1515
use super::compiler_interface::BridgeTys;
@@ -59,7 +59,7 @@ pub(crate) fn try_new_allocation<'tcx>(
5959
}
6060
ConstValue::Indirect { alloc_id, offset } => {
6161
let alloc = alloc::try_new_indirect(alloc_id, cx);
62-
use rustc_smir::context::SmirAllocRange;
62+
use rustc_public_bridge::context::SmirAllocRange;
6363
Ok(allocation_filter(&alloc.0, cx.alloc_range(offset, layout.size), tables, cx))
6464
}
6565
}

compiler/stable_mir/src/compiler_interface.rs renamed to compiler/rustc_public/src/compiler_interface.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
use std::cell::Cell;
77

88
use rustc_hir::def::DefKind;
9-
use rustc_smir::context::SmirCtxt;
10-
use rustc_smir::{Bridge, SmirContainer};
9+
use rustc_public_bridge::context::SmirCtxt;
10+
use rustc_public_bridge::{Bridge, SmirContainer};
1111
use tracing::debug;
1212

1313
use crate::abi::{FnAbi, Layout, LayoutShape, ReprOptions};
@@ -68,7 +68,7 @@ impl Bridge for BridgeTys {
6868

6969
/// Stable public API for querying compiler information.
7070
///
71-
/// All queries are delegated to [`rustc_smir::context::SmirCtxt`] that provides
71+
/// All queries are delegated to [`rustc_public_bridge::context::SmirCtxt`] that provides
7272
/// similar APIs but based on internal rustc constructs.
7373
///
7474
/// Do not use this directly. This is currently used in the macro expansion.
@@ -567,7 +567,7 @@ impl<'tcx> SmirInterface for SmirContainer<'tcx, BridgeTys> {
567567
DefKind::Fn => ForeignItemKind::Fn(tables.fn_def(def_id)),
568568
DefKind::Static { .. } => ForeignItemKind::Static(tables.static_def(def_id)),
569569
DefKind::ForeignTy => {
570-
use rustc_smir::context::SmirTy;
570+
use rustc_public_bridge::context::SmirTy;
571571
ForeignItemKind::Type(tables.intern_ty(cx.new_foreign(def_id)))
572572
}
573573
def_kind => unreachable!("Unexpected kind for a foreign item: {:?}", def_kind),

0 commit comments

Comments
 (0)