Skip to content

Commit 4655866

Browse files
committed
Fix CR feedback
1 parent c535147 commit 4655866

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

Diff for: src/librustc/mir/mod.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,16 @@ impl<'tcx> HasLocalDecls<'tcx> for Mir<'tcx> {
7474
/// Warning: ordering of variants is significant
7575
#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug, PartialEq, Eq, PartialOrd, Ord)]
7676
pub enum MirPhase {
77-
Build,
78-
Const,
79-
Validated,
80-
Optimized,
77+
Build = 0,
78+
Const = 1,
79+
Validated = 2,
80+
Optimized = 3,
8181
}
8282

8383
impl MirPhase {
8484
/// Gets the index of the current MirPhase within the set of all MirPhases.
8585
pub fn phase_index(&self) -> usize {
86-
match self {
87-
MirPhase::Build => 0,
88-
MirPhase::Const => 1,
89-
MirPhase::Validated => 2,
90-
MirPhase::Optimized => 3,
91-
}
86+
*self as usize
9287
}
9388
}
9489

Diff for: src/librustc_mir/transform/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ pub fn run_passes(
160160
mir: &mut Mir<'tcx>,
161161
def_id: DefId,
162162
mir_phase: MirPhase,
163-
passes: &[&dyn MirPass]) {
163+
passes: &[&dyn MirPass],
164+
) {
164165
let phase_index = mir_phase.phase_index();
165166

166167
let run_passes = |mir: &mut Mir<'tcx>, promoted| {

0 commit comments

Comments
 (0)