Skip to content

Commit 19898d6

Browse files
committed
a wild commit has appeared!
1 parent 00d5e42 commit 19898d6

15 files changed

+806
-1
lines changed

compiler/rustc_middle/src/mir/terminator.rs

+7
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,13 @@ impl<'tcx> TerminatorKind<'tcx> {
417417
}
418418
}
419419

420+
pub fn switch_targets_mut(&mut self) -> Option<&mut SwitchTargets> {
421+
match self {
422+
TerminatorKind::SwitchInt { targets, .. } => Some(targets),
423+
_ => None,
424+
}
425+
}
426+
420427
pub fn as_goto(&self) -> Option<BasicBlock> {
421428
match self {
422429
TerminatorKind::Goto { target } => Some(*target),

compiler/rustc_mir_dataflow/src/framework/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ impl EffectIndex {
530530
}
531531
}
532532

533+
#[derive(Debug)]
533534
pub struct SwitchIntTarget {
534535
pub value: Option<u128>,
535536
pub target: BasicBlock,

compiler/rustc_mir_dataflow/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub use self::drop_flag_effects::{
3131
pub use self::framework::{
3232
fmt, graphviz, lattice, visit_results, Analysis, AnalysisDomain, Backward, Direction, Engine,
3333
Forward, GenKill, GenKillAnalysis, JoinSemiLattice, Results, ResultsCursor, ResultsRefCursor,
34-
ResultsVisitable, ResultsVisitor,
34+
ResultsVisitable, ResultsVisitor, SwitchIntEdgeEffects,
3535
};
3636

3737
use self::move_paths::MoveData;

compiler/rustc_mir_transform/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#![feature(never_type)]
1313
#![feature(trusted_step)]
1414
#![feature(try_blocks)]
15+
#![feature(if_let_guard)]
1516
#![recursion_limit = "256"]
1617
#![cfg_attr(not(bootstrap), allow(rustc::potential_query_instability))]
1718

@@ -62,6 +63,7 @@ mod match_branches;
6263
mod multiple_return_terminators;
6364
mod normalize_array_len;
6465
mod nrvo;
66+
mod refinements;
6567
mod remove_noop_landing_pads;
6668
mod remove_storage_markers;
6769
mod remove_unneeded_drops;
@@ -507,6 +509,7 @@ fn run_optimization_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
507509

508510
// The main optimizations that we do on MIR.
509511
let optimizations: &[&dyn MirPass<'tcx>] = &[
512+
&refinements::Refinements,
510513
&remove_storage_markers::RemoveStorageMarkers,
511514
&remove_zsts::RemoveZsts,
512515
&const_goto::ConstGoto,

0 commit comments

Comments
 (0)