From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_smir/src/lib.rs | 17 +++++++++++++++++ compiler/rustc_smir/src/mir.rs | 10 ++++++++++ compiler/rustc_smir/src/very_unstable.rs | 27 +++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 compiler/rustc_smir/src/lib.rs create mode 100644 compiler/rustc_smir/src/mir.rs create mode 100644 compiler/rustc_smir/src/very_unstable.rs (limited to 'compiler/rustc_smir/src') diff --git a/compiler/rustc_smir/src/lib.rs b/compiler/rustc_smir/src/lib.rs new file mode 100644 index 000000000..5c7aaf35b --- /dev/null +++ b/compiler/rustc_smir/src/lib.rs @@ -0,0 +1,17 @@ +//! The WIP stable interface to rustc internals. +//! +//! For more information see https://github.com/rust-lang/project-stable-mir +//! +//! # Note +//! +//! This API is still completely unstable and subject to change. + +#![doc( + html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/", + test(attr(allow(unused_variables), deny(warnings))) +)] +#![cfg_attr(not(feature = "default"), feature(rustc_private))] + +pub mod mir; + +pub mod very_unstable; diff --git a/compiler/rustc_smir/src/mir.rs b/compiler/rustc_smir/src/mir.rs new file mode 100644 index 000000000..855605b1a --- /dev/null +++ b/compiler/rustc_smir/src/mir.rs @@ -0,0 +1,10 @@ +pub use crate::very_unstable::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/compiler/rustc_smir/src/very_unstable.rs b/compiler/rustc_smir/src/very_unstable.rs new file mode 100644 index 000000000..12ba133db --- /dev/null +++ b/compiler/rustc_smir/src/very_unstable.rs @@ -0,0 +1,27 @@ +//! 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. + +macro_rules! crates { + ($($rustc_name:ident -> $name:ident,)*) => { + $( + #[cfg(not(feature = "default"))] + pub extern crate $rustc_name as $name; + #[cfg(feature = "default")] + pub use $rustc_name as $name; + )* + } +} + +crates! { + rustc_borrowck -> borrowck, + rustc_driver -> driver, + rustc_hir -> hir, + rustc_interface -> interface, + rustc_middle -> middle, + rustc_mir_dataflow -> dataflow, + rustc_mir_transform -> transform, + rustc_serialize -> serialize, + rustc_trait_selection -> trait_selection, +} -- cgit v1.2.3