Skip to content

Commit f40fc32

Browse files
committed
Auto merge of #115865 - RalfJung:mir-mod, r=oli-obk
move things out of mir/mod.rs This moves a bunch of things out of `mir/mod.rs`: - all const-related stuff to a new file consts.rs - all statement/place/operand-related stuff to a new file statement.rs - all pretty-printing related stuff to pretty.rs `mod.rs` started out with 3100 lines and ends up with 1600. :) Also there was some pretty-printing stuff in terminator.rs, that also got moved to pretty.rs, and I reordered things in pretty.rs so that it can be grouped by functionality. Only the commit "use pretty_print_const_value from MIR constant 'extra' printing" has any behavior changes; it resolves the issue of having a fancy and a very crude pretty-printer for `ConstValue`. r? `@oli-obk`
2 parents f248ea8 + 0a2d7f2 commit f40fc32

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_utils/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ impl<'a, 'tcx> ConstEvalLateContext<'a, 'tcx> {
656656
}
657657

658658
pub fn miri_to_const<'tcx>(lcx: &LateContext<'tcx>, result: mir::ConstantKind<'tcx>) -> Option<Constant<'tcx>> {
659-
use rustc_middle::mir::interpret::ConstValue;
659+
use rustc_middle::mir::ConstValue;
660660
match result {
661661
mir::ConstantKind::Val(ConstValue::Scalar(Scalar::Int(int)), _) => match result.ty().kind() {
662662
ty::Adt(adt_def, _) if adt_def.is_struct() => Some(Constant::Adt(result)),

clippy_utils/src/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_hir::{Expr, FnDecl, LangItem, TyKind, Unsafety};
1313
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
1414
use rustc_infer::infer::TyCtxtInferExt;
1515
use rustc_lint::LateContext;
16-
use rustc_middle::mir::interpret::{ConstValue, Scalar};
16+
use rustc_middle::mir::{ConstValue, interpret::Scalar};
1717
use rustc_middle::traits::EvaluationResult;
1818
use rustc_middle::ty::layout::ValidityRequirement;
1919
use rustc_middle::ty::{

0 commit comments

Comments
 (0)