Skip to content

Commit f50080f

Browse files
authored
Rollup merge of #90649 - cjgillot:reveal-all-2, r=lcnr
Run reveal_all on MIR when inlining is activated. Fix logic error in #85254 which prevented the pass from running when needed. Fixes #78442 r? `@lcnr`
2 parents 3c1ecc9 + a3776d9 commit f50080f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/rustc_mir_transform/src/reveal_all.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ impl<'tcx> MirPass<'tcx> for RevealAll {
1111
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
1212
// This pass must run before inlining, since we insert callee bodies in RevealAll mode.
1313
// Do not apply this transformation to generators.
14-
if (tcx.sess.mir_opt_level() >= 3 || !super::inline::is_enabled(tcx))
14+
if (tcx.sess.mir_opt_level() >= 3 || super::inline::is_enabled(tcx))
1515
&& body.generator.is_none()
1616
{
1717
let param_env = tcx.param_env_reveal_all_normalized(body.source.def_id());

src/test/mir-opt/issue-78192.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// EMIT_MIR issue_78192.f.InstCombine.diff
1+
// compile-flags: -Zmir-opt-level=1 -Zinline-mir
22
pub fn f<T>(a: &T) -> *const T {
33
let b: &*const T = &(a as *const T);
44
*b
@@ -7,3 +7,5 @@ pub fn f<T>(a: &T) -> *const T {
77
fn main() {
88
f(&2);
99
}
10+
11+
// EMIT_MIR issue_78192.f.InstCombine.diff

0 commit comments

Comments
 (0)