diff options
| author | Wesley Wiser <wwiser@gmail.com> | 2020-12-14 07:35:03 -0500 |
|---|---|---|
| committer | Wesley Wiser <wwiser@gmail.com> | 2020-12-14 19:56:10 -0500 |
| commit | 0b18ed833c4406d8fc654b9f4990d2f80dc205c4 (patch) | |
| tree | b52a953d8affaed8f1c8a6b4c1fe23512db7ac78 /compiler | |
| parent | 01aec8d18556be5e8d498c2f331b9015b7befde2 (diff) | |
| download | rust-0b18ed833c4406d8fc654b9f4990d2f80dc205c4.tar.gz rust-0b18ed833c4406d8fc654b9f4990d2f80dc205c4.zip | |
Disable the constant debuginfo promotion pass by default
It doesn't work correctly on *-pc-windows-gnu
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_mir/src/transform/const_debuginfo.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_mir/src/transform/const_debuginfo.rs b/compiler/rustc_mir/src/transform/const_debuginfo.rs index ed2c48b3568..3cdaf4c7dcd 100644 --- a/compiler/rustc_mir/src/transform/const_debuginfo.rs +++ b/compiler/rustc_mir/src/transform/const_debuginfo.rs @@ -15,7 +15,11 @@ use rustc_index::{bit_set::BitSet, vec::IndexVec}; pub struct ConstDebugInfo; impl<'tcx> MirPass<'tcx> for ConstDebugInfo { - fn run_pass(&self, _tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { + fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { + if !tcx.sess.opts.debugging_opts.unsound_mir_opts { + return; + } + trace!("running ConstDebugInfo on {:?}", body.source); for (local, constant) in find_optimization_oportunities(body) { |
