about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-05-25 07:30:04 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-05-25 07:30:04 +0000
commit3e0c1c8e0cdeab8871f96b1703f6b8a852d51568 (patch)
tree7ebdd61f00242b4534d342026ed308b2bdc60d73
downloadrust-3e0c1c8e0cdeab8871f96b1703f6b8a852d51568.tar.gz
rust-3e0c1c8e0cdeab8871f96b1703f6b8a852d51568.zip
Add WIP stable MIR crate
-rw-r--r--Cargo.toml10
-rw-r--r--src/lib.rs10
-rw-r--r--src/mir.rs10
-rw-r--r--src/very_unstable.rs9
4 files changed, 39 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 00000000000..0c5a19d4034
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,10 @@
+[package]
+name = "rustc_smir"
+version = "0.0.0"
+edition = "2021"
+
+[dependencies]
+rustc_middle = { path = "../rustc_middle" }
+rustc_driver = { path = "../rustc_driver" }
+rustc_borrowck = { path = "../rustc_borrowck" }
+rustc_interface = { path = "../rustc_interface" }
diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 00000000000..405ee1388dd
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,10 @@
+//! The WIP stable interface to rustc internals.
+
+#![doc(
+    html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
+    test(attr(allow(unused_variables), deny(warnings)))
+)]
+
+pub mod mir;
+
+pub mod very_unstable;
diff --git a/src/mir.rs b/src/mir.rs
new file mode 100644
index 00000000000..97969be669d
--- /dev/null
+++ b/src/mir.rs
@@ -0,0 +1,10 @@
+pub use rustc_middle::mir::{
+    visit::MutVisitor, AggregateKind, AssertKind, BasicBlock, BasicBlockData, BinOp, BindingForm,
+    BlockTailInfo, Body, BorrowKind, CastKind, ClearCrossCrate, Constant, ConstantKind,
+    CopyNonOverlapping, Coverage, FakeReadCause, Field, GeneratorInfo, ImplicitSelfKind,
+    InlineAsmOperand, Local, LocalDecl, LocalInfo, LocalKind, Location, MirPhase, MirSource,
+    NullOp, Operand, Place, PlaceRef, ProjectionElem, ProjectionKind, Promoted, RetagKind, Rvalue,
+    Safety, SourceInfo, SourceScope, SourceScopeData, SourceScopeLocalData, Statement,
+    StatementKind, UnOp, UserTypeProjection, UserTypeProjections, VarBindingForm, VarDebugInfo,
+    VarDebugInfoContents,
+};
diff --git a/src/very_unstable.rs b/src/very_unstable.rs
new file mode 100644
index 00000000000..8ba0251629d
--- /dev/null
+++ b/src/very_unstable.rs
@@ -0,0 +1,9 @@
+//! This module reexports various crates and modules from unstable rustc APIs.
+//! Add anything you need here and it will get slowly transferred to a stable API.
+//! Only use rustc_smir in your dependencies and use the reexports here instead of
+//! directly referring to the unstable crates.
+
+pub use rustc_borrowck as borrowck;
+pub use rustc_driver as driver;
+pub use rustc_interface as interface;
+pub use rustc_middle as middle;