Reorder imports and remove re-export

This commit is contained in:
Celina G. Val 2023-11-24 15:09:26 -08:00
parent d7c7236845
commit f8c2478b6b
5 changed files with 21 additions and 14 deletions

View File

@ -1,5 +1,5 @@
//! Conversion of internal Rust compiler `mir` items to stable ones. //! Conversion of internal Rust compiler `mir` items to stable ones.
use crate::rustc_smir::{alloc, Stable, Tables};
use rustc_middle::mir; use rustc_middle::mir;
use rustc_middle::mir::interpret::alloc_range; use rustc_middle::mir::interpret::alloc_range;
use rustc_middle::mir::mono::MonoItem; use rustc_middle::mir::mono::MonoItem;
@ -8,6 +8,8 @@ use stable_mir::mir::{ConstOperand, Statement, UserTypeProjection, VarDebugInfoF
use stable_mir::ty::{Allocation, Const, ConstantKind}; use stable_mir::ty::{Allocation, Const, ConstantKind};
use stable_mir::{opaque, Error}; use stable_mir::{opaque, Error};
use crate::rustc_smir::{alloc, Stable, Tables};
impl<'tcx> Stable<'tcx> for mir::Body<'tcx> { impl<'tcx> Stable<'tcx> for mir::Body<'tcx> {
type T = stable_mir::mir::Body; type T = stable_mir::mir::Body;

View File

@ -1,8 +1,10 @@
//! Conversion of internal Rust compiler items to stable ones. //! Conversion of internal Rust compiler items to stable ones.
use crate::rustc_smir::{Stable, Tables};
use rustc_target::abi::FieldIdx; use rustc_target::abi::FieldIdx;
use stable_mir::mir::VariantIdx; use stable_mir::mir::VariantIdx;
use crate::rustc_smir::{Stable, Tables};
mod mir; mod mir;
mod ty; mod ty;

View File

@ -1,6 +1,5 @@
//! Conversion of internal Rust compiler `ty` items to stable ones. //! Conversion of internal Rust compiler `ty` items to stable ones.
use crate::rustc_smir::{alloc, Stable, Tables};
use rustc_middle::ty::Ty; use rustc_middle::ty::Ty;
use rustc_middle::{mir, ty}; use rustc_middle::{mir, ty};
use stable_mir::ty::{ use stable_mir::ty::{
@ -8,6 +7,8 @@ use stable_mir::ty::{
TyKind, UintTy, TyKind, UintTy,
}; };
use crate::rustc_smir::{alloc, Stable, Tables};
impl<'tcx> Stable<'tcx> for ty::AliasKind { impl<'tcx> Stable<'tcx> for ty::AliasKind {
type T = stable_mir::ty::AliasKind; type T = stable_mir::ty::AliasKind;
fn stable(&self, _: &mut Tables<'tcx>) -> Self::T { fn stable(&self, _: &mut Tables<'tcx>) -> Self::T {

View File

@ -3,6 +3,8 @@
//! StableMIR users should not use any of the items in this module directly. //! StableMIR users should not use any of the items in this module directly.
//! These APIs have no stability guarantee. //! These APIs have no stability guarantee.
use std::cell::Cell;
use crate::mir::alloc::{AllocId, GlobalAlloc}; use crate::mir::alloc::{AllocId, GlobalAlloc};
use crate::mir::mono::{Instance, InstanceDef, StaticDef}; use crate::mir::mono::{Instance, InstanceDef, StaticDef};
use crate::mir::Body; use crate::mir::Body;
@ -15,7 +17,6 @@ use crate::{
mir, Crate, CrateItem, CrateItems, DefId, Error, Filename, ImplTraitDecls, ItemKind, Symbol, mir, Crate, CrateItem, CrateItems, DefId, Error, Filename, ImplTraitDecls, ItemKind, Symbol,
TraitDecls, TraitDecls,
}; };
use std::cell::Cell;
/// This trait defines the interface between stable_mir and the Rust compiler. /// This trait defines the interface between stable_mir and the Rust compiler.
/// Do not use this directly. /// Do not use this directly.

View File

@ -17,20 +17,21 @@
//! The goal is to eventually be published on //! The goal is to eventually be published on
//! [crates.io](https://crates.io). //! [crates.io](https://crates.io).
use self::ty::{ImplDef, ImplTrait, IndexedVal, Span, TraitDecl, TraitDef, Ty}; #[macro_use]
pub(crate) use crate::compiler_interface::with; extern crate scoped_tls;
pub use crate::crate_def::CrateDef;
pub use crate::crate_def::DefId;
use crate::mir::pretty::function_name;
use crate::mir::Body;
use crate::mir::Mutability;
pub use error::*;
use std::fmt; use std::fmt;
use std::fmt::Debug; use std::fmt::Debug;
use std::io; use std::io;
#[macro_use] use crate::compiler_interface::with;
extern crate scoped_tls; pub use crate::crate_def::CrateDef;
pub use crate::crate_def::DefId;
pub use crate::error::*;
use crate::mir::pretty::function_name;
use crate::mir::Body;
use crate::mir::Mutability;
use crate::ty::{ImplDef, ImplTrait, IndexedVal, Span, TraitDecl, TraitDef, Ty};
#[macro_use] #[macro_use]
pub mod crate_def; pub mod crate_def;