mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Run reveal_all on MIR more often.
This commit is contained in:
parent
c4ff03f689
commit
a3776d99cc
@ -11,7 +11,7 @@ impl<'tcx> MirPass<'tcx> for RevealAll {
|
||||
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
|
||||
// This pass must run before inlining, since we insert callee bodies in RevealAll mode.
|
||||
// Do not apply this transformation to generators.
|
||||
if (tcx.sess.mir_opt_level() >= 3 || !super::inline::is_enabled(tcx))
|
||||
if (tcx.sess.mir_opt_level() >= 3 || super::inline::is_enabled(tcx))
|
||||
&& body.generator.is_none()
|
||||
{
|
||||
let param_env = tcx.param_env_reveal_all_normalized(body.source.def_id());
|
||||
|
@ -1,4 +1,4 @@
|
||||
// EMIT_MIR issue_78192.f.InstCombine.diff
|
||||
// compile-flags: -Zmir-opt-level=1 -Zinline-mir
|
||||
pub fn f<T>(a: &T) -> *const T {
|
||||
let b: &*const T = &(a as *const T);
|
||||
*b
|
||||
@ -7,3 +7,5 @@ pub fn f<T>(a: &T) -> *const T {
|
||||
fn main() {
|
||||
f(&2);
|
||||
}
|
||||
|
||||
// EMIT_MIR issue_78192.f.InstCombine.diff
|
||||
|
Loading…
Reference in New Issue
Block a user