Skip to content

Commit aa82600

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 171231 b: refs/heads/batch c: 5f7f2c9 h: refs/heads/master i: 171229: 11fea5b 171227: c0a2ff3 171223: afda938 171215: 561f478 171199: 8e80e1a v: v3
1 parent b458210 commit aa82600

File tree

33 files changed

+12
-410
lines changed

33 files changed

+12
-410
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: 18e2026ff8ae67cf8dea61c938d87f1f45734751
32+
refs/heads/batch: 5f7f2c9a0592bc1627781767ec8228aaad3e5364
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 496dc4eae7de9d14cd49511a9acfbf5f11ae6c3f
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -494,11 +494,7 @@ impl BoxPointers {
494494
let mut n_uniq = 0i;
495495
ty::fold_ty(cx.tcx, ty, |t| {
496496
match t.sty {
497-
ty::ty_uniq(_) |
498-
ty::ty_closure(box ty::ClosureTy {
499-
store: ty::UniqTraitStore,
500-
..
501-
}) => {
497+
ty::ty_uniq(_) => {
502498
n_uniq += 1;
503499
}
504500

branches/batch/src/librustc/metadata/tyencode.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ pub fn enc_ty<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>, t: Ty<'t
119119
ty::ty_str => {
120120
mywrite!(w, "v");
121121
}
122-
ty::ty_closure(ref f) => {
123-
mywrite!(w, "f");
124-
enc_closure_ty(w, cx, &**f);
125-
}
126122
ty::ty_bare_fn(Some(def_id), f) => {
127123
mywrite!(w, "F");
128124
mywrite!(w, "{}|", (cx.ds)(def_id));

branches/batch/src/librustc/middle/effect.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ enum UnsafeContext {
3333
fn type_is_unsafe_function(ty: Ty) -> bool {
3434
match ty.sty {
3535
ty::ty_bare_fn(_, ref f) => f.unsafety == ast::Unsafety::Unsafe,
36-
ty::ty_closure(ref f) => f.unsafety == ast::Unsafety::Unsafe,
3736
_ => false,
3837
}
3938
}

branches/batch/src/librustc/middle/expr_use_visitor.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -656,19 +656,6 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
656656
ty::ty_bare_fn(..) => {
657657
self.consume_expr(callee);
658658
}
659-
ty::ty_closure(ref f) => {
660-
match f.onceness {
661-
ast::Many => {
662-
self.borrow_expr(callee,
663-
ty::ReScope(call_scope),
664-
ty::UniqueImmBorrow,
665-
ClosureInvocation);
666-
}
667-
ast::Once => {
668-
self.consume_expr(callee);
669-
}
670-
}
671-
}
672659
ty::ty_err => { }
673660
_ => {
674661
let overloaded_call_type =

branches/batch/src/librustc/middle/fast_reject.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ pub fn simplify_type(tcx: &ty::ctxt,
8080
ty::ty_tup(ref tys) => {
8181
Some(TupleSimplifiedType(tys.len()))
8282
}
83-
ty::ty_closure(ref f) => {
84-
Some(FunctionSimplifiedType(f.sig.0.inputs.len()))
85-
}
8683
ty::ty_bare_fn(_, ref f) => {
8784
Some(FunctionSimplifiedType(f.sig.0.inputs.len()))
8885
}

branches/batch/src/librustc/middle/infer/coercion.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,6 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
160160
};
161161
}
162162

163-
ty::ty_closure(box ty::ClosureTy {
164-
store: ty::RegionTraitStore(..),
165-
..
166-
}) => {
167-
return self.unpack_actual_value(a, |a| {
168-
self.coerce_borrowed_fn(a, b)
169-
});
170-
}
171-
172163
_ => {}
173164
}
174165

@@ -511,21 +502,6 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
511502
a.repr(self.tcx()), b.repr(self.tcx()));
512503

513504
match b.sty {
514-
ty::ty_closure(ref f) => {
515-
if fn_ty_a.abi != abi::Rust || fn_ty_a.unsafety != ast::Unsafety::Normal {
516-
return self.subtype(a, b);
517-
}
518-
519-
let fn_ty_b = (*f).clone();
520-
let adj = ty::AdjustAddEnv(fn_def_id_a, fn_ty_b.store);
521-
let a_closure = ty::mk_closure(self.tcx(),
522-
ty::ClosureTy {
523-
sig: fn_ty_a.sig.clone(),
524-
.. *fn_ty_b
525-
});
526-
try!(self.subtype(a_closure, b));
527-
Ok(Some(adj))
528-
}
529505
ty::ty_bare_fn(None, _) => {
530506
let a_fn_pointer = ty::mk_bare_fn(self.tcx(), None, fn_ty_a);
531507
try!(self.subtype(a_fn_pointer, b));

branches/batch/src/librustc/middle/infer/combine.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -644,12 +644,6 @@ pub fn super_tys<'tcx, C: Combine<'tcx>>(this: &C,
644644
Ok(ty::mk_bare_fn(tcx, a_opt_def_id, tcx.mk_bare_fn(fty)))
645645
}
646646

647-
(&ty::ty_closure(ref a_fty), &ty::ty_closure(ref b_fty)) => {
648-
this.closure_tys(&**a_fty, &**b_fty).and_then(|fty| {
649-
Ok(ty::mk_closure(tcx, fty))
650-
})
651-
}
652-
653647
(&ty::ty_projection(ref a_data), &ty::ty_projection(ref b_data)) => {
654648
let projection_ty = try!(this.projection_tys(a_data, b_data));
655649
Ok(ty::mk_projection(tcx, projection_ty.trait_ref, projection_ty.item_name))

branches/batch/src/librustc/middle/infer/freshen.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ impl<'a, 'tcx> TypeFolder<'tcx> for TypeFreshener<'a, 'tcx> {
152152
ty::ty_ptr(..) |
153153
ty::ty_rptr(..) |
154154
ty::ty_bare_fn(..) |
155-
ty::ty_closure(..) |
156155
ty::ty_trait(..) |
157156
ty::ty_struct(..) |
158157
ty::ty_unboxed_closure(..) |

branches/batch/src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,7 @@ pub enum deref_kind {
197197
// pointer adjustment).
198198
pub fn deref_kind(t: Ty) -> McResult<deref_kind> {
199199
match t.sty {
200-
ty::ty_uniq(_) |
201-
ty::ty_closure(box ty::ClosureTy {store: ty::UniqTraitStore, ..}) => {
200+
ty::ty_uniq(_) => {
202201
Ok(deref_ptr(Unique))
203202
}
204203

@@ -207,13 +206,6 @@ pub fn deref_kind(t: Ty) -> McResult<deref_kind> {
207206
Ok(deref_ptr(BorrowedPtr(kind, *r)))
208207
}
209208

210-
ty::ty_closure(box ty::ClosureTy {
211-
store: ty::RegionTraitStore(r, _),
212-
..
213-
}) => {
214-
Ok(deref_ptr(BorrowedPtr(ty::ImmBorrow, r)))
215-
}
216-
217209
ty::ty_ptr(ref mt) => {
218210
Ok(deref_ptr(UnsafePtr(mt.mutbl)))
219211
}
@@ -592,25 +584,6 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
592584
def::DefUpvar(var_id, fn_node_id, _) => {
593585
let ty = try!(self.node_ty(fn_node_id));
594586
match ty.sty {
595-
ty::ty_closure(ref closure_ty) => {
596-
// Translate old closure type info into unboxed
597-
// closure kind/capture mode
598-
let (mode, kind) = match (closure_ty.store, closure_ty.onceness) {
599-
// stack closure
600-
(ty::RegionTraitStore(..), ast::Many) => {
601-
(ast::CaptureByRef, ty::FnMutUnboxedClosureKind)
602-
}
603-
// proc or once closure
604-
(_, ast::Once) => {
605-
(ast::CaptureByValue, ty::FnOnceUnboxedClosureKind)
606-
}
607-
// There should be no such old closure type
608-
(ty::UniqTraitStore, ast::Many) => {
609-
self.tcx().sess.span_bug(span, "Impossible closure type");
610-
}
611-
};
612-
self.cat_upvar(id, span, var_id, fn_node_id, kind, mode, false)
613-
}
614587
ty::ty_unboxed_closure(closure_id, _, _) => {
615588
let kind = self.typer.unboxed_closure_kind(closure_id);
616589
let mode = self.typer.capture_mode(fn_node_id);

branches/batch/src/librustc/middle/traits/coherence.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ fn ty_is_local_constructor<'tcx>(tcx: &ty::ctxt<'tcx>, ty: Ty<'tcx>) -> bool {
118118
ty::ty_float(..) |
119119
ty::ty_str(..) |
120120
ty::ty_bare_fn(..) |
121-
ty::ty_closure(..) |
122121
ty::ty_vec(..) |
123122
ty::ty_ptr(..) |
124123
ty::ty_rptr(..) |

branches/batch/src/librustc/middle/traits/select.rs

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,62 +1273,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
12731273
}
12741274
}
12751275

1276-
ty::ty_closure(ref c) => {
1277-
match c.store {
1278-
ty::UniqTraitStore => {
1279-
// proc: Equivalent to `Box<FnOnce>`
1280-
match bound {
1281-
ty::BoundCopy => {
1282-
Err(Unimplemented)
1283-
}
1284-
1285-
ty::BoundSized => {
1286-
Ok(If(Vec::new()))
1287-
}
1288-
1289-
ty::BoundSync |
1290-
ty::BoundSend => {
1291-
if c.bounds.builtin_bounds.contains(&bound) {
1292-
Ok(If(Vec::new()))
1293-
} else {
1294-
Err(Unimplemented)
1295-
}
1296-
}
1297-
}
1298-
}
1299-
ty::RegionTraitStore(_, mutbl) => {
1300-
// ||: Equivalent to `&FnMut` or `&mut FnMut` or something like that.
1301-
match bound {
1302-
ty::BoundCopy => {
1303-
match mutbl {
1304-
ast::MutMutable => {
1305-
// &mut T is affine
1306-
Err(Unimplemented)
1307-
}
1308-
ast::MutImmutable => {
1309-
// &T is copyable, no matter what T is
1310-
Ok(If(Vec::new()))
1311-
}
1312-
}
1313-
}
1314-
1315-
ty::BoundSized => {
1316-
Ok(If(Vec::new()))
1317-
}
1318-
1319-
ty::BoundSync |
1320-
ty::BoundSend => {
1321-
if c.bounds.builtin_bounds.contains(&bound) {
1322-
Ok(If(Vec::new()))
1323-
} else {
1324-
Err(Unimplemented)
1325-
}
1326-
}
1327-
}
1328-
}
1329-
}
1330-
}
1331-
13321276
ty::ty_trait(ref data) => {
13331277
match bound {
13341278
ty::BoundSized => {

0 commit comments

Comments
 (0)