Skip to content

Commit 44b4df1

Browse files
committed
---
yaml --- r: 159782 b: refs/heads/try c: 680d579 h: refs/heads/master v: v3
1 parent d028479 commit 44b4df1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+5128
-5167
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: e09d98603e608c9e47d4c89f7b4dca87a4b56da3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9c96a79a74f10bed18b031ce0ac4126c56d6cfb3
5-
refs/heads/try: f58aad6dce273570fb130b4df008ef9acd5a5be2
5+
refs/heads/try: 680d579ff0e0c8e65e329d29b867600aa2aec478
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcore/ops.rs

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -866,34 +866,64 @@ pub trait FnOnce<Args,Result> {
866866
extern "rust-call" fn call_once(self, args: Args) -> Result;
867867
}
868868

869-
macro_rules! def_fn_mut(
869+
impl<F,A,R> FnMut<A,R> for F
870+
where F : Fn<A,R>
871+
{
872+
extern "rust-call" fn call_mut(&mut self, args: A) -> R {
873+
self.call(args)
874+
}
875+
}
876+
877+
impl<F,A,R> FnOnce<A,R> for F
878+
where F : FnMut<A,R>
879+
{
880+
extern "rust-call" fn call_once(mut self, args: A) -> R {
881+
self.call_mut(args)
882+
}
883+
}
884+
885+
886+
impl<Result> Fn<(),Result> for extern "Rust" fn() -> Result {
887+
#[allow(non_snake_case)]
888+
extern "rust-call" fn call(&self, _args: ()) -> Result {
889+
(*self)()
890+
}
891+
}
892+
893+
impl<Result,A0> Fn<(A0,),Result> for extern "Rust" fn(A0) -> Result {
894+
#[allow(non_snake_case)]
895+
extern "rust-call" fn call(&self, args: (A0,)) -> Result {
896+
let (a0,) = args;
897+
(*self)(a0)
898+
}
899+
}
900+
901+
macro_rules! def_fn(
870902
($($args:ident)*) => (
871903
impl<Result$(,$args)*>
872-
FnMut<($($args,)*),Result>
904+
Fn<($($args,)*),Result>
873905
for extern "Rust" fn($($args: $args,)*) -> Result {
874906
#[allow(non_snake_case)]
875-
extern "rust-call" fn call_mut(&mut self, args: ($($args,)*)) -> Result {
907+
extern "rust-call" fn call(&self, args: ($($args,)*)) -> Result {
876908
let ($($args,)*) = args;
877909
(*self)($($args,)*)
878910
}
879911
}
880912
)
881913
)
882914

883-
def_fn_mut!()
884-
def_fn_mut!(A0)
885-
def_fn_mut!(A0 A1)
886-
def_fn_mut!(A0 A1 A2)
887-
def_fn_mut!(A0 A1 A2 A3)
888-
def_fn_mut!(A0 A1 A2 A3 A4)
889-
def_fn_mut!(A0 A1 A2 A3 A4 A5)
890-
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6)
891-
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7)
892-
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8)
893-
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9)
894-
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10)
895-
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11)
896-
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12)
897-
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13)
898-
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14)
899-
def_fn_mut!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15)
915+
def_fn!(A0 A1)
916+
def_fn!(A0 A1 A2)
917+
def_fn!(A0 A1 A2 A3)
918+
def_fn!(A0 A1 A2 A3 A4)
919+
def_fn!(A0 A1 A2 A3 A4 A5)
920+
def_fn!(A0 A1 A2 A3 A4 A5 A6)
921+
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7)
922+
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8)
923+
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9)
924+
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10)
925+
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11)
926+
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12)
927+
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13)
928+
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14)
929+
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15)

branches/try/src/librustc/back/link.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use metadata::common::LinkMeta;
2222
use metadata::{encoder, cstore, filesearch, csearch, creader};
2323
use middle::trans::context::CrateContext;
2424
use middle::trans::common::gensym_name;
25-
use middle::ty::{mod, Ty};
25+
use middle::ty;
2626
use util::common::time;
2727
use util::ppaux;
2828
use util::sha2::{Digest, Sha256};
@@ -196,11 +196,11 @@ fn truncated_hash_result(symbol_hasher: &mut Sha256) -> String {
196196

197197

198198
// This calculates STH for a symbol, as defined above
199-
fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>,
200-
symbol_hasher: &mut Sha256,
201-
t: Ty<'tcx>,
202-
link_meta: &LinkMeta)
203-
-> String {
199+
fn symbol_hash(tcx: &ty::ctxt,
200+
symbol_hasher: &mut Sha256,
201+
t: ty::t,
202+
link_meta: &LinkMeta)
203+
-> String {
204204
// NB: do *not* use abbrevs here as we want the symbol names
205205
// to be independent of one another in the crate.
206206

@@ -219,7 +219,7 @@ fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>,
219219
hash
220220
}
221221

222-
fn get_symbol_hash<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> String {
222+
fn get_symbol_hash(ccx: &CrateContext, t: ty::t) -> String {
223223
match ccx.type_hashcodes().borrow().find(&t) {
224224
Some(h) => return h.to_string(),
225225
None => {}
@@ -320,8 +320,8 @@ pub fn exported_name(path: PathElems, hash: &str) -> String {
320320
mangle(path, Some(hash))
321321
}
322322

323-
pub fn mangle_exported_name<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, path: PathElems,
324-
t: Ty<'tcx>, id: ast::NodeId) -> String {
323+
pub fn mangle_exported_name(ccx: &CrateContext, path: PathElems,
324+
t: ty::t, id: ast::NodeId) -> String {
325325
let mut hash = get_symbol_hash(ccx, t);
326326

327327
// Paths can be completely identical for different nodes,
@@ -345,9 +345,9 @@ pub fn mangle_exported_name<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, path: PathEl
345345
exported_name(path, hash.as_slice())
346346
}
347347

348-
pub fn mangle_internal_name_by_type_and_seq<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
349-
t: Ty<'tcx>,
350-
name: &str) -> String {
348+
pub fn mangle_internal_name_by_type_and_seq(ccx: &CrateContext,
349+
t: ty::t,
350+
name: &str) -> String {
351351
let s = ppaux::ty_to_string(ccx.tcx(), t);
352352
let path = [PathName(token::intern(s.as_slice())),
353353
gensym_name(name)];

branches/try/src/librustc/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ pub struct CrateAnalysis<'tcx> {
368368
/// structures carrying the results of the analysis.
369369
pub fn phase_3_run_analysis_passes<'tcx>(sess: Session,
370370
ast_map: ast_map::Map<'tcx>,
371-
type_arena: &'tcx TypedArena<ty::TyS<'tcx>>,
371+
type_arena: &'tcx TypedArena<ty::t_box_>,
372372
name: String) -> CrateAnalysis<'tcx> {
373373
let time_passes = sess.time_passes();
374374
let krate = ast_map.krate();

branches/try/src/librustc/driver/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl PpSourceMode {
9494
fn call_with_pp_support<'tcx, A, B>(&self,
9595
sess: Session,
9696
ast_map: Option<ast_map::Map<'tcx>>,
97-
type_arena: &'tcx TypedArena<ty::TyS<'tcx>>,
97+
type_arena: &'tcx TypedArena<ty::t_box_>,
9898
id: String,
9999
payload: B,
100100
f: |&PrinterSupport, B| -> A) -> A {

branches/try/src/librustc/lint/builtin.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@
2727
2828
use metadata::csearch;
2929
use middle::def::*;
30-
use middle::ty::{mod, Ty};
3130
use middle::typeck::astconv::ast_ty_to_ty;
32-
use middle::typeck::{mod, infer};
33-
use middle::{def, pat_util, stability};
31+
use middle::typeck::infer;
32+
use middle::{typeck, ty, def, pat_util, stability};
3433
use middle::const_eval::{eval_const_expr_partial, const_int, const_uint};
3534
use util::ppaux::{ty_to_string};
3635
use util::nodemap::NodeSet;
@@ -99,7 +98,7 @@ impl LintPass for UnusedCasts {
9998
match e.node {
10099
ast::ExprCast(ref expr, ref ty) => {
101100
let t_t = ast_ty_to_ty(cx, &infer::new_infer_ctxt(cx.tcx), &**ty);
102-
if ty::expr_ty(cx.tcx, &**expr) == t_t {
101+
if ty::get(ty::expr_ty(cx.tcx, &**expr)).sty == ty::get(t_t).sty {
103102
cx.span_lint(UNUSED_TYPECASTS, ty.span, "unnecessary type cast");
104103
}
105104
}
@@ -155,7 +154,7 @@ impl LintPass for TypeLimits {
155154
},
156155
_ => {
157156
let t = ty::expr_ty(cx.tcx, &**expr);
158-
match t.sty {
157+
match ty::get(t).sty {
159158
ty::ty_uint(_) => {
160159
cx.span_lint(UNSIGNED_NEGATION, e.span,
161160
"negation of unsigned int variable may \
@@ -180,7 +179,7 @@ impl LintPass for TypeLimits {
180179
}
181180

182181
if is_shift_binop(binop) {
183-
let opt_ty_bits = match ty::expr_ty(cx.tcx, &**l).sty {
182+
let opt_ty_bits = match ty::get(ty::expr_ty(cx.tcx, &**l)).sty {
184183
ty::ty_int(t) => Some(int_ty_bits(t, cx.sess().target.int_type)),
185184
ty::ty_uint(t) => Some(uint_ty_bits(t, cx.sess().target.uint_type)),
186185
_ => None
@@ -205,7 +204,7 @@ impl LintPass for TypeLimits {
205204
}
206205
},
207206
ast::ExprLit(ref lit) => {
208-
match ty::expr_ty(cx.tcx, e).sty {
207+
match ty::get(ty::expr_ty(cx.tcx, e)).sty {
209208
ty::ty_int(t) => {
210209
match lit.node {
211210
ast::LitInt(v, ast::SignedIntLit(_, ast::Plus)) |
@@ -343,7 +342,7 @@ impl LintPass for TypeLimits {
343342
// Normalize the binop so that the literal is always on the RHS in
344343
// the comparison
345344
let norm_binop = if swap { rev_binop(binop) } else { binop };
346-
match ty::expr_ty(tcx, expr).sty {
345+
match ty::get(ty::expr_ty(tcx, expr)).sty {
347346
ty::ty_int(int_ty) => {
348347
let (min, max) = int_ty_range(int_ty);
349348
let lit_val: i64 = match lit.node {
@@ -471,11 +470,10 @@ declare_lint!(BOX_POINTERS, Allow,
471470
pub struct BoxPointers;
472471

473472
impl BoxPointers {
474-
fn check_heap_type<'a, 'tcx>(&self, cx: &Context<'a, 'tcx>,
475-
span: Span, ty: Ty<'tcx>) {
473+
fn check_heap_type(&self, cx: &Context, span: Span, ty: ty::t) {
476474
let mut n_uniq = 0i;
477475
ty::fold_ty(cx.tcx, ty, |t| {
478-
match t.sty {
476+
match ty::get(t).sty {
479477
ty::ty_uniq(_) |
480478
ty::ty_closure(box ty::ClosureTy {
481479
store: ty::UniqTraitStore,
@@ -575,7 +573,7 @@ impl LintPass for RawPointerDeriving {
575573
}
576574
let did = match item.node {
577575
ast::ItemImpl(..) => {
578-
match ty::node_id_to_type(cx.tcx, item.id).sty {
576+
match ty::get(ty::node_id_to_type(cx.tcx, item.id)).sty {
579577
ty::ty_enum(did, _) => did,
580578
ty::ty_struct(did, _) => did,
581579
_ => return,
@@ -736,7 +734,7 @@ impl LintPass for UnusedResults {
736734

737735
let t = ty::expr_ty(cx.tcx, expr);
738736
let mut warned = false;
739-
match t.sty {
737+
match ty::get(t).sty {
740738
ty::ty_nil | ty::ty_bool => return,
741739
ty::ty_struct(did, _) |
742740
ty::ty_enum(did, _) => {

branches/try/src/librustc/lint/context.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
2727
use middle::privacy::ExportedItems;
2828
use middle::subst;
29-
use middle::ty::{mod, Ty};
29+
use middle::ty;
3030
use middle::typeck::astconv::AstConv;
3131
use middle::typeck::infer;
3232
use driver::session::Session;
@@ -545,30 +545,30 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
545545
impl<'a, 'tcx> AstConv<'tcx> for Context<'a, 'tcx>{
546546
fn tcx<'a>(&'a self) -> &'a ty::ctxt<'tcx> { self.tcx }
547547

548-
fn get_item_ty(&self, id: ast::DefId) -> ty::Polytype<'tcx> {
548+
fn get_item_ty(&self, id: ast::DefId) -> ty::Polytype {
549549
ty::lookup_item_type(self.tcx, id)
550550
}
551551

552-
fn get_trait_def(&self, id: ast::DefId) -> Rc<ty::TraitDef<'tcx>> {
552+
fn get_trait_def(&self, id: ast::DefId) -> Rc<ty::TraitDef> {
553553
ty::lookup_trait_def(self.tcx, id)
554554
}
555555

556-
fn ty_infer(&self, _span: Span) -> Ty<'tcx> {
556+
fn ty_infer(&self, _span: Span) -> ty::t {
557557
infer::new_infer_ctxt(self.tcx).next_ty_var()
558558
}
559559

560-
fn associated_types_of_trait_are_valid(&self, _: Ty<'tcx>, _: ast::DefId)
560+
fn associated_types_of_trait_are_valid(&self, _: ty::t, _: ast::DefId)
561561
-> bool {
562562
// FIXME(pcwalton): This is wrong.
563563
true
564564
}
565565

566566
fn associated_type_binding(&self,
567567
_: Span,
568-
_: Option<Ty<'tcx>>,
568+
_: Option<ty::t>,
569569
trait_id: ast::DefId,
570570
associated_type_id: ast::DefId)
571-
-> Ty<'tcx> {
571+
-> ty::t {
572572
// FIXME(pcwalton): This is wrong.
573573
let trait_def = self.get_trait_def(trait_id);
574574
let index = ty::associated_type_parameter_index(self.tcx,

0 commit comments

Comments
 (0)