Skip to content

Commit 8f184b3

Browse files
committed
qualify_consts: misc cleanup.
1 parent 3cc8087 commit 8f184b3

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/librustc_mir/transform/qualify_consts.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,20 +1714,16 @@ impl<'tcx> MirPass<'tcx> for QualifyAndPromoteConstants<'tcx> {
17141714
},
17151715
target,
17161716
..
1717-
} => {
1718-
if promoted_temps.contains(index) {
1719-
terminator.kind = TerminatorKind::Goto {
1720-
target,
1721-
};
1722-
}
1717+
} if promoted_temps.contains(index) => {
1718+
terminator.kind = TerminatorKind::Goto { target };
17231719
}
17241720
_ => {}
17251721
}
17261722
}
17271723
}
17281724

17291725
// Statics must be Sync.
1730-
if mode == Mode::Static {
1726+
if let Mode::Static = mode {
17311727
// `#[thread_local]` statics don't have to be `Sync`.
17321728
for attr in &tcx.get_attrs(def_id)[..] {
17331729
if attr.check_name(sym::thread_local) {

0 commit comments

Comments
 (0)