Skip to content

Commit f8c2478

Browse files
committed
Reorder imports and remove re-export
1 parent d7c7236 commit f8c2478

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

compiler/rustc_smir/src/rustc_smir/convert/mir.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Conversion of internal Rust compiler `mir` items to stable ones.
2-
use crate::rustc_smir::{alloc, Stable, Tables};
2+
33
use rustc_middle::mir;
44
use rustc_middle::mir::interpret::alloc_range;
55
use rustc_middle::mir::mono::MonoItem;
@@ -8,6 +8,8 @@ use stable_mir::mir::{ConstOperand, Statement, UserTypeProjection, VarDebugInfoF
88
use stable_mir::ty::{Allocation, Const, ConstantKind};
99
use stable_mir::{opaque, Error};
1010

11+
use crate::rustc_smir::{alloc, Stable, Tables};
12+
1113
impl<'tcx> Stable<'tcx> for mir::Body<'tcx> {
1214
type T = stable_mir::mir::Body;
1315

compiler/rustc_smir/src/rustc_smir/convert/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
//! Conversion of internal Rust compiler items to stable ones.
2-
use crate::rustc_smir::{Stable, Tables};
2+
33
use rustc_target::abi::FieldIdx;
44
use stable_mir::mir::VariantIdx;
55

6+
use crate::rustc_smir::{Stable, Tables};
7+
68
mod mir;
79
mod ty;
810

compiler/rustc_smir/src/rustc_smir/convert/ty.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
//! Conversion of internal Rust compiler `ty` items to stable ones.
22
3-
use crate::rustc_smir::{alloc, Stable, Tables};
43
use rustc_middle::ty::Ty;
54
use rustc_middle::{mir, ty};
65
use stable_mir::ty::{
76
AdtKind, Const, ConstantKind, FloatTy, GenericArgs, GenericParamDef, IntTy, Region, RigidTy,
87
TyKind, UintTy,
98
};
109

10+
use crate::rustc_smir::{alloc, Stable, Tables};
11+
1112
impl<'tcx> Stable<'tcx> for ty::AliasKind {
1213
type T = stable_mir::ty::AliasKind;
1314
fn stable(&self, _: &mut Tables<'tcx>) -> Self::T {

compiler/stable_mir/src/compiler_interface.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
//! StableMIR users should not use any of the items in this module directly.
44
//! These APIs have no stability guarantee.
55
6+
use std::cell::Cell;
7+
68
use crate::mir::alloc::{AllocId, GlobalAlloc};
79
use crate::mir::mono::{Instance, InstanceDef, StaticDef};
810
use crate::mir::Body;
@@ -15,7 +17,6 @@ use crate::{
1517
mir, Crate, CrateItem, CrateItems, DefId, Error, Filename, ImplTraitDecls, ItemKind, Symbol,
1618
TraitDecls,
1719
};
18-
use std::cell::Cell;
1920

2021
/// This trait defines the interface between stable_mir and the Rust compiler.
2122
/// Do not use this directly.

compiler/stable_mir/src/lib.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@
1717
//! The goal is to eventually be published on
1818
//! [crates.io](https://crates.io).
1919
20-
use self::ty::{ImplDef, ImplTrait, IndexedVal, Span, TraitDecl, TraitDef, Ty};
21-
pub(crate) use crate::compiler_interface::with;
20+
#[macro_use]
21+
extern crate scoped_tls;
22+
23+
use std::fmt;
24+
use std::fmt::Debug;
25+
use std::io;
26+
27+
use crate::compiler_interface::with;
2228
pub use crate::crate_def::CrateDef;
2329
pub use crate::crate_def::DefId;
30+
pub use crate::error::*;
2431
use crate::mir::pretty::function_name;
2532
use crate::mir::Body;
2633
use crate::mir::Mutability;
27-
pub use error::*;
28-
use std::fmt;
29-
use std::fmt::Debug;
30-
use std::io;
31-
32-
#[macro_use]
33-
extern crate scoped_tls;
34+
use crate::ty::{ImplDef, ImplTrait, IndexedVal, Span, TraitDecl, TraitDef, Ty};
3435

3536
#[macro_use]
3637
pub mod crate_def;

0 commit comments

Comments
 (0)