Skip to content

fix smir's run! doc and import #139741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions compiler/rustc_smir/src/rustc_internal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ where
/// ```ignore(needs-extern-crate)
/// # extern crate rustc_driver;
/// # extern crate rustc_interface;
/// # extern crate rustc_middle;
/// # #[macro_use]
/// # extern crate rustc_smir;
/// # extern crate stable_mir;
Expand All @@ -264,6 +265,7 @@ where
/// ```ignore(needs-extern-crate)
/// # extern crate rustc_driver;
/// # extern crate rustc_interface;
/// # extern crate rustc_middle;
/// # #[macro_use]
/// # extern crate rustc_smir;
/// # extern crate stable_mir;
Expand Down Expand Up @@ -328,6 +330,7 @@ macro_rules! run_driver {
use rustc_driver::{Callbacks, Compilation, run_compiler};
use rustc_middle::ty::TyCtxt;
use rustc_interface::interface;
use rustc_smir::rustc_internal;
use stable_mir::CompilerError;
use std::ops::ControlFlow;

Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::abi::{
ArgAbi, CallConvention, FieldsShape, IntegerLength, PassMode, Primitive, Scalar, ValueAbi,
VariantsShape,
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::crate_def::CrateDef;
use stable_mir::mir::alloc::GlobalAlloc;
use stable_mir::mir::mono::{Instance, InstanceKind, StaticDef};
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_assoc_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use std::io::Write;
use std::collections::HashSet;
use stable_mir::CrateDef;
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::{CrateDef, CrateItems};
use std::io::Write;
use std::ops::ControlFlow;
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_binop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::mir::mono::Instance;
use stable_mir::mir::visit::{Location, MirVisitor};
use stable_mir::mir::{LocalDecl, Rvalue, Statement, StatementKind, Terminator, TerminatorKind};
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_crate_defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::CrateDef;
use std::collections::HashSet;
use std::io::Write;
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_def_ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::ty::{Ty, ForeignItemKind};
use stable_mir::*;
use std::io::Write;
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ extern crate stable_mir;
use std::assert_matches::assert_matches;
use mir::{mono::Instance, TerminatorKind::*};
use stable_mir::mir::mono::InstanceKind;
use rustc_smir::rustc_internal;
use stable_mir::ty::{RigidTy, TyKind, Ty, UintTy};
use stable_mir::*;
use std::io::Write;
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_foreign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern crate rustc_interface;
extern crate rustc_span;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::{
ty::{Abi, ForeignItemKind},
*,
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use std::ops::ControlFlow;

use mir::mono::Instance;
use mir::TerminatorKind::*;
use rustc_smir::rustc_internal;
use stable_mir::ty::{RigidTy, TyKind};
use stable_mir::*;

Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::mir::mono::{Instance, InstanceKind};
use stable_mir::mir::visit::{Location, MirVisitor};
use stable_mir::mir::{LocalDecl, Terminator, TerminatorKind};
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_item_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::*;
use std::io::Write;
use std::ops::ControlFlow;
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_normalization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern crate stable_mir;

use mir::mono::Instance;
use ty::{Ty, TyKind, RigidTy};
use rustc_smir::rustc_internal;
use stable_mir::*;
use std::io::Write;
use std::ops::ControlFlow;
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_trait_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::CrateDef;
use std::collections::HashSet;
use std::io::Write;
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::mir::alloc::GlobalAlloc;
use stable_mir::mir::mono::Instance;
use stable_mir::mir::{Body, ConstOperand, Operand, Rvalue, StatementKind, TerminatorKind};
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/check_ty_fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::mir::{
Body, FieldIdx, MirVisitor, Place, ProjectionElem,
visit::{Location, PlaceContext},
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/compilation-result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use std::io::Write;

/// This test will generate and analyze a dummy crate using the stable mir.
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/crate-info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ extern crate rustc_interface;
extern crate stable_mir;

use rustc_hir::def::DefKind;
use rustc_smir::rustc_internal;
use stable_mir::ItemKind;
use stable_mir::crate_def::CrateDef;
use stable_mir::mir::mono::Instance;
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/projections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::ItemKind;
use stable_mir::crate_def::CrateDef;
use stable_mir::mir::{ProjectionElem, Rvalue, StatementKind};
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/smir_serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ extern crate serde_json;
extern crate stable_mir;

use rustc_middle::ty::TyCtxt;
use rustc_smir::rustc_internal;
use serde_json::to_string;
use stable_mir::mir::Body;
use std::io::{BufWriter, Write};
Expand Down
1 change: 0 additions & 1 deletion tests/ui-fulldeps/stable-mir/smir_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ extern crate rustc_driver;
extern crate rustc_interface;
extern crate stable_mir;

use rustc_smir::rustc_internal;
use stable_mir::mir::MirVisitor;
use stable_mir::mir::MutMirVisitor;
use stable_mir::*;
Expand Down
Loading