Stream: t-compiler

Topic: backport #66394


simulacrum (Dec 05 2019 at 18:42, on Zulip):

@Wesley Wiser #66394 doesn't seem to backport cleanly onto beta, could you prepare a commit that merges that into beta appropriately (no need to post a PR, I can fetch directly from your repo if you just push up a branch or so)

simulacrum (Dec 05 2019 at 18:42, on Zulip):

Specifically I'm seeing this conflict:

diff --cc src/librustc_mir/transform/const_prop.rs
index f411dfed064,979d109aa05..00000000000
--- a/src/librustc_mir/transform/const_prop.rs
+++ b/src/librustc_mir/transform/const_prop.rs
@@@ -22,9 -22,10 +22,9 @@@ use rustc::ty::subst::InternalSubsts
  use rustc_data_structures::fx::FxHashMap;
  use rustc_index::vec::IndexVec;
  use rustc::ty::layout::{
-     LayoutOf, TyLayout, LayoutError, HasTyCtxt, TargetDataLayout, HasDataLayout,
+     LayoutOf, TyLayout, LayoutError, HasTyCtxt, TargetDataLayout, HasDataLayout, Size,
  };

 -use crate::rustc::ty::subst::Subst;
  use crate::interpret::{
      self, InterpCx, ScalarMaybeUndef, Immediate, OpTy,
      StackPopCleanup, LocalValue, LocalState, AllocId, Frame,
@@@ -308,11 -310,23 +311,37 @@@ impl<'mir, 'tcx> ConstPropagator<'mir,
          let mut ecx = InterpCx::new(tcx.at(span), param_env, ConstPropMachine, ());
          let can_const_prop = CanConstProp::check(body);

++<<<<<<< HEAD
++||||||| parent of d389f64cdb5... Fix spurious CI filures due to OOM
++        let substs = &InternalSubsts::identity_for_item(tcx, def_id);
++
++        let ret =
++            ecx
++                .layout_of(body.return_ty().subst(tcx, substs))
++                .ok()
++                // Don't bother allocating memory for ZST types which have no values.
++                .filter(|ret_layout| !ret_layout.is_zst())
++                .map(|ret_layout| ecx.allocate(ret_layout, MemoryKind::Stack));
++
++=======
+         let substs = &InternalSubsts::identity_for_item(tcx, def_id);
+
+         let ret =
+             ecx
+                 .layout_of(body.return_ty().subst(tcx, substs))
+                 .ok()
+                 // Don't bother allocating memory for ZST types which have no values
+                 // or for large values.
+                 .filter(|ret_layout| !ret_layout.is_zst() &&
+                                      ret_layout.size < Size::from_bytes(MAX_ALLOC_LIMIT))
+                 .map(|ret_layout| ecx.allocate(ret_layout, MemoryKind::Stack));
+
++>>>>>>> d389f64cdb5... Fix spurious CI filures due to OOM
          ecx.push_stack_frame(
 -            Instance::new(def_id, substs),
 +            Instance::new(def_id, &InternalSubsts::identity_for_item(tcx, def_id)),
              span,
              dummy_body,
 -            ret.map(Into::into),
 +            None,
              StackPopCleanup::None {
                  cleanup: false,
              },
simulacrum (Dec 05 2019 at 18:43, on Zulip):

when cherry picking d389f64cdb5b4a99075030131378b52ee791d8be

Wesley Wiser (Dec 05 2019 at 18:43, on Zulip):

Sure! I'll try to do that tonight.

simulacrum (Dec 05 2019 at 18:46, on Zulip):

Thanks! Please ping me here once that's done so I can get the backport PR rolling

Wesley Wiser (Dec 06 2019 at 00:11, on Zulip):

@simulacrum The backport for #66394 is in https://github.com/rust-lang/rust/commit/ea9878be3f89052388aaa2c3ef6f1933ab99f1a5

simulacrum (Dec 06 2019 at 00:12, on Zulip):

Thanks! I'm away from a keyboard right now but will merge that in tonight.

Wesley Wiser (Dec 06 2019 at 00:12, on Zulip):

Cool! LMK if you run into any issues

simulacrum (Dec 06 2019 at 00:12, on Zulip):

That squashed everything into one commit, right?

Wesley Wiser (Dec 06 2019 at 00:13, on Zulip):

Yeah

simulacrum (Dec 06 2019 at 00:13, on Zulip):

Perfect, thanks!

Last update: Jan 21 2020 at 08:30UTC