From 3a14e9e745460e55b149dad0d21cdb221545f184 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Sun, 26 Feb 2017 00:32:14 +0200 Subject: [PATCH 1/9] Make Rvalue::ty infallible --- src/librustc/mir/mod.rs | 5 ++- src/librustc/mir/tcx.rs | 42 +++++++++----------- src/librustc/mir/visit.rs | 3 +- src/librustc_mir/build/expr/as_rvalue.rs | 3 +- src/librustc_mir/transform/qualify_consts.rs | 2 +- src/librustc_mir/transform/type_check.rs | 15 +++---- src/librustc_passes/mir_stats.rs | 2 +- src/librustc_trans/mir/constant.rs | 2 +- src/librustc_trans/mir/rvalue.rs | 2 +- 9 files changed, 34 insertions(+), 42 deletions(-) diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index 40ebc97a78a6c..ae60be7aa4b0e 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -1038,7 +1038,8 @@ pub enum CastKind { #[derive(Clone, Debug, PartialEq, Eq, RustcEncodable, RustcDecodable)] pub enum AggregateKind<'tcx> { - Array, + /// The type is of the element + Array(Ty<'tcx>), Tuple, /// The second field is variant number (discriminant), it's equal to 0 /// for struct and union expressions. The fourth field is active field @@ -1135,7 +1136,7 @@ impl<'tcx> Debug for Rvalue<'tcx> { } match *kind { - AggregateKind::Array => write!(fmt, "{:?}", lvs), + AggregateKind::Array(_) => write!(fmt, "{:?}", lvs), AggregateKind::Tuple => { match lvs.len() { diff --git a/src/librustc/mir/tcx.rs b/src/librustc/mir/tcx.rs index 50a80305bee27..cfd53cfcddcd3 100644 --- a/src/librustc/mir/tcx.rs +++ b/src/librustc/mir/tcx.rs @@ -134,46 +134,45 @@ impl<'tcx> Lvalue<'tcx> { } impl<'tcx> Rvalue<'tcx> { - pub fn ty<'a, 'gcx>(&self, mir: &Mir<'tcx>, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Option> + pub fn ty<'a, 'gcx>(&self, mir: &Mir<'tcx>, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Ty<'tcx> { match *self { - Rvalue::Use(ref operand) => Some(operand.ty(mir, tcx)), + Rvalue::Use(ref operand) => operand.ty(mir, tcx), Rvalue::Repeat(ref operand, ref count) => { let op_ty = operand.ty(mir, tcx); let count = count.value.as_u64(tcx.sess.target.uint_type); assert_eq!(count as usize as u64, count); - Some(tcx.mk_array(op_ty, count as usize)) + tcx.mk_array(op_ty, count as usize) } Rvalue::Ref(reg, bk, ref lv) => { let lv_ty = lv.ty(mir, tcx).to_ty(tcx); - Some(tcx.mk_ref(reg, + tcx.mk_ref(reg, ty::TypeAndMut { ty: lv_ty, mutbl: bk.to_mutbl_lossy() } - )) + ) } - Rvalue::Len(..) => Some(tcx.types.usize), - Rvalue::Cast(.., ty) => Some(ty), + Rvalue::Len(..) => tcx.types.usize, + Rvalue::Cast(.., ty) => ty, Rvalue::BinaryOp(op, ref lhs, ref rhs) => { let lhs_ty = lhs.ty(mir, tcx); let rhs_ty = rhs.ty(mir, tcx); - Some(op.ty(tcx, lhs_ty, rhs_ty)) + op.ty(tcx, lhs_ty, rhs_ty) } Rvalue::CheckedBinaryOp(op, ref lhs, ref rhs) => { let lhs_ty = lhs.ty(mir, tcx); let rhs_ty = rhs.ty(mir, tcx); let ty = op.ty(tcx, lhs_ty, rhs_ty); - let ty = tcx.intern_tup(&[ty, tcx.types.bool], false); - Some(ty) + tcx.intern_tup(&[ty, tcx.types.bool], false) } Rvalue::UnaryOp(_, ref operand) => { - Some(operand.ty(mir, tcx)) + operand.ty(mir, tcx) } Rvalue::Discriminant(ref lval) => { let ty = lval.ty(mir, tcx).to_ty(tcx); if let ty::TyAdt(adt_def, _) = ty.sty { - Some(adt_def.repr.discr_type().to_ty(tcx)) + adt_def.repr.discr_type().to_ty(tcx) } else { // Undefined behaviour, bug for now; may want to return something for // the `discriminant` intrinsic later. @@ -181,29 +180,24 @@ impl<'tcx> Rvalue<'tcx> { } } Rvalue::Box(t) => { - Some(tcx.mk_box(t)) + tcx.mk_box(t) } Rvalue::Aggregate(ref ak, ref ops) => { match *ak { - AggregateKind::Array => { - if let Some(operand) = ops.get(0) { - let ty = operand.ty(mir, tcx); - Some(tcx.mk_array(ty, ops.len())) - } else { - None - } + AggregateKind::Array(ty) => { + tcx.mk_array(ty, ops.len()) } AggregateKind::Tuple => { - Some(tcx.mk_tup( + tcx.mk_tup( ops.iter().map(|op| op.ty(mir, tcx)), false - )) + ) } AggregateKind::Adt(def, _, substs, _) => { - Some(tcx.item_type(def.did).subst(tcx, substs)) + tcx.item_type(def.did).subst(tcx, substs) } AggregateKind::Closure(did, substs) => { - Some(tcx.mk_closure_from_closure_substs(did, substs)) + tcx.mk_closure_from_closure_substs(did, substs) } } } diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs index 7cdbd5cae061f..34c69f5c2f7f4 100644 --- a/src/librustc/mir/visit.rs +++ b/src/librustc/mir/visit.rs @@ -515,7 +515,8 @@ macro_rules! make_mir_visitor { Rvalue::Aggregate(ref $($mutability)* kind, ref $($mutability)* operands) => { match *kind { - AggregateKind::Array => { + AggregateKind::Array(ref $($mutability)* ty) => { + self.visit_ty(ty); } AggregateKind::Tuple => { } diff --git a/src/librustc_mir/build/expr/as_rvalue.rs b/src/librustc_mir/build/expr/as_rvalue.rs index 7f5d9c36ecedf..7c3807a5edca5 100644 --- a/src/librustc_mir/build/expr/as_rvalue.rs +++ b/src/librustc_mir/build/expr/as_rvalue.rs @@ -148,12 +148,13 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { // to the same MIR as `let x = ();`. // first process the set of fields + let el_ty = expr.ty.sequence_element_type(this.hir.tcx()); let fields: Vec<_> = fields.into_iter() .map(|f| unpack!(block = this.as_operand(block, f))) .collect(); - block.and(Rvalue::Aggregate(AggregateKind::Array, fields)) + block.and(Rvalue::Aggregate(AggregateKind::Array(el_ty), fields)) } ExprKind::Tuple { fields } => { // see (*) above // first process the set of fields diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index 441a9add883dd..e998665e03536 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -752,7 +752,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> { } if Some(def.did) == self.tcx.lang_items.unsafe_cell_type() { - let ty = rvalue.ty(self.mir, self.tcx).unwrap(); + let ty = rvalue.ty(self.mir, self.tcx); self.add_type(ty); assert!(self.qualif.intersects(Qualif::MUTABLE_INTERIOR)); // Even if the value inside may not need dropping, diff --git a/src/librustc_mir/transform/type_check.rs b/src/librustc_mir/transform/type_check.rs index af4a4a53905eb..c99c4323bb8a1 100644 --- a/src/librustc_mir/transform/type_check.rs +++ b/src/librustc_mir/transform/type_check.rs @@ -83,9 +83,8 @@ impl<'a, 'b, 'gcx, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'gcx, 'tcx> { fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) { self.super_rvalue(rvalue, location); - if let Some(ty) = rvalue.ty(self.mir, self.tcx()) { - self.sanitize_type(rvalue, ty); - } + let rval_ty = rvalue.ty(self.mir, self.tcx()); + self.sanitize_type(rvalue, rval_ty); } fn visit_mir(&mut self, mir: &Mir<'tcx>) { @@ -356,14 +355,10 @@ impl<'a, 'gcx, 'tcx> TypeChecker<'a, 'gcx, 'tcx> { StatementKind::Assign(ref lv, ref rv) => { let lv_ty = lv.ty(mir, tcx).to_ty(tcx); let rv_ty = rv.ty(mir, tcx); - if let Some(rv_ty) = rv_ty { - if let Err(terr) = self.sub_types(rv_ty, lv_ty) { - span_mirbug!(self, stmt, "bad assignment ({:?} = {:?}): {:?}", - lv_ty, rv_ty, terr); - } + if let Err(terr) = self.sub_types(rv_ty, lv_ty) { + span_mirbug!(self, stmt, "bad assignment ({:?} = {:?}): {:?}", + lv_ty, rv_ty, terr); } - // FIXME: rvalue with undeterminable type - e.g. AggregateKind::Array branch that - // returns `None`. } StatementKind::SetDiscriminant{ ref lvalue, variant_index } => { let lvalue_type = lvalue.ty(mir, tcx).to_ty(tcx); diff --git a/src/librustc_passes/mir_stats.rs b/src/librustc_passes/mir_stats.rs index ad20c535decbb..88b0694560832 100644 --- a/src/librustc_passes/mir_stats.rs +++ b/src/librustc_passes/mir_stats.rs @@ -191,7 +191,7 @@ impl<'a, 'tcx> mir_visit::Visitor<'tcx> for StatCollector<'a, 'tcx> { // AggregateKind is not distinguished by visit API, so // record it. (`super_rvalue` handles `_operands`.) self.record(match *kind { - AggregateKind::Array => "AggregateKind::Array", + AggregateKind::Array(_) => "AggregateKind::Array", AggregateKind::Tuple => "AggregateKind::Tuple", AggregateKind::Adt(..) => "AggregateKind::Adt", AggregateKind::Closure(..) => "AggregateKind::Closure", diff --git a/src/librustc_trans/mir/constant.rs b/src/librustc_trans/mir/constant.rs index 771a5b7f366a1..d6c1b3f1a874a 100644 --- a/src/librustc_trans/mir/constant.rs +++ b/src/librustc_trans/mir/constant.rs @@ -548,7 +548,7 @@ impl<'a, 'tcx> MirConstContext<'a, 'tcx> { failure?; match *kind { - mir::AggregateKind::Array => { + mir::AggregateKind::Array(_) => { self.const_array(dest_ty, &fields) } mir::AggregateKind::Adt(..) | diff --git a/src/librustc_trans/mir/rvalue.rs b/src/librustc_trans/mir/rvalue.rs index 037c771c97b06..9a20683e8715f 100644 --- a/src/librustc_trans/mir/rvalue.rs +++ b/src/librustc_trans/mir/rvalue.rs @@ -435,7 +435,7 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> { mir::Rvalue::Discriminant(ref lvalue) => { let discr_lvalue = self.trans_lvalue(&bcx, lvalue); let enum_ty = discr_lvalue.ty.to_ty(bcx.tcx()); - let discr_ty = rvalue.ty(&*self.mir, bcx.tcx()).unwrap(); + let discr_ty = rvalue.ty(&*self.mir, bcx.tcx()); let discr_type = type_of::immediate_type_of(bcx.ccx, discr_ty); let discr = adt::trans_get_discr(&bcx, enum_ty, discr_lvalue.llval, discr_lvalue.alignment, Some(discr_type), true); From 21c61336bb9e327b90f4cb8e87a948be40eeafe5 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Sun, 26 Feb 2017 03:05:02 +0200 Subject: [PATCH 2/9] Remove the TypedConstVal Replace it with ConstUsize instead, which is more appropriate; we are not using the rest of the TypedConstVal anyway --- src/librustc/mir/mod.rs | 15 +-------------- src/librustc/mir/tcx.rs | 2 +- src/librustc/mir/visit.rs | 24 ++---------------------- src/librustc_mir/hair/cx/expr.rs | 6 +----- src/librustc_mir/hair/mod.rs | 5 +++-- src/librustc_passes/mir_stats.rs | 9 +-------- src/librustc_trans/mir/constant.rs | 2 +- src/librustc_trans/mir/rvalue.rs | 2 +- 8 files changed, 11 insertions(+), 54 deletions(-) diff --git a/src/librustc/mir/mod.rs b/src/librustc/mir/mod.rs index ae60be7aa4b0e..10761a03bec0c 100644 --- a/src/librustc/mir/mod.rs +++ b/src/librustc/mir/mod.rs @@ -983,7 +983,7 @@ pub enum Rvalue<'tcx> { Use(Operand<'tcx>), /// [x; 32] - Repeat(Operand<'tcx>, TypedConstVal<'tcx>), + Repeat(Operand<'tcx>, ConstUsize), /// &x or &mut x Ref(&'tcx Region, BorrowKind, Lvalue<'tcx>), @@ -1203,19 +1203,6 @@ pub struct Constant<'tcx> { pub literal: Literal<'tcx>, } -#[derive(Clone, RustcEncodable, RustcDecodable)] -pub struct TypedConstVal<'tcx> { - pub ty: Ty<'tcx>, - pub span: Span, - pub value: ConstUsize, -} - -impl<'tcx> Debug for TypedConstVal<'tcx> { - fn fmt(&self, fmt: &mut Formatter) -> fmt::Result { - write!(fmt, "const {}", ConstInt::Usize(self.value)) - } -} - newtype_index!(Promoted, "promoted"); #[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)] diff --git a/src/librustc/mir/tcx.rs b/src/librustc/mir/tcx.rs index cfd53cfcddcd3..14d3876a66e55 100644 --- a/src/librustc/mir/tcx.rs +++ b/src/librustc/mir/tcx.rs @@ -140,7 +140,7 @@ impl<'tcx> Rvalue<'tcx> { Rvalue::Use(ref operand) => operand.ty(mir, tcx), Rvalue::Repeat(ref operand, ref count) => { let op_ty = operand.ty(mir, tcx); - let count = count.value.as_u64(tcx.sess.target.uint_type); + let count = count.as_u64(tcx.sess.target.uint_type); assert_eq!(count as usize as u64, count); tcx.mk_array(op_ty, count as usize) } diff --git a/src/librustc/mir/visit.rs b/src/librustc/mir/visit.rs index 34c69f5c2f7f4..980d1806e78f8 100644 --- a/src/librustc/mir/visit.rs +++ b/src/librustc/mir/visit.rs @@ -235,12 +235,6 @@ macro_rules! make_mir_visitor { self.super_const_usize(const_usize); } - fn visit_typed_const_val(&mut self, - val: & $($mutability)* TypedConstVal<'tcx>, - location: Location) { - self.super_typed_const_val(val, location); - } - fn visit_local_decl(&mut self, local_decl: & $($mutability)* LocalDecl<'tcx>) { self.super_local_decl(local_decl); @@ -467,9 +461,9 @@ macro_rules! make_mir_visitor { } Rvalue::Repeat(ref $($mutability)* value, - ref $($mutability)* typed_const_val) => { + ref $($mutability)* length) => { self.visit_operand(value, location); - self.visit_typed_const_val(typed_const_val, location); + self.visit_const_usize(length, location); } Rvalue::Ref(r, bk, ref $($mutability)* path) => { @@ -648,20 +642,6 @@ macro_rules! make_mir_visitor { self.visit_literal(literal, location); } - fn super_typed_const_val(&mut self, - constant: & $($mutability)* TypedConstVal<'tcx>, - location: Location) { - let TypedConstVal { - ref $($mutability)* span, - ref $($mutability)* ty, - ref $($mutability)* value, - } = *constant; - - self.visit_span(span); - self.visit_ty(ty); - self.visit_const_usize(value, location); - } - fn super_literal(&mut self, literal: & $($mutability)* Literal<'tcx>, location: Location) { diff --git a/src/librustc_mir/hair/cx/expr.rs b/src/librustc_mir/hair/cx/expr.rs index f2b89309e4ab1..c67bb8ec6c585 100644 --- a/src/librustc_mir/hair/cx/expr.rs +++ b/src/librustc_mir/hair/cx/expr.rs @@ -602,11 +602,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>, ExprKind::Repeat { value: v.to_ref(), - count: TypedConstVal { - ty: cx.tcx.types.usize, - span: c.span, - value: count - } + count: count, } } hir::ExprRet(ref v) => ExprKind::Return { value: v.to_ref() }, diff --git a/src/librustc_mir/hair/mod.rs b/src/librustc_mir/hair/mod.rs index 9c7ee6a9ce883..2ee375dee08ac 100644 --- a/src/librustc_mir/hair/mod.rs +++ b/src/librustc_mir/hair/mod.rs @@ -14,7 +14,8 @@ //! unit-tested and separated from the Rust source and compiler data //! structures. -use rustc::mir::{BinOp, BorrowKind, Field, Literal, UnOp, TypedConstVal}; +use rustc_const_math::ConstUsize; +use rustc::mir::{BinOp, BorrowKind, Field, Literal, UnOp}; use rustc::hir::def_id::DefId; use rustc::middle::region::CodeExtent; use rustc::ty::subst::Substs; @@ -219,7 +220,7 @@ pub enum ExprKind<'tcx> { }, Repeat { value: ExprRef<'tcx>, - count: TypedConstVal<'tcx>, + count: ConstUsize, }, Array { fields: Vec>, diff --git a/src/librustc_passes/mir_stats.rs b/src/librustc_passes/mir_stats.rs index 88b0694560832..ce02cb0e83643 100644 --- a/src/librustc_passes/mir_stats.rs +++ b/src/librustc_passes/mir_stats.rs @@ -19,7 +19,7 @@ use rustc::mir::{Constant, Literal, Location, LocalDecl}; use rustc::mir::{Lvalue, LvalueElem, LvalueProjection}; use rustc::mir::{Mir, Operand, ProjectionElem}; use rustc::mir::{Rvalue, SourceInfo, Statement, StatementKind}; -use rustc::mir::{Terminator, TerminatorKind, TypedConstVal, VisibilityScope, VisibilityScopeData}; +use rustc::mir::{Terminator, TerminatorKind, VisibilityScope, VisibilityScopeData}; use rustc::mir::visit as mir_visit; use rustc::mir::visit::Visitor; use rustc::ty::{ClosureSubsts, TyCtxt}; @@ -297,13 +297,6 @@ impl<'a, 'tcx> mir_visit::Visitor<'tcx> for StatCollector<'a, 'tcx> { self.super_const_usize(const_usize); } - fn visit_typed_const_val(&mut self, - val: &TypedConstVal<'tcx>, - location: Location) { - self.record("TypedConstVal", val); - self.super_typed_const_val(val, location); - } - fn visit_local_decl(&mut self, local_decl: &LocalDecl<'tcx>) { self.record("LocalDecl", local_decl); diff --git a/src/librustc_trans/mir/constant.rs b/src/librustc_trans/mir/constant.rs index d6c1b3f1a874a..c524d8351e003 100644 --- a/src/librustc_trans/mir/constant.rs +++ b/src/librustc_trans/mir/constant.rs @@ -529,7 +529,7 @@ impl<'a, 'tcx> MirConstContext<'a, 'tcx> { mir::Rvalue::Repeat(ref elem, ref count) => { let elem = self.const_operand(elem, span)?; - let size = count.value.as_u64(tcx.sess.target.uint_type); + let size = count.as_u64(tcx.sess.target.uint_type); let fields = vec![elem.llval; size as usize]; self.const_array(dest_ty, &fields) } diff --git a/src/librustc_trans/mir/rvalue.rs b/src/librustc_trans/mir/rvalue.rs index 9a20683e8715f..b6af4e52e820b 100644 --- a/src/librustc_trans/mir/rvalue.rs +++ b/src/librustc_trans/mir/rvalue.rs @@ -95,7 +95,7 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> { mir::Rvalue::Repeat(ref elem, ref count) => { let tr_elem = self.trans_operand(&bcx, elem); - let size = count.value.as_u64(bcx.tcx().sess.target.uint_type); + let size = count.as_u64(bcx.tcx().sess.target.uint_type); let size = C_uint(bcx.ccx, size); let base = base::get_dataptr(&bcx, dest.llval); tvec::slice_for_each(&bcx, base, tr_elem.ty, size, |bcx, llslot| { From 2123d6a2785799fc3f32e972a0e548d37f883521 Mon Sep 17 00:00:00 2001 From: Theodore DeRego Date: Mon, 27 Feb 2017 20:26:55 -0800 Subject: [PATCH 3/9] std::process for fuchsia: updated to latest liblaunchpad --- src/libstd/sys/unix/process/magenta.rs | 22 ++++++++---- .../sys/unix/process/process_fuchsia.rs | 36 ++++++++----------- 2 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/libstd/sys/unix/process/magenta.rs b/src/libstd/sys/unix/process/magenta.rs index 08a827ce08142..07f29784df607 100644 --- a/src/libstd/sys/unix/process/magenta.rs +++ b/src/libstd/sys/unix/process/magenta.rs @@ -156,18 +156,18 @@ extern { pub fn launchpad_create(job: mx_handle_t, name: *const c_char, lp: *mut *mut launchpad_t) -> mx_status_t; - pub fn launchpad_start(lp: *mut launchpad_t) -> mx_status_t; + pub fn launchpad_go(lp: *mut launchpad_t, + proc_handle: *mut mx_handle_t, + err_msg: *mut *const c_char) -> mx_status_t; pub fn launchpad_destroy(lp: *mut launchpad_t); - pub fn launchpad_arguments(lp: *mut launchpad_t, argc: c_int, + pub fn launchpad_set_args(lp: *mut launchpad_t, argc: c_int, argv: *const *const c_char) -> mx_status_t; - pub fn launchpad_environ(lp: *mut launchpad_t, envp: *const *const c_char) -> mx_status_t; + pub fn launchpad_set_environ(lp: *mut launchpad_t, envp: *const *const c_char) -> mx_status_t; - pub fn launchpad_clone_mxio_root(lp: *mut launchpad_t) -> mx_status_t; - - pub fn launchpad_clone_mxio_cwd(lp: *mut launchpad_t) -> mx_status_t; + pub fn launchpad_clone(lp: *mut launchpad_t, what: u32) -> mx_status_t; pub fn launchpad_clone_fd(lp: *mut launchpad_t, fd: c_int, target_fd: c_int) -> mx_status_t; @@ -182,6 +182,16 @@ extern { pub fn launchpad_vmo_from_file(filename: *const c_char) -> mx_handle_t; } +// Launchpad clone constants + +pub const LP_CLONE_MXIO_ROOT: u32 = 0x0001; +pub const LP_CLONE_MXIO_CWD: u32 = 0x0002; +// LP_CLONE_MXIO_STDIO = 0x0004 +// LP_CLONE_MXIO_ALL = 0x00FF +// LP_CLONE_ENVIRON = 0x0100 +// LP_CLONE_DEFAULT_JOB = 0x0200 +// LP_CLONE_ALL = 0xFFFF + // Errors #[allow(unused)] pub const ERR_INTERNAL: mx_status_t = -1; diff --git a/src/libstd/sys/unix/process/process_fuchsia.rs b/src/libstd/sys/unix/process/process_fuchsia.rs index 608e44ca9e86e..7d583cb3dfce3 100644 --- a/src/libstd/sys/unix/process/process_fuchsia.rs +++ b/src/libstd/sys/unix/process/process_fuchsia.rs @@ -13,7 +13,7 @@ use libc; use mem; use ptr; -use sys::process::magenta::{Handle, launchpad_t, mx_handle_t}; +use sys::process::magenta::{Handle, mx_handle_t}; use sys::process::process_common::*; //////////////////////////////////////////////////////////////////////////////// @@ -30,9 +30,9 @@ impl Command { let (ours, theirs) = self.setup_io(default, needs_stdin)?; - let (launchpad, process_handle) = unsafe { self.do_exec(theirs)? }; + let process_handle = unsafe { self.do_exec(theirs)? }; - Ok((Process { launchpad: launchpad, handle: Handle::new(process_handle) }, ours)) + Ok((Process { handle: Handle::new(process_handle) }, ours)) } pub fn exec(&mut self, default: Stdio) -> io::Error { @@ -51,7 +51,7 @@ impl Command { } unsafe fn do_exec(&mut self, stdio: ChildPipes) - -> io::Result<(*mut launchpad_t, mx_handle_t)> { + -> io::Result { use sys::process::magenta::*; let job_handle = mx_job_default(); @@ -75,16 +75,15 @@ impl Command { let launchpad_destructor = LaunchpadDestructor(launchpad); // Set the process argv - mx_cvt(launchpad_arguments(launchpad, self.get_argv().len() as i32 - 1, - self.get_argv().as_ptr()))?; + mx_cvt(launchpad_set_args(launchpad, self.get_argv().len() as i32 - 1, + self.get_argv().as_ptr()))?; // Setup the environment vars - mx_cvt(launchpad_environ(launchpad, envp))?; + mx_cvt(launchpad_set_environ(launchpad, envp))?; mx_cvt(launchpad_add_vdso_vmo(launchpad))?; - mx_cvt(launchpad_clone_mxio_root(launchpad))?; // Load the executable mx_cvt(launchpad_elf_load(launchpad, launchpad_vmo_from_file(self.get_argv()[0])))?; mx_cvt(launchpad_load_vdso(launchpad, MX_HANDLE_INVALID))?; - mx_cvt(launchpad_clone_mxio_cwd(launchpad))?; + mx_cvt(launchpad_clone(launchpad, LP_CLONE_MXIO_ROOT | LP_CLONE_MXIO_CWD))?; // Clone stdin, stdout, and stderr if let Some(fd) = stdio.stdin.fd() { @@ -111,12 +110,15 @@ impl Command { callback()?; } - let process_handle = mx_cvt(launchpad_start(launchpad))?; - - // Successfully started the launchpad + // `launchpad_go` destroys the launchpad, so we must not mem::forget(launchpad_destructor); - Ok((launchpad, process_handle)) + let mut process_handle: mx_handle_t = 0; + let mut err_msg: *const libc::c_char = ptr::null(); + mx_cvt(launchpad_go(launchpad, &mut process_handle, &mut err_msg))?; + // FIXME: See if we want to do something with that err_msg + + Ok(process_handle) } } @@ -125,7 +127,6 @@ impl Command { //////////////////////////////////////////////////////////////////////////////// pub struct Process { - launchpad: *mut launchpad_t, handle: Handle, } @@ -195,10 +196,3 @@ impl Process { Ok(Some(ExitStatus::new(proc_info.rec.return_code))) } } - -impl Drop for Process { - fn drop(&mut self) { - use sys::process::magenta::launchpad_destroy; - unsafe { launchpad_destroy(self.launchpad); } - } -} From c58fff2bb76b055c8276551d54a99aea997c34ed Mon Sep 17 00:00:00 2001 From: Aidan Hobson Sayers Date: Tue, 28 Feb 2017 23:46:47 +0000 Subject: [PATCH 4/9] Allow types passed to [] to coerce, like .index() Fixes #40085 --- src/librustc_typeck/check/mod.rs | 2 +- src/test/run-pass/issue-40085.rs | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/test/run-pass/issue-40085.rs diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 9d963226caf4b..fbea34c95a6d7 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -3912,7 +3912,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let base_t = self.structurally_resolved_type(expr.span, base_t); match self.lookup_indexing(expr, base, base_t, idx_t, lvalue_pref) { Some((index_ty, element_ty)) => { - self.demand_eqtype(expr.span, index_ty, idx_t); + self.demand_coerce(idx, idx_t, index_ty); element_ty } None => { diff --git a/src/test/run-pass/issue-40085.rs b/src/test/run-pass/issue-40085.rs new file mode 100644 index 0000000000000..b6d02908a0f78 --- /dev/null +++ b/src/test/run-pass/issue-40085.rs @@ -0,0 +1,22 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +use std::ops::Index; +fn bar() {} +static UNIT: () = (); +struct S; +impl Index for S { + type Output = (); + fn index(&self, _: fn()) -> &() { &UNIT } +} +fn main() { + S.index(bar); + S[bar]; +} From 2fcbb48c727e82ea8751d6476d86fd3c6fe16b42 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Mon, 27 Feb 2017 12:03:19 -0800 Subject: [PATCH 5/9] Implement function-like procedural macros ( `#[proc_macro]`) --- src/libproc_macro/lib.rs | 4 ++ src/librustc_metadata/creader.rs | 11 +++- src/libsyntax/feature_gate.rs | 5 ++ src/libsyntax_ext/proc_macro_impl.rs | 35 ++++++++++ src/libsyntax_ext/proc_macro_registrar.rs | 66 ++++++++++++++++--- .../proc-macro/auxiliary/bang_proc_macro.rs | 23 +++++++ .../proc-macro/macro-use-bang.rs | 21 ++++++ .../proc-macro/resolve-error.rs | 12 ++++ .../proc-macro/auxiliary/bang-macro.rs | 26 ++++++++ .../proc-macro/bang-macro.rs | 20 ++++++ 10 files changed, 213 insertions(+), 10 deletions(-) create mode 100644 src/test/compile-fail-fulldeps/proc-macro/auxiliary/bang_proc_macro.rs create mode 100644 src/test/compile-fail-fulldeps/proc-macro/macro-use-bang.rs create mode 100644 src/test/run-pass-fulldeps/proc-macro/auxiliary/bang-macro.rs create mode 100644 src/test/run-pass-fulldeps/proc-macro/bang-macro.rs diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index f962c888f42cc..867fa48330de2 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -125,6 +125,10 @@ pub mod __internal { fn register_attr_proc_macro(&mut self, name: &str, expand: fn(TokenStream, TokenStream) -> TokenStream); + + fn register_bang_proc_macro(&mut self, + name: &str, + expand: fn(TokenStream) -> TokenStream); } // Emulate scoped_thread_local!() here essentially diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index 4477488f6cb38..49dcffb4830a1 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -586,7 +586,7 @@ impl<'a> CrateLoader<'a> { use proc_macro::__internal::Registry; use rustc_back::dynamic_lib::DynamicLibrary; use syntax_ext::deriving::custom::ProcMacroDerive; - use syntax_ext::proc_macro_impl::AttrProcMacro; + use syntax_ext::proc_macro_impl::{AttrProcMacro, BangProcMacro}; let path = match dylib { Some(dylib) => dylib, @@ -630,6 +630,15 @@ impl<'a> CrateLoader<'a> { ); self.0.push((Symbol::intern(name), Rc::new(expand))); } + + fn register_bang_proc_macro(&mut self, + name: &str, + expand: fn(TokenStream) -> TokenStream) { + let expand = SyntaxExtension::ProcMacro( + Box::new(BangProcMacro { inner: expand }) + ); + self.0.push((Symbol::intern(name), Rc::new(expand))); + } } let mut my_registrar = MyRegistrar(Vec::new()); diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index c2b72edb66c6c..7de50430184f6 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -763,6 +763,11 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG "attribute proc macros are currently unstable", cfg_fn!(proc_macro))), + ("proc_macro", Normal, Gated(Stability::Unstable, + "proc_macro", + "function-like proc macros are currently unstable", + cfg_fn!(proc_macro))), + ("rustc_derive_registrar", Normal, Gated(Stability::Unstable, "rustc_derive_registrar", "used internally by rustc", diff --git a/src/libsyntax_ext/proc_macro_impl.rs b/src/libsyntax_ext/proc_macro_impl.rs index b454628acb1c0..f60e5824db962 100644 --- a/src/libsyntax_ext/proc_macro_impl.rs +++ b/src/libsyntax_ext/proc_macro_impl.rs @@ -56,3 +56,38 @@ impl base::AttrProcMacro for AttrProcMacro { } } } + +pub struct BangProcMacro { + pub inner: fn(TsShim) -> TsShim, +} + +impl base::ProcMacro for BangProcMacro { + fn expand<'cx>(&self, + ecx: &'cx mut ExtCtxt, + span: Span, + input: TokenStream) + -> TokenStream { + let input = __internal::token_stream_wrap(input); + + let res = __internal::set_parse_sess(&ecx.parse_sess, || { + panic::catch_unwind(panic::AssertUnwindSafe(|| (self.inner)(input))) + }); + + match res { + Ok(stream) => __internal::token_stream_inner(stream), + Err(e) => { + let msg = "proc macro panicked"; + let mut err = ecx.struct_span_fatal(span, msg); + if let Some(s) = e.downcast_ref::() { + err.help(&format!("message: {}", s)); + } + if let Some(s) = e.downcast_ref::<&'static str>() { + err.help(&format!("message: {}", s)); + } + + err.emit(); + panic!(FatalError); + } + } + } +} diff --git a/src/libsyntax_ext/proc_macro_registrar.rs b/src/libsyntax_ext/proc_macro_registrar.rs index 325f09a83ddab..9c96ad547e1ae 100644 --- a/src/libsyntax_ext/proc_macro_registrar.rs +++ b/src/libsyntax_ext/proc_macro_registrar.rs @@ -27,6 +27,9 @@ use syntax_pos::{Span, DUMMY_SP}; use deriving; +const PROC_MACRO_KINDS: [&'static str; 3] = + ["proc_macro_derive", "proc_macro_attribute", "proc_macro"]; + struct ProcMacroDerive { trait_name: ast::Name, function_name: Ident, @@ -34,14 +37,15 @@ struct ProcMacroDerive { attrs: Vec, } -struct AttrProcMacro { +struct ProcMacroDef { function_name: Ident, span: Span, } struct CollectProcMacros<'a> { derives: Vec, - attr_macros: Vec, + attr_macros: Vec, + bang_macros: Vec, in_root: bool, handler: &'a errors::Handler, is_proc_macro_crate: bool, @@ -58,17 +62,18 @@ pub fn modify(sess: &ParseSess, let ecfg = ExpansionConfig::default("proc_macro".to_string()); let mut cx = ExtCtxt::new(sess, ecfg, resolver); - let (derives, attr_macros) = { + let (derives, attr_macros, bang_macros) = { let mut collect = CollectProcMacros { derives: Vec::new(), attr_macros: Vec::new(), + bang_macros: Vec::new(), in_root: true, handler: handler, is_proc_macro_crate: is_proc_macro_crate, is_test_crate: is_test_crate, }; visit::walk_crate(&mut collect, &krate); - (collect.derives, collect.attr_macros) + (collect.derives, collect.attr_macros, collect.bang_macros) }; if !is_proc_macro_crate { @@ -83,7 +88,7 @@ pub fn modify(sess: &ParseSess, return krate; } - krate.module.items.push(mk_registrar(&mut cx, &derives, &attr_macros)); + krate.module.items.push(mk_registrar(&mut cx, &derives, &attr_macros, &bang_macros)); if krate.exported_macros.len() > 0 { handler.err("cannot export macro_rules! macros from a `proc-macro` \ @@ -93,6 +98,10 @@ pub fn modify(sess: &ParseSess, return krate } +fn is_proc_macro_attr(attr: &ast::Attribute) -> bool { + PROC_MACRO_KINDS.iter().any(|kind| attr.check_name(kind)) +} + impl<'a> CollectProcMacros<'a> { fn check_not_pub_in_root(&self, vis: &ast::Visibility, sp: Span) { if self.is_proc_macro_crate && @@ -196,12 +205,12 @@ impl<'a> CollectProcMacros<'a> { fn collect_attr_proc_macro(&mut self, item: &'a ast::Item, attr: &'a ast::Attribute) { if let Some(_) = attr.meta_item_list() { self.handler.span_err(attr.span, "`#[proc_macro_attribute]` attribute - cannot contain any meta items"); + does not take any arguments"); return; } if self.in_root && item.vis == ast::Visibility::Public { - self.attr_macros.push(AttrProcMacro { + self.attr_macros.push(ProcMacroDef { span: item.span, function_name: item.ident, }); @@ -215,6 +224,29 @@ impl<'a> CollectProcMacros<'a> { self.handler.span_err(item.span, msg); } } + + fn collect_bang_proc_macro(&mut self, item: &'a ast::Item, attr: &'a ast::Attribute) { + if let Some(_) = attr.meta_item_list() { + self.handler.span_err(attr.span, "`#[proc_macro]` attribute + does not take any arguments"); + return; + } + + if self.in_root && item.vis == ast::Visibility::Public { + self.bang_macros.push(ProcMacroDef { + span: item.span, + function_name: item.ident, + }); + } else { + let msg = if !self.in_root { + "functions tagged with `#[proc_macro]` must \ + currently reside in the root of the crate" + } else { + "functions tagged with `#[proc_macro]` must be `pub`" + }; + self.handler.span_err(item.span, msg); + } + } } impl<'a> Visitor<'a> for CollectProcMacros<'a> { @@ -232,7 +264,7 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> { let mut found_attr: Option<&'a ast::Attribute> = None; for attr in &item.attrs { - if attr.check_name("proc_macro_derive") || attr.check_name("proc_macro_attribute") { + if is_proc_macro_attr(&attr) { if let Some(prev_attr) = found_attr { let msg = if attr.name() == prev_attr.name() { format!("Only one `#[{}]` attribute is allowed on any given function", @@ -285,6 +317,8 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> { self.collect_custom_derive(item, attr); } else if attr.check_name("proc_macro_attribute") { self.collect_attr_proc_macro(item, attr); + } else if attr.check_name("proc_macro") { + self.collect_bang_proc_macro(item, attr); }; visit::walk_item(self, item); @@ -320,7 +354,8 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> { // } fn mk_registrar(cx: &mut ExtCtxt, custom_derives: &[ProcMacroDerive], - custom_attrs: &[AttrProcMacro]) -> P { + custom_attrs: &[ProcMacroDef], + custom_macros: &[ProcMacroDef]) -> P { let eid = cx.codemap().record_expansion(ExpnInfo { call_site: DUMMY_SP, callee: NameAndSpan { @@ -342,6 +377,7 @@ fn mk_registrar(cx: &mut ExtCtxt, let registrar = Ident::from_str("registrar"); let register_custom_derive = Ident::from_str("register_custom_derive"); let register_attr_proc_macro = Ident::from_str("register_attr_proc_macro"); + let register_bang_proc_macro = Ident::from_str("register_bang_proc_macro"); let mut stmts = custom_derives.iter().map(|cd| { let path = cx.path_global(cd.span, vec![cd.function_name]); @@ -371,6 +407,18 @@ fn mk_registrar(cx: &mut ExtCtxt, vec![registrar, name, cx.expr_path(path)])) })); + stmts.extend(custom_macros.iter().map(|cm| { + let name = cx.expr_str(cm.span, cm.function_name.name); + let path = cx.path_global(cm.span, vec![cm.function_name]); + let registrar = cx.expr_ident(cm.span, registrar); + + let ufcs_path = cx.path(span, + vec![proc_macro, __internal, registry, register_bang_proc_macro]); + + cx.stmt_expr(cx.expr_call(span, cx.expr_path(ufcs_path), + vec![registrar, name, cx.expr_path(path)])) + })); + let path = cx.path(span, vec![proc_macro, __internal, registry]); let registrar_path = cx.ty_path(path); let arg_ty = cx.ty_rptr(span, registrar_path, None, ast::Mutability::Mutable); diff --git a/src/test/compile-fail-fulldeps/proc-macro/auxiliary/bang_proc_macro.rs b/src/test/compile-fail-fulldeps/proc-macro/auxiliary/bang_proc_macro.rs new file mode 100644 index 0000000000000..89ac11b309d75 --- /dev/null +++ b/src/test/compile-fail-fulldeps/proc-macro/auxiliary/bang_proc_macro.rs @@ -0,0 +1,23 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// force-host +// no-prefer-dynamic +#![feature(proc_macro)] +#![crate_type = "proc-macro"] + +extern crate proc_macro; + +use proc_macro::TokenStream; + +#[proc_macro] +pub fn bang_proc_macro(input: TokenStream) -> TokenStream { + input +} diff --git a/src/test/compile-fail-fulldeps/proc-macro/macro-use-bang.rs b/src/test/compile-fail-fulldeps/proc-macro/macro-use-bang.rs new file mode 100644 index 0000000000000..7ecc685357ee6 --- /dev/null +++ b/src/test/compile-fail-fulldeps/proc-macro/macro-use-bang.rs @@ -0,0 +1,21 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:bang_proc_macro.rs + +#![feature(proc_macro)] + +#[macro_use] +extern crate bang_proc_macro; + +fn main() { + bang_proc_macro!(println!("Hello, world!")); + //~^ ERROR: procedural macros cannot be imported with `#[macro_use]` +} diff --git a/src/test/compile-fail-fulldeps/proc-macro/resolve-error.rs b/src/test/compile-fail-fulldeps/proc-macro/resolve-error.rs index eac0be6f84874..e0066dd43be89 100644 --- a/src/test/compile-fail-fulldeps/proc-macro/resolve-error.rs +++ b/src/test/compile-fail-fulldeps/proc-macro/resolve-error.rs @@ -11,6 +11,7 @@ // aux-build:derive-foo.rs // aux-build:derive-clona.rs // aux-build:attr_proc_macro.rs +// aux-build:bang_proc_macro.rs #![feature(proc_macro)] @@ -19,13 +20,19 @@ extern crate derive_foo; #[macro_use] extern crate derive_clona; extern crate attr_proc_macro; +extern crate bang_proc_macro; use attr_proc_macro::attr_proc_macro; +use bang_proc_macro::bang_proc_macro; macro_rules! FooWithLongNam { () => {} } +macro_rules! attr_proc_mac { + () => {} +} + #[derive(FooWithLongNan)] //~^ ERROR cannot find derive macro `FooWithLongNan` in this scope //~^^ HELP did you mean `FooWithLongName`? @@ -61,7 +68,12 @@ fn main() { attr_proc_macra!(); //~^ ERROR cannot find macro `attr_proc_macra!` in this scope + //~^^ HELP did you mean `attr_proc_mac!`? Dlona!(); //~^ ERROR cannot find macro `Dlona!` in this scope + + bang_proc_macrp!(); + //~^ ERROR cannot find macro `bang_proc_macrp!` in this scope + //~^^ HELP did you mean `bang_proc_macro!`? } diff --git a/src/test/run-pass-fulldeps/proc-macro/auxiliary/bang-macro.rs b/src/test/run-pass-fulldeps/proc-macro/auxiliary/bang-macro.rs new file mode 100644 index 0000000000000..122a47aff7198 --- /dev/null +++ b/src/test/run-pass-fulldeps/proc-macro/auxiliary/bang-macro.rs @@ -0,0 +1,26 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// no-prefer-dynamic +#![feature(proc_macro)] +#![crate_type = "proc-macro"] + +extern crate proc_macro; + +use proc_macro::TokenStream; + +#[proc_macro] +pub fn rewrite(input: TokenStream) -> TokenStream { + let input = input.to_string(); + + assert_eq!(input, r#""Hello, world!""#); + + r#""NOT Hello, world!""#.parse().unwrap() +} diff --git a/src/test/run-pass-fulldeps/proc-macro/bang-macro.rs b/src/test/run-pass-fulldeps/proc-macro/bang-macro.rs new file mode 100644 index 0000000000000..531bd0dd3569d --- /dev/null +++ b/src/test/run-pass-fulldeps/proc-macro/bang-macro.rs @@ -0,0 +1,20 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:bang-macro.rs + +#![feature(proc_macro)] + +extern crate bang_macro; +use bang_macro::rewrite; + +fn main() { + assert_eq!(rewrite!("Hello, world!"), "NOT Hello, world!"); +} From f6304e12281ed03f4123de6352d4bd7bbff6e0dd Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 15 Feb 2017 14:55:26 -0800 Subject: [PATCH 6/9] Add Cargo as a submodule --- .gitmodules | 3 + src/Cargo.lock | 632 ++++++++++++++++++++++++++++++++- src/Cargo.toml | 1 + src/tools/cargo | 1 + src/tools/cargotest/Cargo.toml | 2 +- 5 files changed, 625 insertions(+), 14 deletions(-) create mode 160000 src/tools/cargo diff --git a/.gitmodules b/.gitmodules index 86c5c780c5eb2..2beff77267efa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,3 +18,6 @@ [submodule "src/liblibc"] path = src/liblibc url = https://github.com/rust-lang/libc.git +[submodule "src/tools/cargo"] + path = src/tools/cargo + url = https://github.com/rust-lang/cargo diff --git a/src/Cargo.lock b/src/Cargo.lock index 1fb5d34d13f5d..9a4fd3a1d5594 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -6,6 +6,23 @@ dependencies = [ "libc 0.0.0", ] +[[package]] +name = "advapi32-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "aho-corasick" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "aho-corasick" version = "0.6.2" @@ -73,6 +90,11 @@ dependencies = [ "toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bufstream" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "build-manifest" version = "0.1.0" @@ -88,9 +110,74 @@ dependencies = [ "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "cargo" +version = "0.18.0" +dependencies = [ + "advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bufstream 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cargotest 0.1.0", + "crates-io 0.7.0", + "crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", + "fs2 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "git2-curl 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "hamcrest 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "handlebars 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cargotest" version = "0.1.0" +dependencies = [ + "bufstream 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "cargo 0.18.0", + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hamcrest 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cargotest2" +version = "0.1.0" + +[[package]] +name = "cfg-if" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "clap" @@ -101,7 +188,7 @@ dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term_size 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "term_size 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -146,6 +233,56 @@ dependencies = [ name = "core" version = "0.0.0" +[[package]] +name = "crates-io" +version = "0.7.0" +dependencies = [ + "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "curl" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "curl-sys 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "curl-sys" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "docopt" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "dtoa" version = "0.4.1" @@ -188,15 +325,48 @@ dependencies = [ "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "flate2" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fmt_macros" version = "0.0.0" +[[package]] +name = "foreign-types" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fs2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gcc" version = "0.3.43" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "gdi32-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "getopts" version = "0.0.0" @@ -206,13 +376,51 @@ name = "getopts" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "git2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "git2-curl" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "glob" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "graphviz" version = "0.0.0" +[[package]] +name = "hamcrest" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "handlebars" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -221,7 +429,17 @@ dependencies = [ "quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -255,6 +473,43 @@ name = "libc" version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "libgit2-sys" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "curl-sys 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "libssh2-sys 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libssh2-sys" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libz-sys" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "linkchecker" version = "0.1.0" @@ -268,6 +523,11 @@ name = "log" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "matches" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "mdbook" version = "0.0.17" @@ -275,16 +535,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "handlebars 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)", + "handlebars 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "pulldown-cmark 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "memchr" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "memchr" version = "1.0.1" @@ -293,6 +561,99 @@ dependencies = [ "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "miniz-sys" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "net2" +version = "0.2.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-complex 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-bigint" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-complex" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-integer" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-iter" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-rational" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "num-traits" version = "0.1.36" @@ -306,11 +667,48 @@ dependencies = [ "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "num_cpus" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "open" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "openssl" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl-probe" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl-sys" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", + "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "panic_abort" version = "0.0.0" @@ -334,6 +732,11 @@ name = "pest" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "pkg-config" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "proc_macro" version = "0.0.0" @@ -350,6 +753,15 @@ dependencies = [ "syntax_pos 0.0.0", ] +[[package]] +name = "psapi-sys" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pulldown-cmark" version = "0.0.8" @@ -379,6 +791,26 @@ dependencies = [ "core 0.0.0", ] +[[package]] +name = "rand" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "regex" version = "0.2.1" @@ -387,10 +819,15 @@ dependencies = [ "aho-corasick 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "thread_local 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "regex-syntax" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "regex-syntax" version = "0.4.0" @@ -767,6 +1204,19 @@ dependencies = [ "syntax_pos 0.0.0", ] +[[package]] +name = "semver" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "serde" version = "0.9.7" @@ -774,7 +1224,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_json" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -787,6 +1237,11 @@ dependencies = [ name = "serialize" version = "0.0.0" +[[package]] +name = "shell-escape" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "std" version = "0.0.0" @@ -854,13 +1309,39 @@ dependencies = [ "serialize 0.0.0", ] +[[package]] +name = "tar" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tempdir" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "term" version = "0.0.0" +[[package]] +name = "term" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "term_size" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -876,6 +1357,15 @@ dependencies = [ "term 0.0.0", ] +[[package]] +name = "thread-id" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "thread-id" version = "3.0.0" @@ -887,7 +1377,15 @@ dependencies = [ [[package]] name = "thread_local" -version = "0.3.2" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -906,6 +1404,14 @@ dependencies = [ "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "toml" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "toml" version = "0.3.0" @@ -914,6 +1420,19 @@ dependencies = [ "serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "unicode-bidi" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unicode-segmentation" version = "1.1.0" @@ -932,6 +1451,29 @@ dependencies = [ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "url" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "user32-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "utf8-ranges" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "utf8-ranges" version = "1.0.0" @@ -957,49 +1499,113 @@ name = "winapi-build" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [metadata] +"checksum advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e06588080cb19d0acb6739808aafa5f26bfb2ca015b2b6370028b44cf7cb8a9a" +"checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" "checksum aho-corasick 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0638fd549427caa90c499814196d1b9e3725eb4d15d7339d6de073a680ed0ca2" "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" "checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" +"checksum bufstream 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b48dbe2ff0e98fa2f03377d204a9637d3c9816cd431bfe05a8abbd0ea11d074" +"checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" "checksum clap 2.20.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7db281b0520e97fbd15cd615dcd8f8bcad0c26f5f7d5effe705f090f39e9a758" "checksum cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "a3a6805df695087e7c1bcd9a82e03ad6fb864c8e67ac41b1348229ce5b7f0407" +"checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97" +"checksum curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c90e1240ef340dd4027ade439e5c7c2064dd9dc652682117bd50d1486a3add7b" +"checksum curl-sys 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d909dc402ae80b6f7b0118c039203436061b9d9a3ca5d2c2546d93e0a61aaa" +"checksum docopt 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ab32ea6e284d87987066f21a9e809a73c14720571ef34516f0890b3d355ccfd8" "checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" "checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f" "checksum env_logger 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "99971fb1b635fe7a0ee3c4d065845bb93cca80a23b5613b5613391ece5de4144" "checksum filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "5363ab8e4139b8568a6237db5248646e5a8a2f89bd5ccb02092182b11fd3e922" +"checksum flate2 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "d4e4d0c15ef829cbc1b7cda651746be19cceeb238be7b1049227b14891df9e25" +"checksum foreign-types 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e4056b9bd47f8ac5ba12be771f77a0dae796d1bbaaf5fd0b9c2d38b69b8a29d" +"checksum fs2 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "34edaee07555859dc13ca387e6ae05686bb4d0364c95d649b6dab959511f4baf" "checksum gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)" = "c07c758b972368e703a562686adb39125707cc1ef3399da8c019fc6c2498a75d" +"checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518" "checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" -"checksum handlebars 0.25.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b930077f1422bf853008047b55896efc1409744bfc9903f1eec1a58fcc7edeff" +"checksum git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "046ae03385257040b2a35e56d9669d950dd911ba2bf48202fbef73ee6aab27b2" +"checksum git2-curl 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "68676bc784bf0bef83278898929bf64a251e87c0340723d0b93fa096c9c5bf8e" +"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +"checksum hamcrest 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bf088f042a467089e9baa4972f57f9247e42a0cc549ba264c7a04fbb8ecb89d4" +"checksum handlebars 0.25.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b2249f6f0dc5a3bb2b3b1a8f797dfccbc4b053344d773d654ad565e51427d335" +"checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11" "checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6abe0ee2e758cd6bc8a2cd56726359007748fbf4128da998b65d0b70f881e19b" "checksum libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "684f330624d8c3784fb9558ca46c4ce488073a8d22450415c5eb4f4cfb0d11b5" +"checksum libgit2-sys 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "d951fd5eccae07c74e8c2c1075b05ea1e43be7f8952245af8c2840d1480b1d95" +"checksum libssh2-sys 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "91e135645c2e198a39552c8c7686bb5b83b1b99f64831c040a6c2798a1195934" +"checksum libz-sys 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e5ee912a45d686d393d5ac87fac15ba0ba18daae14e8e7543c63ebf7fb7e970c" "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" "checksum mdbook 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "dbba458ca886cb082d026afd704eeeeb0531f7e4ffd6c619f72dc309c1c18fe4" +"checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" +"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" +"checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" +"checksum miow 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3a78d2605eb97302c10cf944b8d96b0a2a890c52957caf92fcd1f24f69049579" +"checksum net2 0.2.26 (registry+https://github.com/rust-lang/crates.io-index)" = "5edf9cb6be97212423aed9413dd4729d62b370b5e1c571750e882cebbbc1e3e2" +"checksum num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "bde7c03b09e7c6a301ee81f6ddf66d7a28ec305699e3d3b056d2fc56470e3120" +"checksum num-bigint 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "88b14378471f7c2adc5262f05b4701ef53e8da376453a8d8fee48e51db745e49" +"checksum num-complex 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c78e054dd19c3fd03419ade63fa661e9c49bb890ce3beb4eee5b7baf93f92f" +"checksum num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "fb24d9bfb3f222010df27995441ded1e954f8f69cd35021f6bef02ca9552fb92" +"checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c" +"checksum num-rational 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "54ff603b8334a72fbb27fe66948aac0abaaa40231b3cecd189e76162f6f38aaf" "checksum num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "a16a42856a256b39c6d3484f097f6713e14feacd9bfb02290917904fae46c81c" "checksum num_cpus 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "cee7e88156f3f9e19bdd598f8d6c9db7bf4078f99f8381f43a55b09648d1a6e3" +"checksum num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a225d1e2717567599c24f88e49f00856c6e825a12125181ee42c4257e3688d39" "checksum open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3478ed1686bd1300c8a981a940abc92b06fac9cbef747f4c668d4e032ff7b842" +"checksum openssl 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f9871ecf7629da3760599e3e547d35940cff3cead49159b49f81cd1250f24f1d" +"checksum openssl-probe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "756d49c8424483a3df3b5d735112b4da22109ced9a8294f1f5cdf80fb3810919" +"checksum openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5dd48381e9e8a6dce9c4c402db143b2e243f5f872354532f7a009c289b3998ca" "checksum pest 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0a6dda33d67c26f0aac90d324ab2eb7239c819fc7b2552fe9faa4fe88441edc8" +"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" +"checksum psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "abcd5d1a07d360e29727f757a9decb3ce8bc6e0efa8969cfaad669a8317a2478" "checksum pulldown-cmark 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1058d7bb927ca067656537eec4e02c2b4b70eaaa129664c5b90c111e20326f41" "checksum quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0aad603e8d7fb67da22dbdf1f4b826ce8829e406124109e73cf1b2454b93a71c" +"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" +"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" "checksum regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4278c17d0f6d62dfef0ab00028feb45bd7d2102843f80763474eeb1be8a10c01" +"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" "checksum regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9191b1f57603095f105d317e375d19b1c9c5c3185ea9633a99a6dcbed04457" "checksum rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "237546c689f20bb44980270c73c3b9edd0891c1be49cc1274406134a66d3957b" +"checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0ed773960f90a78567fcfbe935284adf50c5d7cf119aa2cf43bb0b4afa69bb" -"checksum serde_json 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e095e4e94e7382b76f48e93bd845ffddda62df8dfd4c163b1bfa93d40e22e13a" +"checksum serde_json 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb96d30e4e6f9fc52e08f51176d078b6f79b981dc3ed4134f7b850be9f446a8" +"checksum shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "dd5cc96481d54583947bfe88bf30c23d53f883c6cd0145368b69989d97b84ef8" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" -"checksum term_size 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "71662702fe5cd2cf95edd4ad655eea42f24a87a0e44059cbaa4e55260b7bc331" +"checksum tar 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "1eb3bf6ec92843ca93f4fcfb5fc6dfe30534815b147885db4b5759b8e2ff7d52" +"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" +"checksum term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989" +"checksum term_size 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "07b6c1ac5b3fffd75073276bca1ceed01f67a28537097a2a9539e116e50fb21a" +"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" "checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a" -"checksum thread_local 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7793b722f0f77ce716e7f1acf416359ca32ff24d04ffbac4269f44a4a83be05d" +"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" +"checksum thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c85048c6260d17cf486ceae3282d9fb6b90be220bf5b28c400f5485ffc29f0c7" "checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796" +"checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4" "checksum toml 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08272367dd2e766db3fa38f068067d17aa6a9dfd7259af24b3927db92f1e0c2f" +"checksum unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3a078ebdd62c0e71a709c3d53d2af693fe09fe93fbff8344aebe289b78f9032" +"checksum unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e28fa37426fceeb5cf8f41ee273faa7c82c47dc8fba5853402841e665fcd86ff" "checksum unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18127285758f0e2c6cf325bb3f3d138a12fee27de4f23e146cd6a179f26c2cf3" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" "checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" +"checksum url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5ba8a749fb4479b043733416c244fa9d1d3af3d7c23804944651c8a448cb87e" +"checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47" +"checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" "checksum vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac5efe5cb0fa14ec2f84f83c701c562ee63f6dcc680861b21d65c682adfb05f" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" diff --git a/src/Cargo.toml b/src/Cargo.toml index 0dafbb8428e3e..c5ca80accbf02 100644 --- a/src/Cargo.toml +++ b/src/Cargo.toml @@ -13,6 +13,7 @@ members = [ "tools/build-manifest", "tools/qemu-test-client", "tools/qemu-test-server", + "tools/cargo", ] # Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit diff --git a/src/tools/cargo b/src/tools/cargo new file mode 160000 index 0000000000000..6ed5a43bb566e --- /dev/null +++ b/src/tools/cargo @@ -0,0 +1 @@ +Subproject commit 6ed5a43bb566e0ee3fe7981de5aa5a36e2905ebd diff --git a/src/tools/cargotest/Cargo.toml b/src/tools/cargotest/Cargo.toml index 8108c7f762eeb..f4163a6f1170a 100644 --- a/src/tools/cargotest/Cargo.toml +++ b/src/tools/cargotest/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "cargotest" +name = "cargotest2" version = "0.1.0" authors = ["Brian Anderson "] From f2017f4561852bf65c39fc498cf035a5f385a065 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sun, 26 Feb 2017 19:42:11 +0100 Subject: [PATCH 7/9] Panic on errors in `format!` or `::to_string` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … instead of silently ignoring a result. `fmt::Write for String` never returns `Err`, so implementations of `Display` (or other traits of that family) never should either. Fixes #40103 --- src/libcollections/fmt.rs | 3 ++- src/libcollections/macros.rs | 6 ++++++ src/libcollections/string.rs | 9 ++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/libcollections/fmt.rs b/src/libcollections/fmt.rs index 079541235a25e..dfd292176d2f9 100644 --- a/src/libcollections/fmt.rs +++ b/src/libcollections/fmt.rs @@ -524,6 +524,7 @@ use string; pub fn format(args: Arguments) -> string::String { let capacity = args.estimated_capacity(); let mut output = string::String::with_capacity(capacity); - let _ = output.write_fmt(args); + output.write_fmt(args) + .expect("a formatting trait implementation returned an error"); output } diff --git a/src/libcollections/macros.rs b/src/libcollections/macros.rs index 3115be00a4d72..396a917dfde26 100644 --- a/src/libcollections/macros.rs +++ b/src/libcollections/macros.rs @@ -72,6 +72,12 @@ macro_rules! vec { /// /// [fmt]: ../std/fmt/index.html /// +/// # Panics +/// +/// `format!` panics if a formatting trait implementation returns an error. +/// This indicates an incorrect implementation +/// since `fmt::Write for String` never returns an error itself. +/// /// # Examples /// /// ``` diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 10bc5ab88c93f..a8942619cea16 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -1888,13 +1888,20 @@ pub trait ToString { fn to_string(&self) -> String; } +/// # Panics +/// +/// In this implementation, the `to_string` method panics +/// if the `Display` implementation returns an error. +/// This indicates an incorrect `Display` implementation +/// since `fmt::Write for String` never returns an error itself. #[stable(feature = "rust1", since = "1.0.0")] impl ToString for T { #[inline] default fn to_string(&self) -> String { use core::fmt::Write; let mut buf = String::new(); - let _ = buf.write_fmt(format_args!("{}", self)); + buf.write_fmt(format_args!("{}", self)) + .expect("a Display implementation return an error unexpectedly"); buf.shrink_to_fit(); buf } From f121f651b43071cf429f8039641c21a2130cc03a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 15 Feb 2017 15:57:06 -0800 Subject: [PATCH 8/9] rustbuild: Add support for compiling Cargo This commit adds support to rustbuild for compiling Cargo as part of the release process. Previously rustbuild would simply download a Cargo snapshot and repackage it. With this change we should be able to turn off artifacts from the rust-lang/cargo repository and purely rely on the artifacts Cargo produces here. The infrastructure added here is intended to be extensible to other components, such as the RLS. It won't exactly be a one-line addition, but the addition of Cargo didn't require too much hooplah anyway. The process for release Cargo will now look like: * The rust-lang/rust repository has a Cargo submodule which is used to build a Cargo to pair with the rust-lang/rust release * Periodically we'll update the cargo submodule as necessary on rust-lang/rust's master branch * When branching beta we'll create a new branch of Cargo (as we do today), and the first commit to the beta branch will be to update the Cargo submodule to this exact revision. * When branching stable, we'll ensure that the Cargo submodule is updated and then make a stable release. Backports to Cargo will look like: * Send a PR to cargo's master branch * Send a PR to cargo's release branch (e.g. rust-1.16.0) * Send a PR to rust-lang/rust's beta branch updating the submodule * Eventually send a PR to rust-lang/rust's master branch updating the submodule For reference, the process to add a new component to the rust-lang/rust release would look like: * Add `$foo` as a submodule in `src/tools` * Add a `tool-$foo` step which compiles `$foo` with the specified compiler, likely mirroring what Cargo does. * Add a `dist-$foo` step which uses `src/tools/$foo` and the `tool-$foo` output to create a rust-installer package for `$foo` likely mirroring what Cargo does. * Update the `dist-extended` step with a new dependency on `dist-$foo` * Update `src/tools/build-manifest` for the new component. --- configure | 1 + src/Cargo.lock | 84 +++++++++++++--- src/bootstrap/channel.rs | 95 ++++++++++--------- src/bootstrap/compile.rs | 34 +++++-- src/bootstrap/config.rs | 4 + src/bootstrap/config.toml.example | 5 + src/bootstrap/dist.rs | 134 ++++++++++++++------------ src/bootstrap/doc.rs | 9 +- src/bootstrap/install.rs | 4 +- src/bootstrap/lib.rs | 137 ++++++++++++++++++++++----- src/bootstrap/metadata.rs | 2 + src/bootstrap/native.rs | 93 ++++++++++++++++++ src/bootstrap/step.rs | 22 ++++- src/build_helper/lib.rs | 18 ++++ src/ci/run.sh | 1 + src/tools/build-manifest/src/main.rs | 19 ++-- src/tools/cargo | 2 +- src/tools/tidy/src/cargo.rs | 2 +- src/tools/tidy/src/deps.rs | 2 + src/tools/tidy/src/main.rs | 1 + 20 files changed, 504 insertions(+), 165 deletions(-) diff --git a/configure b/configure index 70952438a3559..be8628de62832 100755 --- a/configure +++ b/configure @@ -651,6 +651,7 @@ opt locked-deps 0 "force Cargo.lock to be up to date" opt vendor 0 "enable usage of vendored Rust crates" opt sanitizers 0 "build the sanitizer runtimes (asan, lsan, msan, tsan)" opt dist-src 1 "when building tarballs enables building a source tarball" +opt cargo-openssl-static 0 "static openssl in cargo" # Optimization and debugging options. These may be overridden by the release channel, etc. opt_nosave optimize 1 "build optimized rust code" diff --git a/src/Cargo.lock b/src/Cargo.lock index 9a4fd3a1d5594..c463f2bb747cc 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -140,11 +140,15 @@ dependencies = [ "psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_ignored 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", "shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -163,6 +167,8 @@ dependencies = [ "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -238,7 +244,9 @@ name = "crates-io" version = "0.7.0" dependencies = [ "curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -784,6 +792,11 @@ name = "quick-error" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "quote" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "rand" version = "0.0.0" @@ -1222,6 +1235,32 @@ name = "serde" version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "serde_codegen_internals" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen_internals 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_ignored" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "serde_json" version = "0.9.7" @@ -1278,6 +1317,24 @@ name = "strsim" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "syn" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "synom 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "synom" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syntax" version = "0.0.0" @@ -1404,14 +1461,6 @@ dependencies = [ "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "toml" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "toml" version = "0.3.0" @@ -1443,6 +1492,11 @@ name = "unicode-width" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unicode-xid" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "unreachable" version = "0.1.1" @@ -1547,8 +1601,8 @@ dependencies = [ "checksum libssh2-sys 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "91e135645c2e198a39552c8c7686bb5b83b1b99f64831c040a6c2798a1195934" "checksum libz-sys 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e5ee912a45d686d393d5ac87fac15ba0ba18daae14e8e7543c63ebf7fb7e970c" "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" -"checksum mdbook 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "dbba458ca886cb082d026afd704eeeeb0531f7e4ffd6c619f72dc309c1c18fe4" "checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" +"checksum mdbook 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "dbba458ca886cb082d026afd704eeeeb0531f7e4ffd6c619f72dc309c1c18fe4" "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" "checksum miniz-sys 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "28eaee17666671fa872e567547e8428e83308ebe5808cdf6a0e28397dbe2c726" @@ -1572,6 +1626,7 @@ dependencies = [ "checksum psapi-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "abcd5d1a07d360e29727f757a9decb3ce8bc6e0efa8969cfaad669a8317a2478" "checksum pulldown-cmark 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1058d7bb927ca067656537eec4e02c2b4b70eaaa129664c5b90c111e20326f41" "checksum quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0aad603e8d7fb67da22dbdf1f4b826ce8829e406124109e73cf1b2454b93a71c" +"checksum quote 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7375cf7ad34a92e8fd18dd9c42f58b9a11def59ab48bec955bf359a788335592" "checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" "checksum regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4278c17d0f6d62dfef0ab00028feb45bd7d2102843f80763474eeb1be8a10c01" @@ -1581,9 +1636,14 @@ dependencies = [ "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0ed773960f90a78567fcfbe935284adf50c5d7cf119aa2cf43bb0b4afa69bb" +"checksum serde_codegen_internals 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d52006899f910528a10631e5b727973fe668f3228109d1707ccf5bad5490b6e" +"checksum serde_derive 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "789ee9f3cd78c850948b94121020147f5220b47dafbf230d7098a93a58f726cf" +"checksum serde_ignored 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4b3f5576874721d14690657e9f0ed286e72a52be2f6fdc0cf2f024182bd8f64" "checksum serde_json 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb96d30e4e6f9fc52e08f51176d078b6f79b981dc3ed4134f7b850be9f446a8" "checksum shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "dd5cc96481d54583947bfe88bf30c23d53f883c6cd0145368b69989d97b84ef8" "checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" +"checksum syn 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)" = "37c279fb816210c9bb28b2c292664581e7b87b4561e86b94df462664d8620bb8" +"checksum synom 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "27e31aa4b09b9f4cb12dff3c30ba503e17b1a624413d764d32dab76e3920e5bc" "checksum tar 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "1eb3bf6ec92843ca93f4fcfb5fc6dfe30534815b147885db4b5759b8e2ff7d52" "checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" "checksum term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989" @@ -1593,12 +1653,12 @@ dependencies = [ "checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" "checksum thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c85048c6260d17cf486ceae3282d9fb6b90be220bf5b28c400f5485ffc29f0c7" "checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796" -"checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4" "checksum toml 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08272367dd2e766db3fa38f068067d17aa6a9dfd7259af24b3927db92f1e0c2f" "checksum unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3a078ebdd62c0e71a709c3d53d2af693fe09fe93fbff8344aebe289b78f9032" "checksum unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e28fa37426fceeb5cf8f41ee273faa7c82c47dc8fba5853402841e665fcd86ff" "checksum unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18127285758f0e2c6cf325bb3f3d138a12fee27de4f23e146cd6a179f26c2cf3" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" +"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" "checksum url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5ba8a749fb4479b043733416c244fa9d1d3af3d7c23804944651c8a448cb87e" "checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47" diff --git a/src/bootstrap/channel.rs b/src/bootstrap/channel.rs index 81e745bc76c9e..c126c076a3d4e 100644 --- a/src/bootstrap/channel.rs +++ b/src/bootstrap/channel.rs @@ -15,6 +15,7 @@ //! `package_vers`, and otherwise indicating to the compiler what it should //! print out as part of its version information. +use std::path::Path; use std::process::Command; use build_helper::output; @@ -22,65 +23,69 @@ use build_helper::output; use Build; // The version number -const CFG_RELEASE_NUM: &'static str = "1.17.0"; +pub const CFG_RELEASE_NUM: &'static str = "1.17.0"; // An optional number to put after the label, e.g. '.2' -> '-beta.2' // Be sure to make this starts with a dot to conform to semver pre-release // versions (section 9) -const CFG_PRERELEASE_VERSION: &'static str = ".1"; +pub const CFG_PRERELEASE_VERSION: &'static str = ".1"; -pub fn collect(build: &mut Build) { - build.release_num = CFG_RELEASE_NUM.to_string(); - build.prerelease_version = CFG_RELEASE_NUM.to_string(); +pub struct GitInfo { + inner: Option, +} - // Depending on the channel, passed in `./configure --release-channel`, - // determine various properties of the build. - match &build.config.channel[..] { - "stable" => { - build.release = CFG_RELEASE_NUM.to_string(); - build.package_vers = build.release.clone(); - build.unstable_features = false; - } - "beta" => { - build.release = format!("{}-beta{}", CFG_RELEASE_NUM, - CFG_PRERELEASE_VERSION); - build.package_vers = "beta".to_string(); - build.unstable_features = false; - } - "nightly" => { - build.release = format!("{}-nightly", CFG_RELEASE_NUM); - build.package_vers = "nightly".to_string(); - build.unstable_features = true; - } - _ => { - build.release = format!("{}-dev", CFG_RELEASE_NUM); - build.package_vers = build.release.clone(); - build.unstable_features = true; - } - } - build.version = build.release.clone(); +struct Info { + commit_date: String, + sha: String, + short_sha: String, +} - // If we have a git directory, add in some various SHA information of what - // commit this compiler was compiled from. - if build.src.join(".git").is_dir() { - let ver_date = output(Command::new("git").current_dir(&build.src) +impl GitInfo { + pub fn new(dir: &Path) -> GitInfo { + if !dir.join(".git").is_dir() { + return GitInfo { inner: None } + } + let ver_date = output(Command::new("git").current_dir(dir) .arg("log").arg("-1") .arg("--date=short") .arg("--pretty=format:%cd")); - let ver_hash = output(Command::new("git").current_dir(&build.src) + let ver_hash = output(Command::new("git").current_dir(dir) .arg("rev-parse").arg("HEAD")); let short_ver_hash = output(Command::new("git") - .current_dir(&build.src) + .current_dir(dir) .arg("rev-parse") .arg("--short=9") .arg("HEAD")); - let ver_date = ver_date.trim().to_string(); - let ver_hash = ver_hash.trim().to_string(); - let short_ver_hash = short_ver_hash.trim().to_string(); - build.version.push_str(&format!(" ({} {})", short_ver_hash, - ver_date)); - build.ver_date = Some(ver_date.to_string()); - build.ver_hash = Some(ver_hash); - build.short_ver_hash = Some(short_ver_hash); + GitInfo { + inner: Some(Info { + commit_date: ver_date.trim().to_string(), + sha: ver_hash.trim().to_string(), + short_sha: short_ver_hash.trim().to_string(), + }), + } + } + + pub fn sha(&self) -> Option<&str> { + self.inner.as_ref().map(|s| &s.sha[..]) + } + + pub fn sha_short(&self) -> Option<&str> { + self.inner.as_ref().map(|s| &s.short_sha[..]) + } + + pub fn commit_date(&self) -> Option<&str> { + self.inner.as_ref().map(|s| &s.commit_date[..]) + } + + pub fn version(&self, build: &Build, num: &str) -> String { + let mut version = build.release(num); + if let Some(ref inner) = self.inner { + version.push_str(" ("); + version.push_str(&inner.short_sha); + version.push_str(" "); + version.push_str(&inner.commit_date); + version.push_str(")"); + } + return version } } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index cea8b13366657..46d8d4b4aab2d 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -24,6 +24,7 @@ use std::process::Command; use build_helper::{output, mtime, up_to_date}; use filetime::FileTime; +use channel::GitInfo; use util::{exe, libdir, is_dylib, copy}; use {Build, Compiler, Mode}; @@ -210,9 +211,9 @@ pub fn rustc(build: &Build, target: &str, compiler: &Compiler) { // Set some configuration variables picked up by build scripts and // the compiler alike - cargo.env("CFG_RELEASE", &build.release) + cargo.env("CFG_RELEASE", build.rust_release()) .env("CFG_RELEASE_CHANNEL", &build.config.channel) - .env("CFG_VERSION", &build.version) + .env("CFG_VERSION", build.rust_version()) .env("CFG_PREFIX", build.config.prefix.clone().unwrap_or(PathBuf::new())); if compiler.stage == 0 { @@ -229,13 +230,13 @@ pub fn rustc(build: &Build, target: &str, compiler: &Compiler) { cargo.env_remove("RUSTC_DEBUGINFO_LINES"); } - if let Some(ref ver_date) = build.ver_date { + if let Some(ref ver_date) = build.rust_info.commit_date() { cargo.env("CFG_VER_DATE", ver_date); } - if let Some(ref ver_hash) = build.ver_hash { + if let Some(ref ver_hash) = build.rust_info.sha() { cargo.env("CFG_VER_HASH", ver_hash); } - if !build.unstable_features { + if !build.unstable_features() { cargo.env("CFG_DISABLE_UNSTABLE_FEATURES", "1"); } // Flag that rust llvm is in use @@ -416,13 +417,32 @@ pub fn tool(build: &Build, stage: u32, target: &str, tool: &str) { // build.clear_if_dirty(&out_dir, &libstd_stamp(build, stage, &host, target)); let mut cargo = build.cargo(&compiler, Mode::Tool, target, "build"); - cargo.arg("--manifest-path") - .arg(build.src.join(format!("src/tools/{}/Cargo.toml", tool))); + let dir = build.src.join("src/tools").join(tool); + cargo.arg("--manifest-path").arg(dir.join("Cargo.toml")); // We don't want to build tools dynamically as they'll be running across // stages and such and it's just easier if they're not dynamically linked. cargo.env("RUSTC_NO_PREFER_DYNAMIC", "1"); + if let Some(dir) = build.openssl_install_dir(target) { + cargo.env("OPENSSL_STATIC", "1"); + cargo.env("OPENSSL_DIR", dir); + cargo.env("LIBZ_SYS_STATIC", "1"); + } + + cargo.env("CFG_RELEASE_CHANNEL", &build.config.channel); + + let info = GitInfo::new(&dir); + if let Some(sha) = info.sha() { + cargo.env("CFG_COMMIT_HASH", sha); + } + if let Some(sha_short) = info.sha_short() { + cargo.env("CFG_SHORT_COMMIT_HASH", sha_short); + } + if let Some(date) = info.commit_date() { + cargo.env("CFG_COMMIT_DATE", date); + } + build.run(&mut cargo); } diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 8308dc3202fff..438ce6103d624 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -106,6 +106,7 @@ pub struct Config { pub gdb: Option, pub python: Option, pub configure_args: Vec, + pub openssl_static: bool, } /// Per-target configuration stored in the global configuration structure. @@ -155,6 +156,7 @@ struct Build { extended: Option, verbose: Option, sanitizers: Option, + openssl_static: Option, } /// TOML representation of various global install decisions. @@ -305,6 +307,7 @@ impl Config { set(&mut config.extended, build.extended); set(&mut config.verbose, build.verbose); set(&mut config.sanitizers, build.sanitizers); + set(&mut config.openssl_static, build.openssl_static); if let Some(ref install) = toml.install { config.prefix = install.prefix.clone().map(PathBuf::from); @@ -453,6 +456,7 @@ impl Config { ("EXTENDED", self.extended), ("SANITIZERS", self.sanitizers), ("DIST_SRC", self.rust_dist_src), + ("CARGO_OPENSSL_STATIC", self.openssl_static), } match key { diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example index f95e890f346ee..30763e38a336f 100644 --- a/src/bootstrap/config.toml.example +++ b/src/bootstrap/config.toml.example @@ -134,6 +134,11 @@ # Build the sanitizer runtimes #sanitizers = false +# Indicates whether the OpenSSL linked into Cargo will be statically linked or +# not. If static linkage is specified then the build system will download a +# known-good version of OpenSSL, compile it, and link it to Cargo. +#openssl-static = false + # ============================================================================= # General install configuration options # ============================================================================= diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index c468d4896a614..67e4dad83ce88 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -33,19 +33,12 @@ const SH_CMD: &'static str = "sh"; const SH_CMD: &'static str = "bash"; use {Build, Compiler, Mode}; -use util::{cp_r, libdir, is_dylib, cp_filtered, copy}; - -pub fn package_vers(build: &Build) -> &str { - match &build.config.channel[..] { - "stable" => &build.release, - "beta" => "beta", - "nightly" => "nightly", - _ => &build.release, - } -} +use channel; +use util::{cp_r, libdir, is_dylib, cp_filtered, copy, exe}; fn pkgname(build: &Build, component: &str) -> String { - format!("{}-{}", component, package_vers(build)) + assert!(component.starts_with("rust")); // does not work with cargo + format!("{}-{}", component, build.rust_package_vers()) } fn distdir(build: &Build) -> PathBuf { @@ -93,7 +86,7 @@ pub fn docs(build: &Build, stage: u32, host: &str) { // As part of this step, *also* copy the docs directory to a directory which // buildbot typically uploads. if host == build.config.build { - let dst = distdir(build).join("doc").join(&build.package_vers); + let dst = distdir(build).join("doc").join(build.rust_package_vers()); t!(fs::create_dir_all(&dst)); cp_r(&src, &dst); } @@ -162,7 +155,7 @@ pub fn rustc(build: &Build, stage: u32, host: &str) { cp("LICENSE-MIT"); cp("README.md"); // tiny morsel of metadata is used by rust-packaging - let version = &build.version; + let version = build.rust_version(); t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes())); // On MinGW we've got a few runtime DLL dependencies that we need to @@ -312,7 +305,7 @@ pub fn std(build: &Build, compiler: &Compiler, target: &str) { } pub fn rust_src_location(build: &Build) -> PathBuf { - let plain_name = format!("rustc-{}-src", package_vers(build)); + let plain_name = format!("rustc-{}-src", build.rust_package_vers()); distdir(build).join(&format!("{}.tar.gz", plain_name)) } @@ -477,14 +470,14 @@ pub fn rust_src(build: &Build) { build.run(&mut cmd); // Rename directory, so that root folder of tarball has the correct name - let plain_name = format!("rustc-{}-src", package_vers(build)); + let plain_name = format!("rustc-{}-src", build.rust_package_vers()); let plain_dst_src = tmpdir(build).join(&plain_name); let _ = fs::remove_dir_all(&plain_dst_src); t!(fs::create_dir_all(&plain_dst_src)); cp_r(&dst_src, &plain_dst_src); // Create the version file - write_file(&plain_dst_src.join("version"), build.version.as_bytes()); + write_file(&plain_dst_src.join("version"), build.rust_version().as_bytes()); // Create plain source tarball let mut cmd = Command::new("tar"); @@ -536,43 +529,64 @@ fn write_file(path: &Path, data: &[u8]) { t!(vf.write_all(data)); } -// FIXME(#38531) eventually this should package up a Cargo that we just compiled -// and tested locally, but for now we're downloading cargo -// artifacts from their compiled location. pub fn cargo(build: &Build, stage: u32, target: &str) { println!("Dist cargo stage{} ({})", stage, target); + let compiler = Compiler::new(stage, &build.config.build); - let branch = match &build.config.channel[..] { - "stable" | - "beta" => format!("rust-{}", build.release_num), - _ => "master".to_string(), - }; + let src = build.src.join("src/tools/cargo"); + let etc = src.join("src/etc"); + let release_num = &build.crates["cargo"].version; + let name = format!("cargo-{}", build.package_vers(release_num)); + let version = build.cargo_info.version(build, release_num); + + let tmp = tmpdir(build); + let image = tmp.join("cargo-image"); + drop(fs::remove_dir_all(&image)); + t!(fs::create_dir_all(&image)); - let dst = tmpdir(build).join("cargo"); - let _ = fs::remove_dir_all(&dst); - build.run(Command::new("git") - .arg("clone") - .arg("--depth").arg("1") - .arg("--branch").arg(&branch) - .arg("https://github.com/rust-lang/cargo") - .current_dir(dst.parent().unwrap())); - let sha = output(Command::new("git") - .arg("rev-parse") - .arg("HEAD") - .current_dir(&dst)); - let sha = sha.trim(); - println!("\tgot cargo sha: {}", sha); - - let input = format!("https://s3.amazonaws.com/rust-lang-ci/cargo-builds\ - /{}/cargo-nightly-{}.tar.gz", sha, target); - let output = distdir(build).join(format!("cargo-nightly-{}.tar.gz", target)); - println!("\tdownloading {}", input); - let mut curl = Command::new("curl"); - curl.arg("-f") - .arg("-o").arg(&output) - .arg(&input) - .arg("--retry").arg("3"); - build.run(&mut curl); + // Prepare the image directory + t!(fs::create_dir_all(image.join("share/zsh/site-functions"))); + t!(fs::create_dir_all(image.join("etc/bash_completions.d"))); + let cargo = build.cargo_out(&compiler, Mode::Tool, target) + .join(exe("cargo", target)); + install(&cargo, &image.join("bin"), 0o755); + for man in t!(etc.join("man").read_dir()) { + let man = t!(man); + install(&man.path(), &image.join("share/man/man1"), 0o644); + } + install(&etc.join("_cargo"), &image.join("share/zsh/site-functions"), 0o644); + copy(&etc.join("cargo.bashcomp.sh"), + &image.join("etc/bash_completions.d/cargo")); + let doc = image.join("share/doc/cargo"); + install(&src.join("README.md"), &doc, 0o644); + install(&src.join("LICENSE-MIT"), &doc, 0o644); + install(&src.join("LICENSE-APACHE"), &doc, 0o644); + install(&src.join("LICENSE-THIRD-PARTY"), &doc, 0o644); + + // Prepare the overlay + let overlay = tmp.join("cargo-overlay"); + drop(fs::remove_dir_all(&overlay)); + t!(fs::create_dir_all(&overlay)); + install(&src.join("README.md"), &overlay, 0o644); + install(&src.join("LICENSE-MIT"), &overlay, 0o644); + install(&src.join("LICENSE-APACHE"), &overlay, 0o644); + install(&src.join("LICENSE-THIRD-PARTY"), &overlay, 0o644); + t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes())); + + // Generate the installer tarball + let mut cmd = Command::new("sh"); + cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh"))) + .arg("--product-name=Rust") + .arg("--rel-manifest-dir=rustlib") + .arg("--success-message=Rust-is-ready-to-roll.") + .arg(format!("--image-dir={}", sanitize_sh(&image))) + .arg(format!("--work-dir={}", sanitize_sh(&tmpdir(build)))) + .arg(format!("--output-dir={}", sanitize_sh(&distdir(build)))) + .arg(format!("--non-installed-overlay={}", sanitize_sh(&overlay))) + .arg(format!("--package-name={}-{}", name, target)) + .arg("--component-name=cargo") + .arg("--legacy-manifest-dirs=rustlib,cargo"); + build.run(&mut cmd); } /// Creates a combined installer for the specified target in the provided stage. @@ -580,10 +594,13 @@ pub fn extended(build: &Build, stage: u32, target: &str) { println!("Dist extended stage{} ({})", stage, target); let dist = distdir(build); + let cargo_vers = &build.crates["cargo"].version; let rustc_installer = dist.join(format!("{}-{}.tar.gz", pkgname(build, "rustc"), target)); - let cargo_installer = dist.join(format!("cargo-nightly-{}.tar.gz", target)); + let cargo_installer = dist.join(format!("cargo-{}-{}.tar.gz", + build.package_vers(&cargo_vers), + target)); let docs_installer = dist.join(format!("{}-{}.tar.gz", pkgname(build, "rust-docs"), target)); @@ -603,7 +620,7 @@ pub fn extended(build: &Build, stage: u32, target: &str) { install(&build.src.join("COPYRIGHT"), &overlay, 0o644); install(&build.src.join("LICENSE-APACHE"), &overlay, 0o644); install(&build.src.join("LICENSE-MIT"), &overlay, 0o644); - let version = &build.version; + let version = build.rust_version(); t!(t!(File::create(overlay.join("version"))).write_all(version.as_bytes())); install(&etc.join("README.md"), &overlay, 0o644); @@ -876,16 +893,16 @@ pub fn extended(build: &Build, stage: u32, target: &str) { } fn add_env(build: &Build, cmd: &mut Command, target: &str) { - let mut parts = build.release_num.split('.'); - cmd.env("CFG_RELEASE_INFO", &build.version) - .env("CFG_RELEASE_NUM", &build.release_num) - .env("CFG_RELEASE", &build.release) - .env("CFG_PRERELEASE_VERSION", &build.prerelease_version) + let mut parts = channel::CFG_RELEASE_NUM.split('.'); + cmd.env("CFG_RELEASE_INFO", build.rust_version()) + .env("CFG_RELEASE_NUM", channel::CFG_RELEASE_NUM) + .env("CFG_RELEASE", build.rust_release()) + .env("CFG_PRERELEASE_VERSION", channel::CFG_PRERELEASE_VERSION) .env("CFG_VER_MAJOR", parts.next().unwrap()) .env("CFG_VER_MINOR", parts.next().unwrap()) .env("CFG_VER_PATCH", parts.next().unwrap()) .env("CFG_VER_BUILD", "0") // just needed to build - .env("CFG_PACKAGE_VERS", package_vers(build)) + .env("CFG_PACKAGE_VERS", build.rust_package_vers()) .env("CFG_PACKAGE_NAME", pkgname(build, "rust")) .env("CFG_BUILD", target) .env("CFG_CHANNEL", &build.config.channel); @@ -925,7 +942,8 @@ pub fn hash_and_sign(build: &Build) { cmd.arg(sign); cmd.arg(distdir(build)); cmd.arg(today.trim()); - cmd.arg(package_vers(build)); + cmd.arg(build.rust_package_vers()); + cmd.arg(build.cargo_info.version(build, &build.crates["cargo"].version)); cmd.arg(addr); t!(fs::create_dir_all(distdir(build))); diff --git a/src/bootstrap/doc.rs b/src/bootstrap/doc.rs index 5fd6570e1610c..d19e5b1b88456 100644 --- a/src/bootstrap/doc.rs +++ b/src/bootstrap/doc.rs @@ -77,12 +77,9 @@ pub fn standalone(build: &Build, target: &str) { if !up_to_date(&version_input, &version_info) { let mut info = String::new(); t!(t!(File::open(&version_input)).read_to_string(&mut info)); - let blank = String::new(); - let short = build.short_ver_hash.as_ref().unwrap_or(&blank); - let hash = build.ver_hash.as_ref().unwrap_or(&blank); - let info = info.replace("VERSION", &build.release) - .replace("SHORT_HASH", short) - .replace("STAMP", hash); + let info = info.replace("VERSION", &build.rust_release()) + .replace("SHORT_HASH", build.rust_info.sha_short().unwrap_or("")) + .replace("STAMP", build.rust_info.sha().unwrap_or("")); t!(t!(File::create(&version_info)).write_all(info.as_bytes())); } diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs index efc460f35838c..ba8442ebd8c37 100644 --- a/src/bootstrap/install.rs +++ b/src/bootstrap/install.rs @@ -19,7 +19,7 @@ use std::path::{Path, PathBuf, Component}; use std::process::Command; use Build; -use dist::{package_vers, sanitize_sh, tmpdir}; +use dist::{sanitize_sh, tmpdir}; /// Installs everything. pub fn install(build: &Build, stage: u32, host: &str) { @@ -59,7 +59,7 @@ pub fn install(build: &Build, stage: u32, host: &str) { fn install_sh(build: &Build, package: &str, name: &str, stage: u32, host: &str, prefix: &Path, docdir: &Path, libdir: &Path, mandir: &Path, empty_dir: &Path) { println!("Install {} stage{} ({})", package, stage, host); - let package_name = format!("{}-{}-{}", name, package_vers(build), host); + let package_name = format!("{}-{}-{}", name, build.rust_package_vers(), host); let mut cmd = Command::new("sh"); cmd.current_dir(empty_dir) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 2b34142b3b0f3..5215b281fac0b 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -84,7 +84,7 @@ use std::fs::{self, File}; use std::path::{Component, PathBuf, Path}; use std::process::Command; -use build_helper::{run_silent, output, mtime}; +use build_helper::{run_silent, run_suppressed, output, mtime}; use util::{exe, libdir, add_lib_path}; @@ -148,16 +148,9 @@ pub struct Build { rustc: PathBuf, src: PathBuf, out: PathBuf, - release: String, - unstable_features: bool, - ver_hash: Option, - short_ver_hash: Option, - ver_date: Option, - version: String, - package_vers: String, + rust_info: channel::GitInfo, + cargo_info: channel::GitInfo, local_rebuild: bool, - release_num: String, - prerelease_version: String, // Probed tools at runtime lldb_version: Option, @@ -173,6 +166,7 @@ pub struct Build { #[derive(Debug)] struct Crate { name: String, + version: String, deps: Vec, path: PathBuf, doc_step: String, @@ -236,6 +230,8 @@ impl Build { } None => false, }; + let rust_info = channel::GitInfo::new(&src); + let cargo_info = channel::GitInfo::new(&src.join("src/tools/cargo")); Build { flags: flags, @@ -245,22 +241,15 @@ impl Build { src: src, out: out, - release: String::new(), - unstable_features: false, - ver_hash: None, - short_ver_hash: None, - ver_date: None, - version: String::new(), + rust_info: rust_info, + cargo_info: cargo_info, local_rebuild: local_rebuild, - package_vers: String::new(), cc: HashMap::new(), cxx: HashMap::new(), crates: HashMap::new(), lldb_version: None, lldb_python_dir: None, is_sudo: is_sudo, - release_num: String::new(), - prerelease_version: String::new(), } } @@ -278,15 +267,14 @@ impl Build { cc::find(self); self.verbose("running sanity check"); sanity::check(self); - self.verbose("collecting channel variables"); - channel::collect(self); // If local-rust is the same major.minor as the current version, then force a local-rebuild let local_version_verbose = output( Command::new(&self.rustc).arg("--version").arg("--verbose")); let local_release = local_version_verbose .lines().filter(|x| x.starts_with("release:")) .next().unwrap().trim_left_matches("release:").trim(); - if local_release.split('.').take(2).eq(self.release.split('.').take(2)) { + let my_version = channel::CFG_RELEASE_NUM; + if local_release.split('.').take(2).eq(my_version.split('.').take(2)) { self.verbose(&format!("auto-detected local-rebuild {}", local_release)); self.local_rebuild = true; } @@ -478,10 +466,8 @@ impl Build { self.config.rust_codegen_units.to_string()) .env("RUSTC_DEBUG_ASSERTIONS", self.config.rust_debug_assertions.to_string()) - .env("RUSTC_SNAPSHOT", &self.rustc) .env("RUSTC_SYSROOT", self.sysroot(compiler)) .env("RUSTC_LIBDIR", self.rustc_libdir(compiler)) - .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_snapshot_libdir()) .env("RUSTC_RPATH", self.config.rust_rpath.to_string()) .env("RUSTDOC", self.out.join("bootstrap/debug/rustdoc")) .env("RUSTDOC_REAL", self.rustdoc(compiler)) @@ -491,6 +477,27 @@ impl Build { cargo.env("RUSTC_BOOTSTRAP", "1"); self.add_rust_test_threads(&mut cargo); + // Almost all of the crates that we compile as part of the bootstrap may + // have a build script, including the standard library. To compile a + // build script, however, it itself needs a standard library! This + // introduces a bit of a pickle when we're compiling the standard + // library itself. + // + // To work around this we actually end up using the snapshot compiler + // (stage0) for compiling build scripts of the standard library itself. + // The stage0 compiler is guaranteed to have a libstd available for use. + // + // For other crates, however, we know that we've already got a standard + // library up and running, so we can use the normal compiler to compile + // build scripts in that situation. + if let Mode::Libstd = mode { + cargo.env("RUSTC_SNAPSHOT", &self.rustc) + .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_snapshot_libdir()); + } else { + cargo.env("RUSTC_SNAPSHOT", self.compiler_path(compiler)) + .env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_libdir(compiler)); + } + // Ignore incremental modes except for stage0, since we're // not guaranteeing correctness acros builds if the compiler // is changing under your feet.` @@ -797,6 +804,12 @@ impl Build { run_silent(cmd) } + /// Runs a command, printing out nice contextual information if it fails. + fn run_quiet(&self, cmd: &mut Command) { + self.verbose(&format!("running: {:?}", cmd)); + run_suppressed(cmd) + } + /// Prints a message if this build is configured in verbose mode. fn verbose(&self, msg: &str) { if self.flags.verbose() || self.config.verbose() { @@ -914,6 +927,82 @@ impl Build { compiler.stage >= 2 && self.config.host.iter().any(|h| h == target) } + + /// Returns the directory that OpenSSL artifacts are compiled into if + /// configured to do so. + fn openssl_dir(&self, target: &str) -> Option { + // OpenSSL not used on Windows + if target.contains("windows") { + None + } else if self.config.openssl_static { + Some(self.out.join(target).join("openssl")) + } else { + None + } + } + + /// Returns the directory that OpenSSL artifacts are installed into if + /// configured as such. + fn openssl_install_dir(&self, target: &str) -> Option { + self.openssl_dir(target).map(|p| p.join("install")) + } + + /// Given `num` in the form "a.b.c" return a "release string" which + /// describes the release version number. + /// + /// For example on nightly this returns "a.b.c-nightly", on beta it returns + /// "a.b.c-beta.1" and on stable it just returns "a.b.c". + fn release(&self, num: &str) -> String { + match &self.config.channel[..] { + "stable" => num.to_string(), + "beta" => format!("{}-beta{}", num, channel::CFG_PRERELEASE_VERSION), + "nightly" => format!("{}-nightly", num), + _ => format!("{}-dev", num), + } + } + + /// Returns the value of `release` above for Rust itself. + fn rust_release(&self) -> String { + self.release(channel::CFG_RELEASE_NUM) + } + + /// Returns the "package version" for a component given the `num` release + /// number. + /// + /// The package version is typically what shows up in the names of tarballs. + /// For channels like beta/nightly it's just the channel name, otherwise + /// it's the `num` provided. + fn package_vers(&self, num: &str) -> String { + match &self.config.channel[..] { + "stable" => num.to_string(), + "beta" => "beta".to_string(), + "nightly" => "nightly".to_string(), + _ => format!("{}-dev", num), + } + } + + /// Returns the value of `package_vers` above for Rust itself. + fn rust_package_vers(&self) -> String { + self.package_vers(channel::CFG_RELEASE_NUM) + } + + /// Returns the `version` string associated with this compiler for Rust + /// itself. + /// + /// Note that this is a descriptive string which includes the commit date, + /// sha, version, etc. + fn rust_version(&self) -> String { + self.rust_info.version(self, channel::CFG_RELEASE_NUM) + } + + /// Returns whether unstable features should be enabled for the compiler + /// we're building. + fn unstable_features(&self) -> bool { + match &self.config.channel[..] { + "stable" | "beta" => false, + "nightly" | _ => true, + } + } } impl<'a> Compiler<'a> { diff --git a/src/bootstrap/metadata.rs b/src/bootstrap/metadata.rs index 5ab542b6a2489..5918fe41e7c8b 100644 --- a/src/bootstrap/metadata.rs +++ b/src/bootstrap/metadata.rs @@ -27,6 +27,7 @@ struct Output { struct Package { id: String, name: String, + version: String, source: Option, manifest_path: String, } @@ -72,6 +73,7 @@ fn build_krate(build: &mut Build, krate: &str) { test_step: format!("test-crate-{}", package.name), bench_step: format!("bench-crate-{}", package.name), name: package.name, + version: package.version, deps: Vec::new(), path: path, }); diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index f16fc2092f616..90e1530308f4a 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -191,3 +191,96 @@ pub fn test_helpers(build: &Build, target: &str) { .file(build.src.join("src/rt/rust_test_helpers.c")) .compile("librust_test_helpers.a"); } +const OPENSSL_VERS: &'static str = "1.0.2k"; +const OPENSSL_SHA256: &'static str = + "6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0"; + +pub fn openssl(build: &Build, target: &str) { + let out = match build.openssl_dir(target) { + Some(dir) => dir, + None => return, + }; + + let stamp = out.join(".stamp"); + let mut contents = String::new(); + drop(File::open(&stamp).and_then(|mut f| f.read_to_string(&mut contents))); + if contents == OPENSSL_VERS { + return + } + t!(fs::create_dir_all(&out)); + + let name = format!("openssl-{}.tar.gz", OPENSSL_VERS); + let tarball = out.join(&name); + if !tarball.exists() { + let tmp = tarball.with_extension("tmp"); + build.run(Command::new("curl") + .arg("-o").arg(&tmp) + .arg(format!("https://www.openssl.org/source/{}", name))); + let mut shasum = if target.contains("apple") { + let mut cmd = Command::new("shasum"); + cmd.arg("-a").arg("256"); + cmd + } else { + Command::new("sha256sum") + }; + let output = output(&mut shasum.arg(&tmp)); + let found = output.split_whitespace().next().unwrap(); + if found != OPENSSL_SHA256 { + panic!("downloaded openssl sha256 different\n\ + expected: {}\n\ + found: {}\n", OPENSSL_SHA256, found); + } + t!(fs::rename(&tmp, &tarball)); + } + let obj = out.join(format!("openssl-{}", OPENSSL_VERS)); + let dst = build.openssl_install_dir(target).unwrap(); + drop(fs::remove_dir_all(&obj)); + drop(fs::remove_dir_all(&dst)); + build.run(Command::new("tar").arg("xf").arg(&tarball).current_dir(&out)); + + let mut configure = Command::new(obj.join("Configure")); + configure.arg(format!("--prefix={}", dst.display())); + configure.arg("no-dso"); + configure.arg("no-ssl2"); + configure.arg("no-ssl3"); + + let os = match target { + "aarch64-unknown-linux-gnu" => "linux-aarch64", + "arm-unknown-linux-gnueabi" => "linux-armv4", + "arm-unknown-linux-gnueabihf" => "linux-armv4", + "armv7-unknown-linux-gnueabihf" => "linux-armv4", + "i686-apple-darwin" => "darwin-i386-cc", + "i686-unknown-freebsd" => "BSD-x86-elf", + "i686-unknown-linux-gnu" => "linux-elf", + "i686-unknown-linux-musl" => "linux-elf", + "mips-unknown-linux-gnu" => "linux-mips32", + "mips64-unknown-linux-gnuabi64" => "linux64-mips64", + "mips64el-unknown-linux-gnuabi64" => "linux64-mips64", + "mipsel-unknown-linux-gnu" => "linux-mips32", + "powerpc-unknown-linux-gnu" => "linux-ppc", + "powerpc64-unknown-linux-gnu" => "linux-ppc64", + "powerpc64le-unknown-linux-gnu" => "linux-ppc64le", + "s390x-unknown-linux-gnu" => "linux64-s390x", + "x86_64-apple-darwin" => "darwin64-x86_64-cc", + "x86_64-unknown-freebsd" => "BSD-x86_64", + "x86_64-unknown-linux-gnu" => "linux-x86_64", + "x86_64-unknown-linux-musl" => "linux-x86_64", + "x86_64-unknown-netbsd" => "BSD-x86_64", + _ => panic!("don't know how to configure OpenSSL for {}", target), + }; + configure.arg(os); + configure.env("CC", build.cc(target)); + for flag in build.cflags(target) { + configure.arg(flag); + } + configure.current_dir(&obj); + println!("Configuring openssl for {}", target); + build.run_quiet(&mut configure); + println!("Building openssl for {}", target); + build.run_quiet(Command::new("make").current_dir(&obj)); + println!("Installing openssl for {}", target); + build.run_quiet(Command::new("make").arg("install").current_dir(&obj)); + + let mut f = t!(File::create(&stamp)); + t!(f.write_all(OPENSSL_VERS.as_bytes())); +} diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs index dcd3407e174aa..592c953d1ab31 100644 --- a/src/bootstrap/step.rs +++ b/src/bootstrap/step.rs @@ -278,9 +278,19 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules { rules.build(&krate.build_step, path) .dep(|s| s.name("libtest-link")) .dep(move |s| s.name("llvm").host(&build.config.build).stage(0)) + .dep(|s| s.name("may-run-build-script")) .run(move |s| compile::rustc(build, s.target, &s.compiler())); } + // Crates which have build scripts need to rely on this rule to ensure that + // the necessary prerequisites for a build script are linked and located in + // place. + rules.build("may-run-build-script", "path/to/nowhere") + .dep(move |s| { + s.name("libstd-link") + .host(&build.config.build) + .target(&build.config.build) + }); rules.build("startup-objects", "src/rtstartup") .dep(|s| s.name("create-sysroot").target(s.host)) .run(move |s| compile::build_startup_objects(build, &s.compiler(), s.target)); @@ -478,9 +488,10 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules { .dep(|s| s.name("dist-src")) .run(move |_| check::distcheck(build)); - rules.build("test-helpers", "src/rt/rust_test_helpers.c") .run(move |s| native::test_helpers(build, s.target)); + rules.build("openssl", "path/to/nowhere") + .run(move |s| native::openssl(build, s.target)); // Some test suites are run inside emulators, and most of our test binaries // are linked dynamically which means we need to ship the standard library @@ -547,6 +558,11 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules { rules.build("tool-qemu-test-client", "src/tools/qemu-test-client") .dep(|s| s.name("libstd")) .run(move |s| compile::tool(build, s.stage, s.target, "qemu-test-client")); + rules.build("tool-cargo", "src/tools/cargo") + .dep(|s| s.name("libstd")) + .dep(|s| s.stage(0).host(s.target).name("openssl")) + .dep(|s| s.name("may-run-build-script")) + .run(move |s| compile::tool(build, s.stage, s.target, "cargo")); // ======================================================================== // Documentation targets @@ -673,6 +689,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules { rules.dist("dist-cargo", "cargo") .host(true) .only_host_build(true) + .dep(|s| s.name("tool-cargo")) .run(move |s| dist::cargo(build, s.stage, s.target)); rules.dist("dist-extended", "extended") .default(build.config.extended) @@ -1180,6 +1197,7 @@ mod tests { build_step: "build-crate-std".to_string(), test_step: "test-std".to_string(), bench_step: "bench-std".to_string(), + version: String::new(), }); build.crates.insert("test".to_string(), ::Crate { name: "test".to_string(), @@ -1189,10 +1207,12 @@ mod tests { build_step: "build-crate-test".to_string(), test_step: "test-test".to_string(), bench_step: "bench-test".to_string(), + version: String::new(), }); build.crates.insert("rustc-main".to_string(), ::Crate { name: "rustc-main".to_string(), deps: Vec::new(), + version: String::new(), path: cwd.join("src/rustc-main"), doc_step: "doc-rustc-main".to_string(), build_step: "build-crate-rustc-main".to_string(), diff --git a/src/build_helper/lib.rs b/src/build_helper/lib.rs index 3dfd293808286..08f1f31c2d74b 100644 --- a/src/build_helper/lib.rs +++ b/src/build_helper/lib.rs @@ -53,6 +53,24 @@ pub fn run_silent(cmd: &mut Command) { } } +pub fn run_suppressed(cmd: &mut Command) { + let output = match cmd.output() { + Ok(status) => status, + Err(e) => fail(&format!("failed to execute command: {:?}\nerror: {}", + cmd, e)), + }; + if !output.status.success() { + fail(&format!("command did not execute successfully: {:?}\n\ + expected success, got: {}\n\n\ + stdout ----\n{}\n\ + stderr ----\n{}\n", + cmd, + output.status, + String::from_utf8_lossy(&output.stdout), + String::from_utf8_lossy(&output.stderr))); + } +} + pub fn gnu_target(target: &str) -> String { match target { "i686-pc-windows-msvc" => "i686-pc-win32".to_string(), diff --git a/src/ci/run.sh b/src/ci/run.sh index 53d16f6239e66..4c4836d7ca230 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -27,6 +27,7 @@ RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-sccache" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-quiet-tests" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-manage-submodules" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-locked-deps" +RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-cargo-openssl-static" if [ "$DIST_SRC" = "" ]; then RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-dist-src" diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index c2c91487b0c17..ceefcc9e0ec46 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -131,7 +131,8 @@ macro_rules! t { } struct Builder { - channel: String, + rust_release: String, + cargo_release: String, input: PathBuf, output: PathBuf, gpg_passphrase: String, @@ -147,13 +148,15 @@ fn main() { let input = PathBuf::from(args.next().unwrap()); let output = PathBuf::from(args.next().unwrap()); let date = args.next().unwrap(); - let channel = args.next().unwrap(); + let rust_release = args.next().unwrap(); + let cargo_release = args.next().unwrap(); let s3_address = args.next().unwrap(); let mut passphrase = String::new(); t!(io::stdin().read_to_string(&mut passphrase)); Builder { - channel: channel, + rust_release: rust_release, + cargo_release: cargo_release, input: input, output: output, gpg_passphrase: passphrase, @@ -184,10 +187,10 @@ impl Builder { manifest.insert("pkg".to_string(), toml::encode(&pkg)); let manifest = toml::Value::Table(manifest).to_string(); - let filename = format!("channel-rust-{}.toml", self.channel); + let filename = format!("channel-rust-{}.toml", self.rust_release); self.write_manifest(&manifest, &filename); - if self.channel != "beta" && self.channel != "nightly" { + if self.rust_release != "beta" && self.rust_release != "nightly" { self.write_manifest(&manifest, "channel-rust-stable.toml"); } } @@ -336,11 +339,11 @@ impl Builder { fn filename(&self, component: &str, target: &str) -> String { if component == "rust-src" { - format!("rust-src-{}.tar.gz", self.channel) + format!("rust-src-{}.tar.gz", self.rust_release) } else if component == "cargo" { - format!("cargo-nightly-{}.tar.gz", target) + format!("cargo-{}-{}.tar.gz", self.cargo_release, target) } else { - format!("{}-{}-{}.tar.gz", component, self.channel, target) + format!("{}-{}-{}.tar.gz", component, self.rust_release, target) } } diff --git a/src/tools/cargo b/src/tools/cargo index 6ed5a43bb566e..d17b61aa5a2ca 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit 6ed5a43bb566e0ee3fe7981de5aa5a36e2905ebd +Subproject commit d17b61aa5a2ca790f268a043bffdb0ffb04f0ec7 diff --git a/src/tools/tidy/src/cargo.rs b/src/tools/tidy/src/cargo.rs index 11acb64743a7a..053f0bbe3b81d 100644 --- a/src/tools/tidy/src/cargo.rs +++ b/src/tools/tidy/src/cargo.rs @@ -20,7 +20,7 @@ use std::fs::File; use std::path::Path; pub fn check(path: &Path, bad: &mut bool) { - if path.ends_with("vendor") { + if !super::filter_dirs(path) { return } for entry in t!(path.read_dir(), path).map(|e| t!(e)) { diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index e1c44a20e9756..3bf396db4d39d 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -16,6 +16,7 @@ use std::path::Path; static LICENSES: &'static [&'static str] = &[ "MIT/Apache-2.0", + "MIT / Apache-2.0", "Apache-2.0/MIT", "MIT OR Apache-2.0", "MIT", @@ -25,6 +26,7 @@ static LICENSES: &'static [&'static str] = &[ /// These MPL licensed projects are acceptable, but only these. static EXCEPTIONS: &'static [&'static str] = &[ "mdbook", + "openssl", "pest", "thread-id", ]; diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs index 1bb7919c1d35b..2af891b5b8562 100644 --- a/src/tools/tidy/src/main.rs +++ b/src/tools/tidy/src/main.rs @@ -70,6 +70,7 @@ fn filter_dirs(path: &Path) -> bool { "src/rustllvm", "src/rust-installer", "src/liblibc", + "src/tools/cargo", "src/vendor", ]; skip.iter().any(|p| path.ends_with(p)) From b44805875e3d2e7ac42052cf90d3d7dade90567c Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 14 Feb 2017 21:39:42 +0100 Subject: [PATCH 9/9] Add support for x86-interrupt calling convention MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tracking issue: https://github.com/rust-lang/rust/issues/40180 This calling convention can be used for definining interrupt handlers on 32-bit and 64-bit x86 targets. The compiler then uses `iret` instead of `ret` for returning and ensures that all registers are restored to their original values. Usage: ``` extern "x86-interrupt" fn handler(stack_frame: &ExceptionStackFrame) {…} ``` for interrupts and exceptions without error code and ``` extern "x86-interrupt" fn page_fault_handler(stack_frame: &ExceptionStackFrame, error_code: u64) {…} ``` for exceptions that push an error code (e.g., page faults or general protection faults). The programmer must ensure that the correct version is used for each interrupt. For more details see the [LLVM PR][1] and the corresponding [proposal][2]. [1]: https://reviews.llvm.org/D15567 [2]: http://lists.llvm.org/pipermail/cfe-dev/2015-September/045171.html --- src/librustc_llvm/ffi.rs | 1 + src/librustc_trans/abi.rs | 1 + src/libsyntax/abi.rs | 2 ++ src/libsyntax/feature_gate.rs | 7 ++++++ src/test/codegen/abi-x86-interrupt.rs | 28 +++++++++++++++++++++++ src/test/compile-fail/feature-gate-abi.rs | 8 +++++++ src/test/ui/codemap_tests/unicode.stderr | 2 +- 7 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/test/codegen/abi-x86-interrupt.rs diff --git a/src/librustc_llvm/ffi.rs b/src/librustc_llvm/ffi.rs index adf8067987e40..26c7a9166e68e 100644 --- a/src/librustc_llvm/ffi.rs +++ b/src/librustc_llvm/ffi.rs @@ -53,6 +53,7 @@ pub enum CallConv { X86_64_SysV = 78, X86_64_Win64 = 79, X86_VectorCall = 80, + X86_Intr = 83, } /// LLVMRustLinkage diff --git a/src/librustc_trans/abi.rs b/src/librustc_trans/abi.rs index b44cd20e4402e..0bbe981f2f72c 100644 --- a/src/librustc_trans/abi.rs +++ b/src/librustc_trans/abi.rs @@ -355,6 +355,7 @@ impl FnType { Aapcs => llvm::ArmAapcsCallConv, PtxKernel => llvm::PtxKernel, Msp430Interrupt => llvm::Msp430Intr, + X86Interrupt => llvm::X86_Intr, // These API constants ought to be more specific... Cdecl => llvm::CCallConv, diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index 42f3aa5ffd6bd..30641515a41dd 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -25,6 +25,7 @@ pub enum Abi { SysV64, PtxKernel, Msp430Interrupt, + X86Interrupt, // Multiplatform / generic ABIs Rust, @@ -59,6 +60,7 @@ const AbiDatas: &'static [AbiData] = &[ AbiData {abi: Abi::SysV64, name: "sysv64", generic: false }, AbiData {abi: Abi::PtxKernel, name: "ptx-kernel", generic: false }, AbiData {abi: Abi::Msp430Interrupt, name: "msp430-interrupt", generic: false }, + AbiData {abi: Abi::X86Interrupt, name: "x86-interrupt", generic: false }, // Cross-platform ABIs AbiData {abi: Abi::Rust, name: "Rust", generic: true }, diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index c2b72edb66c6c..78f13c18dc104 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -330,6 +330,9 @@ declare_features! ( // Used to identify crates that contain sanitizer runtimes // rustc internal (active, sanitizer_runtime, "1.17.0", None), + + // `extern "x86-interrupt" fn()` + (active, abi_x86_interrupt, "1.17.0", Some(40180)), ); declare_features! ( @@ -1036,6 +1039,10 @@ impl<'a> PostExpansionVisitor<'a> { gate_feature_post!(&self, abi_msp430_interrupt, span, "msp430-interrupt ABI is experimental and subject to change"); }, + Abi::X86Interrupt => { + gate_feature_post!(&self, abi_x86_interrupt, span, + "x86-interrupt ABI is experimental and subject to change"); + }, // Stable Abi::Cdecl | Abi::Stdcall | diff --git a/src/test/codegen/abi-x86-interrupt.rs b/src/test/codegen/abi-x86-interrupt.rs new file mode 100644 index 0000000000000..838cd4bf6d745 --- /dev/null +++ b/src/test/codegen/abi-x86-interrupt.rs @@ -0,0 +1,28 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Checks if the correct annotation for the x86-interrupt ABI is passed to +// llvm. Also checks that the abi_x86_interrupt feature gate allows usage +// of the x86-interrupt abi. + +// ignore-arm +// ignore-aarch64 +// min-llvm-version 3.8 + +// compile-flags: -C no-prepopulate-passes + +#![crate_type = "lib"] +#![feature(abi_x86_interrupt)] + +// CHECK: define x86_intrcc i64 @has_x86_interrupt_abi +#[no_mangle] +pub extern "x86-interrupt" fn has_x86_interrupt_abi(a: i64) -> i64 { + a * 2 +} diff --git a/src/test/compile-fail/feature-gate-abi.rs b/src/test/compile-fail/feature-gate-abi.rs index 41efb92d450e8..b77c9fab7169f 100644 --- a/src/test/compile-fail/feature-gate-abi.rs +++ b/src/test/compile-fail/feature-gate-abi.rs @@ -12,6 +12,7 @@ // gate-test-platform_intrinsics // gate-test-abi_vectorcall // gate-test-abi_ptx +// gate-test-abi_x86_interrupt // Functions extern "rust-intrinsic" fn f1() {} //~ ERROR intrinsics are subject to change @@ -20,6 +21,7 @@ extern "vectorcall" fn f3() {} //~ ERROR vectorcall is experimental and subject extern "rust-call" fn f4() {} //~ ERROR rust-call ABI is subject to change extern "msp430-interrupt" fn f5() {} //~ ERROR msp430-interrupt ABI is experimental extern "ptx-kernel" fn f6() {} //~ ERROR PTX ABIs are experimental and subject to change +extern "x86-interrupt" fn f7() {} //~ ERROR x86-interrupt ABI is experimental // Methods in trait definition trait Tr { @@ -29,6 +31,7 @@ trait Tr { extern "rust-call" fn m4(); //~ ERROR rust-call ABI is subject to change extern "msp430-interrupt" fn m5(); //~ ERROR msp430-interrupt ABI is experimental extern "ptx-kernel" fn m6(); //~ ERROR PTX ABIs are experimental and subject to change + extern "x86-interrupt" fn m7(); //~ ERROR x86-interrupt ABI is experimental extern "rust-intrinsic" fn dm1() {} //~ ERROR intrinsics are subject to change extern "platform-intrinsic" fn dm2() {} //~ ERROR platform intrinsics are experimental @@ -36,6 +39,7 @@ trait Tr { extern "rust-call" fn dm4() {} //~ ERROR rust-call ABI is subject to change extern "msp430-interrupt" fn dm5() {} //~ ERROR msp430-interrupt ABI is experimental extern "ptx-kernel" fn dm6() {} //~ ERROR PTX ABIs are experimental and subject to change + extern "x86-interrupt" fn dm7() {} //~ ERROR x86-interrupt ABI is experimental } struct S; @@ -48,6 +52,7 @@ impl Tr for S { extern "rust-call" fn m4() {} //~ ERROR rust-call ABI is subject to change extern "msp430-interrupt" fn m5() {} //~ ERROR msp430-interrupt ABI is experimental extern "ptx-kernel" fn m6() {} //~ ERROR PTX ABIs are experimental and subject to change + extern "x86-interrupt" fn m7() {} //~ ERROR x86-interrupt ABI is experimental } // Methods in inherent impl @@ -58,6 +63,7 @@ impl S { extern "rust-call" fn im4() {} //~ ERROR rust-call ABI is subject to change extern "msp430-interrupt" fn im5() {} //~ ERROR msp430-interrupt ABI is experimental extern "ptx-kernel" fn im6() {} //~ ERROR PTX ABIs are experimental and subject to change + extern "x86-interrupt" fn im7() {} //~ ERROR x86-interrupt ABI is experimental } // Function pointer types @@ -67,6 +73,7 @@ type A3 = extern "vectorcall" fn(); //~ ERROR vectorcall is experimental and sub type A4 = extern "rust-call" fn(); //~ ERROR rust-call ABI is subject to change type A5 = extern "msp430-interrupt" fn(); //~ ERROR msp430-interrupt ABI is experimental type A6 = extern "ptx-kernel" fn (); //~ ERROR PTX ABIs are experimental and subject to change +type A7 = extern "x86-interrupt" fn(); //~ ERROR x86-interrupt ABI is experimental // Foreign modules extern "rust-intrinsic" {} //~ ERROR intrinsics are subject to change @@ -75,5 +82,6 @@ extern "vectorcall" {} //~ ERROR vectorcall is experimental and subject to chang extern "rust-call" {} //~ ERROR rust-call ABI is subject to change extern "msp430-interrupt" {} //~ ERROR msp430-interrupt ABI is experimental extern "ptx-kernel" {} //~ ERROR PTX ABIs are experimental and subject to change +extern "x86-interrupt" {} //~ ERROR x86-interrupt ABI is experimental fn main() {} diff --git a/src/test/ui/codemap_tests/unicode.stderr b/src/test/ui/codemap_tests/unicode.stderr index 423cc9230e893..eef8793511529 100644 --- a/src/test/ui/codemap_tests/unicode.stderr +++ b/src/test/ui/codemap_tests/unicode.stderr @@ -1,4 +1,4 @@ -error: invalid ABI: expected one of [cdecl, stdcall, fastcall, vectorcall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted], found `路濫狼á́́` +error: invalid ABI: expected one of [cdecl, stdcall, fastcall, vectorcall, aapcs, win64, sysv64, ptx-kernel, msp430-interrupt, x86-interrupt, Rust, C, system, rust-intrinsic, rust-call, platform-intrinsic, unadjusted], found `路濫狼á́́` --> $DIR/unicode.rs:11:8 | 11 | extern "路濫狼á́́" fn foo() {}