diff --git a/src/ci/docker/dist-i686-linux/build-openssl.sh b/src/ci/docker/dist-i686-linux/build-openssl.sh index 64b1abf82a827..27cd064f901a0 100755 --- a/src/ci/docker/dist-i686-linux/build-openssl.sh +++ b/src/ci/docker/dist-i686-linux/build-openssl.sh @@ -12,9 +12,10 @@ set -ex source shared.sh -VERSION=1.0.2j +VERSION=1.0.2k +URL=https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/openssl-$VERSION.tar.gz -curl https://www.openssl.org/source/openssl-$VERSION.tar.gz | tar xzf - +curl $URL | tar xzf - cd openssl-$VERSION hide_output ./config --prefix=/rustroot shared -fPIC diff --git a/src/ci/docker/dist-x86_64-linux/build-openssl.sh b/src/ci/docker/dist-x86_64-linux/build-openssl.sh index 64b1abf82a827..27cd064f901a0 100755 --- a/src/ci/docker/dist-x86_64-linux/build-openssl.sh +++ b/src/ci/docker/dist-x86_64-linux/build-openssl.sh @@ -12,9 +12,10 @@ set -ex source shared.sh -VERSION=1.0.2j +VERSION=1.0.2k +URL=https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror/openssl-$VERSION.tar.gz -curl https://www.openssl.org/source/openssl-$VERSION.tar.gz | tar xzf - +curl $URL | tar xzf - cd openssl-$VERSION hide_output ./config --prefix=/rustroot shared -fPIC diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index bfb72b5df7b2e..b6c2390496270 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -797,7 +797,7 @@ pub enum StatementKind<'tcx> { StorageDead(Lvalue<'tcx>), InlineAsm { - asm: InlineAsm, + asm: Box, outputs: Vec>, inputs: Vec> }, @@ -993,7 +993,7 @@ pub struct VisibilityScopeData { #[derive(Clone, PartialEq, RustcEncodable, RustcDecodable)] pub enum Operand<'tcx> { Consume(Lvalue<'tcx>), - Constant(Constant<'tcx>), + Constant(Box>), } impl<'tcx> Debug for Operand<'tcx> { @@ -1013,7 +1013,7 @@ impl<'tcx> Operand<'tcx> { substs: &'tcx Substs<'tcx>, span: Span, ) -> Self { - Operand::Constant(Constant { + Operand::Constant(box Constant { span: span, ty: tcx.item_type(def_id).subst(tcx, substs), literal: Literal::Value { value: ConstVal::Function(def_id, substs) }, @@ -1060,7 +1060,7 @@ pub enum Rvalue<'tcx> { /// ..., y: ... }` from `dest.x = ...; dest.y = ...;` in the case /// that `Foo` has a destructor. These rvalues can be optimized /// away after type-checking and before lowering. - Aggregate(AggregateKind<'tcx>, Vec>), + Aggregate(Box>, Vec>), } #[derive(Clone, Copy, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)] @@ -1183,7 +1183,7 @@ impl<'tcx> Debug for Rvalue<'tcx> { tuple_fmt.finish() } - match *kind { + match **kind { AggregateKind::Array(_) => write!(fmt, "{:?}", lvs), AggregateKind::Tuple => { @@ -1601,7 +1601,7 @@ impl<'tcx> TypeFoldable<'tcx> for Rvalue<'tcx> { Discriminant(ref lval) => Discriminant(lval.fold_with(folder)), Box(ty) => Box(ty.fold_with(folder)), Aggregate(ref kind, ref fields) => { - let kind = match *kind { + let kind = box match **kind { AggregateKind::Array(ty) => AggregateKind::Array(ty.fold_with(folder)), AggregateKind::Tuple => AggregateKind::Tuple, AggregateKind::Adt(def, v, substs, n) => @@ -1629,7 +1629,7 @@ impl<'tcx> TypeFoldable<'tcx> for Rvalue<'tcx> { Discriminant(ref lval) => lval.visit_with(visitor), Box(ty) => ty.visit_with(visitor), Aggregate(ref kind, ref fields) => { - (match *kind { + (match **kind { AggregateKind::Array(ty) => ty.visit_with(visitor), AggregateKind::Tuple => false, AggregateKind::Adt(_, _, substs, _) => substs.visit_with(visitor), diff --git a/src/librustc/mir/tcx.rs b/src/librustc/mir/tcx.rs index f40b9c6053753..7cb5dab351441 100644 --- a/src/librustc/mir/tcx.rs +++ b/src/librustc/mir/tcx.rs @@ -183,7 +183,7 @@ impl<'tcx> Rvalue<'tcx> { tcx.mk_box(t) } Rvalue::Aggregate(ref ak, ref ops) => { - match *ak { + match **ak { AggregateKind::Array(ty) => { tcx.mk_array(ty, ops.len()) } diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs index 83963de8b0014..c8e275558424b 100644 --- a/src/librustc/mir/visit.rs +++ b/src/librustc/mir/visit.rs @@ -515,6 +515,7 @@ macro_rules! make_mir_visitor { Rvalue::Aggregate(ref $($mutability)* kind, ref $($mutability)* operands) => { + let kind = &$($mutability)* **kind; match *kind { AggregateKind::Array(ref $($mutability)* ty) => { self.visit_ty(ty); diff --git a/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs b/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs index ca313622a3afd..7ba8aba9a58c1 100644 --- a/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs +++ b/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs @@ -517,11 +517,11 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> { } fn constant_bool(&self, span: Span, val: bool) -> Rvalue<'tcx> { - Rvalue::Use(Operand::Constant(Constant { + Rvalue::Use(Operand::Constant(Box::new(Constant { span: span, ty: self.tcx.types.bool, literal: Literal::Value { value: ConstVal::Bool(val) } - })) + }))) } fn set_drop_flag(&mut self, loc: Location, path: MovePathIndex, val: DropFlagState) { diff --git a/src/librustc_mir/build/cfg.rs b/src/librustc_mir/build/cfg.rs index c503b8c7fe06f..40a78933aad2d 100644 --- a/src/librustc_mir/build/cfg.rs +++ b/src/librustc_mir/build/cfg.rs @@ -60,7 +60,7 @@ impl<'tcx> CFG<'tcx> { temp: &Lvalue<'tcx>, constant: Constant<'tcx>) { self.push_assign(block, source_info, temp, - Rvalue::Use(Operand::Constant(constant))); + Rvalue::Use(Operand::Constant(box constant))); } pub fn push_assign_unit(&mut self, @@ -68,7 +68,7 @@ impl<'tcx> CFG<'tcx> { source_info: SourceInfo, lvalue: &Lvalue<'tcx>) { self.push_assign(block, source_info, lvalue, Rvalue::Aggregate( - AggregateKind::Tuple, vec![] + box AggregateKind::Tuple, vec![] )); } diff --git a/src/librustc_mir/build/expr/as_operand.rs b/src/librustc_mir/build/expr/as_operand.rs index 8d79e755685d0..a368021443292 100644 --- a/src/librustc_mir/build/expr/as_operand.rs +++ b/src/librustc_mir/build/expr/as_operand.rs @@ -66,7 +66,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { match category { Category::Constant => { let constant = this.as_constant(expr); - block.and(Operand::Constant(constant)) + block.and(Operand::Constant(box constant)) } Category::Lvalue | Category::Rvalue(..) => { diff --git a/src/librustc_mir/build/expr/as_rvalue.rs b/src/librustc_mir/build/expr/as_rvalue.rs index fb547332c5f58..7b29cd970d7d4 100644 --- a/src/librustc_mir/build/expr/as_rvalue.rs +++ b/src/librustc_mir/build/expr/as_rvalue.rs @@ -166,7 +166,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { .map(|f| unpack!(block = this.as_operand(block, scope, f))) .collect(); - block.and(Rvalue::Aggregate(AggregateKind::Array(el_ty), fields)) + block.and(Rvalue::Aggregate(box AggregateKind::Array(el_ty), fields)) } ExprKind::Tuple { fields } => { // see (*) above // first process the set of fields @@ -175,14 +175,14 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { .map(|f| unpack!(block = this.as_operand(block, scope, f))) .collect(); - block.and(Rvalue::Aggregate(AggregateKind::Tuple, fields)) + block.and(Rvalue::Aggregate(box AggregateKind::Tuple, fields)) } ExprKind::Closure { closure_id, substs, upvars } => { // see (*) above let upvars = upvars.into_iter() .map(|upvar| unpack!(block = this.as_operand(block, scope, upvar))) .collect(); - block.and(Rvalue::Aggregate(AggregateKind::Closure(closure_id, substs), upvars)) + block.and(Rvalue::Aggregate(box AggregateKind::Closure(closure_id, substs), upvars)) } ExprKind::Adt { adt_def, variant_index, substs, fields, base @@ -215,7 +215,8 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { field_names.iter().filter_map(|n| fields_map.get(n).cloned()).collect() }; - let adt = AggregateKind::Adt(adt_def, variant_index, substs, active_field_index); + let adt = + box AggregateKind::Adt(adt_def, variant_index, substs, active_field_index); block.and(Rvalue::Aggregate(adt, fields)) } ExprKind::Assign { .. } | diff --git a/src/librustc_mir/build/expr/stmt.rs b/src/librustc_mir/build/expr/stmt.rs index c03432312b0ab..3c7ab373651d2 100644 --- a/src/librustc_mir/build/expr/stmt.rs +++ b/src/librustc_mir/build/expr/stmt.rs @@ -129,7 +129,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { this.cfg.push(block, Statement { source_info: source_info, kind: StatementKind::InlineAsm { - asm: asm.clone(), + asm: box asm.clone(), outputs: outputs, inputs: inputs }, diff --git a/src/librustc_mir/build/matches/test.rs b/src/librustc_mir/build/matches/test.rs index 0833342927fec..28386fa598ce6 100644 --- a/src/librustc_mir/build/matches/test.rs +++ b/src/librustc_mir/build/matches/test.rs @@ -308,7 +308,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { let eq_block = self.cfg.start_new_block(); let cleanup = self.diverge_cleanup(); self.cfg.terminate(block, source_info, TerminatorKind::Call { - func: Operand::Constant(Constant { + func: Operand::Constant(box Constant { span: test.span, ty: mty, literal: method diff --git a/src/librustc_mir/build/misc.rs b/src/librustc_mir/build/misc.rs index 35a8b245f2bb6..6c93e073de6b1 100644 --- a/src/librustc_mir/build/misc.rs +++ b/src/librustc_mir/build/misc.rs @@ -40,7 +40,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { ty: Ty<'tcx>, literal: Literal<'tcx>) -> Operand<'tcx> { - let constant = Constant { + let constant = box Constant { span: span, ty: ty, literal: literal, @@ -49,7 +49,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { } pub fn unit_rvalue(&mut self) -> Rvalue<'tcx> { - Rvalue::Aggregate(AggregateKind::Tuple, vec![]) + Rvalue::Aggregate(box AggregateKind::Tuple, vec![]) } // Returns a zero literal operand for the appropriate type, works for diff --git a/src/librustc_mir/build/scope.rs b/src/librustc_mir/build/scope.rs index dd4190a412dac..333283ec71f0c 100644 --- a/src/librustc_mir/build/scope.rs +++ b/src/librustc_mir/build/scope.rs @@ -782,7 +782,7 @@ fn build_free<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>, let free_func = tcx.require_lang_item(lang_items::BoxFreeFnLangItem); let substs = tcx.intern_substs(&[Kind::from(data.item_ty)]); TerminatorKind::Call { - func: Operand::Constant(Constant { + func: Operand::Constant(box Constant { span: data.span, ty: tcx.item_type(free_func).subst(tcx, substs), literal: Literal::Value { diff --git a/src/librustc_mir/shim.rs b/src/librustc_mir/shim.rs index 7f7377e5ffe3f..f2aaa3e484bdf 100644 --- a/src/librustc_mir/shim.rs +++ b/src/librustc_mir/shim.rs @@ -330,7 +330,7 @@ fn build_call_shim<'a, 'tcx>(tcx: ty::TyCtxt<'a, 'tcx, 'tcx>, let (callee, mut args) = match call_kind { CallKind::Indirect => (rcvr, vec![]), CallKind::Direct(def_id) => ( - Operand::Constant(Constant { + Operand::Constant(box Constant { span: span, ty: tcx.item_type(def_id).subst(tcx, param_env.free_substs), literal: Literal::Value { @@ -456,7 +456,7 @@ pub fn build_adt_ctor<'a, 'gcx, 'tcx>(infcx: &infer::InferCtxt<'a, 'gcx, 'tcx>, kind: StatementKind::Assign( Lvalue::Local(RETURN_POINTER), Rvalue::Aggregate( - AggregateKind::Adt(adt_def, variant_no, substs, None), + box AggregateKind::Adt(adt_def, variant_no, substs, None), (1..sig.inputs().len()+1).map(|i| { Operand::Consume(Lvalue::Local(Local::new(i))) }).collect() diff --git a/src/librustc_mir/transform/copy_prop.rs b/src/librustc_mir/transform/copy_prop.rs index 5d127a5aed461..42df8186f9a66 100644 --- a/src/librustc_mir/transform/copy_prop.rs +++ b/src/librustc_mir/transform/copy_prop.rs @@ -318,7 +318,7 @@ impl<'tcx> MutVisitor<'tcx> for ConstantPropagationVisitor<'tcx> { _ => return, } - *operand = Operand::Constant(self.constant.clone()); + *operand = Operand::Constant(box self.constant.clone()); self.uses_replaced += 1 } } diff --git a/src/librustc_mir/transform/deaggregator.rs b/src/librustc_mir/transform/deaggregator.rs index 3a93bef36c5f7..cc8058317e306 100644 --- a/src/librustc_mir/transform/deaggregator.rs +++ b/src/librustc_mir/transform/deaggregator.rs @@ -49,8 +49,8 @@ impl<'tcx> MirPass<'tcx> for Deaggregator { &Rvalue::Aggregate(ref agg_kind, ref operands) => (agg_kind, operands), _ => span_bug!(src_info.span, "expected aggregate, not {:?}", rhs), }; - let (adt_def, variant, substs) = match agg_kind { - &AggregateKind::Adt(adt_def, variant, substs, None) + let (adt_def, variant, substs) = match **agg_kind { + AggregateKind::Adt(adt_def, variant, substs, None) => (adt_def, variant, substs), _ => span_bug!(src_info.span, "expected struct, not {:?}", rhs), }; @@ -114,8 +114,8 @@ fn get_aggregate_statement_index<'a, 'tcx, 'b>(start: usize, &Rvalue::Aggregate(ref kind, ref operands) => (kind, operands), _ => continue, }; - let (adt_def, variant) = match kind { - &AggregateKind::Adt(adt_def, variant, _, None) => (adt_def, variant), + let (adt_def, variant) = match **kind { + AggregateKind::Adt(adt_def, variant, _, None) => (adt_def, variant), _ => continue, }; if operands.len() == 0 { diff --git a/src/librustc_mir/transform/promote_consts.rs b/src/librustc_mir/transform/promote_consts.rs index ed9a0d3809f24..e1c4602b045eb 100644 --- a/src/librustc_mir/transform/promote_consts.rs +++ b/src/librustc_mir/transform/promote_consts.rs @@ -230,7 +230,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { (if self.keep_original { rhs.clone() } else { - let unit = Rvalue::Aggregate(AggregateKind::Tuple, vec![]); + let unit = Rvalue::Aggregate(box AggregateKind::Tuple, vec![]); mem::replace(rhs, unit) }, statement.source_info) }; @@ -288,7 +288,7 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { fn promote_candidate(mut self, candidate: Candidate) { let span = self.promoted.span; - let new_operand = Operand::Constant(Constant { + let new_operand = Operand::Constant(box Constant { span: span, ty: self.promoted.return_ty, literal: Literal::Promoted { diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index 526c1488ab480..afdecbfd4a9e8 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -733,7 +733,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> { } Rvalue::Aggregate(ref kind, _) => { - if let AggregateKind::Adt(def, ..) = *kind { + if let AggregateKind::Adt(def, ..) = **kind { if def.has_dtor(self.tcx) { self.add(Qualif::NEEDS_DROP); self.deny_drop(); diff --git a/src/librustc_mir/transform/simplify_branches.rs b/src/librustc_mir/transform/simplify_branches.rs index 3d5106c4b06f7..613eb01953c9f 100644 --- a/src/librustc_mir/transform/simplify_branches.rs +++ b/src/librustc_mir/transform/simplify_branches.rs @@ -30,7 +30,7 @@ impl<'l, 'tcx> MirPass<'tcx> for SimplifyBranches<'l> { for block in mir.basic_blocks_mut() { let terminator = block.terminator_mut(); terminator.kind = match terminator.kind { - TerminatorKind::SwitchInt { discr: Operand::Constant(Constant { + TerminatorKind::SwitchInt { discr: Operand::Constant(box Constant { literal: Literal::Value { ref value }, .. }), ref values, ref targets, .. } => { if let Some(ref constint) = value.to_const_int() { @@ -47,7 +47,7 @@ impl<'l, 'tcx> MirPass<'tcx> for SimplifyBranches<'l> { continue } }, - TerminatorKind::Assert { target, cond: Operand::Constant(Constant { + TerminatorKind::Assert { target, cond: Operand::Constant(box Constant { literal: Literal::Value { value: ConstVal::Bool(cond) }, .. @@ -67,4 +67,4 @@ impl<'l> Pass for SimplifyBranches<'l> { // avoid calling `type_name` - it contains `<'static>` fn name(&self) -> ::std::borrow::Cow<'static, str> { "SimplifyBranches".into() } -} +} \ No newline at end of file diff --git a/src/librustc_mir/transform/type_check.rs b/src/librustc_mir/transform/type_check.rs index bfb08de56d8bb..48f83a4a685cf 100644 --- a/src/librustc_mir/transform/type_check.rs +++ b/src/librustc_mir/transform/type_check.rs @@ -534,7 +534,7 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { fn is_box_free(&self, operand: &Operand<'tcx>) -> bool { match operand { - &Operand::Constant(Constant { + &Operand::Constant(box Constant { literal: Literal::Value { value: ConstVal::Function(def_id, _), .. }, .. diff --git a/src/librustc_passes/mir_stats.rs b/src/librustc_passes/mir_stats.rs index ce02cb0e83643..ed6838325d3ed 100644 --- a/src/librustc_passes/mir_stats.rs +++ b/src/librustc_passes/mir_stats.rs @@ -190,7 +190,7 @@ impl<'a, 'tcx> mir_visit::Visitor<'tcx> for StatCollector<'a, 'tcx> { Rvalue::Aggregate(ref kind, ref _operands) => { // AggregateKind is not distinguished by visit API, so // record it. (`super_rvalue` handles `_operands`.) - self.record(match *kind { + self.record(match **kind { AggregateKind::Array(_) => "AggregateKind::Array", AggregateKind::Tuple => "AggregateKind::Tuple", AggregateKind::Adt(..) => "AggregateKind::Adt", diff --git a/src/librustc_trans/mir/analyze.rs b/src/librustc_trans/mir/analyze.rs index 889f9dc4cded5..96ef26d3f6f83 100644 --- a/src/librustc_trans/mir/analyze.rs +++ b/src/librustc_trans/mir/analyze.rs @@ -108,7 +108,7 @@ impl<'mir, 'a, 'tcx> Visitor<'tcx> for LocalAnalyzer<'mir, 'a, 'tcx> { location: Location) { match *kind { mir::TerminatorKind::Call { - func: mir::Operand::Constant(mir::Constant { + func: mir::Operand::Constant(box mir::Constant { literal: Literal::Value { value: ConstVal::Function(def_id, _), .. }, .. diff --git a/src/librustc_trans/mir/constant.rs b/src/librustc_trans/mir/constant.rs index 040194e63d07e..6ba00c7e10331 100644 --- a/src/librustc_trans/mir/constant.rs +++ b/src/librustc_trans/mir/constant.rs @@ -537,7 +537,7 @@ impl<'a, 'tcx> MirConstContext<'a, 'tcx> { } failure?; - match *kind { + match **kind { mir::AggregateKind::Array(_) => { self.const_array(dest_ty, &fields) } diff --git a/src/librustc_trans/mir/rvalue.rs b/src/librustc_trans/mir/rvalue.rs index b8e9a490b0e7c..667075e6970e1 100644 --- a/src/librustc_trans/mir/rvalue.rs +++ b/src/librustc_trans/mir/rvalue.rs @@ -104,7 +104,7 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> { } mir::Rvalue::Aggregate(ref kind, ref operands) => { - match *kind { + match **kind { mir::AggregateKind::Adt(adt_def, variant_index, substs, active_field_index) => { let discr = adt_def.discriminant_for_variant(bcx.tcx(), variant_index) .to_u128_unchecked() as u64;