Skip to content

Commit 76235da

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 169879 b: refs/heads/auto c: 4e9c50e h: refs/heads/master i: 169877: 0a1f3af 169875: 630124e 169871: d878cbd v: v3
1 parent d7e301f commit 76235da

File tree

9 files changed

+5
-75
lines changed

9 files changed

+5
-75
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 714a5b7f5e960c885030fac4b357ec1304f539f9
13+
refs/heads/auto: 4e9c50e081f92cbf45df7f8ecbff3b05e26abf36
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc/middle/astencode.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,13 +1031,6 @@ impl<'a, 'tcx> rbml_writer_helpers<'tcx> for Encoder<'a> {
10311031

10321032
self.emit_enum("AutoAdjustment", |this| {
10331033
match *adj {
1034-
ty::AdjustAddEnv(def_id, store) => {
1035-
this.emit_enum_variant("AdjustAddEnv", 0, 2, |this| {
1036-
this.emit_enum_variant_arg(0, |this| def_id.encode(this));
1037-
this.emit_enum_variant_arg(1, |this| store.encode(this))
1038-
})
1039-
}
1040-
10411034
ty::AdjustReifyFnPointer(def_id) => {
10421035
this.emit_enum_variant("AdjustReifyFnPointer", 1, 2, |this| {
10431036
this.emit_enum_variant_arg(0, |this| def_id.encode(this))
@@ -1678,14 +1671,6 @@ impl<'a, 'tcx> rbml_decoder_decoder_helpers<'tcx> for reader::Decoder<'a> {
16781671
let variants = ["AutoAddEnv", "AutoDerefRef"];
16791672
this.read_enum_variant(&variants, |this, i| {
16801673
Ok(match i {
1681-
0 => {
1682-
let def_id: ast::DefId =
1683-
this.read_def_id(dcx);
1684-
let store: ty::TraitStore =
1685-
this.read_enum_variant_arg(0, |this| Decodable::decode(this)).unwrap();
1686-
1687-
ty::AdjustAddEnv(def_id, store.tr(dcx))
1688-
}
16891674
1 => {
16901675
let def_id: ast::DefId =
16911676
this.read_def_id(dcx);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,6 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
823823
None => { }
824824
Some(adjustment) => {
825825
match *adjustment {
826-
ty::AdjustAddEnv(..) |
827826
ty::AdjustReifyFnPointer(..) => {
828827
// Creating a closure/fn-pointer consumes the
829828
// input and stores it into the resulting

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,8 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
413413

414414
Some(adjustment) => {
415415
match *adjustment {
416-
ty::AdjustAddEnv(..) | ty::AdjustReifyFnPointer(..) => {
417-
debug!("cat_expr(AdjustAddEnv|AdjustReifyFnPointer): {}",
416+
ty::AdjustReifyFnPointer(..) => {
417+
debug!("cat_expr(AdjustReifyFnPointer): {}",
418418
expr.repr(self.tcx()));
419419
// Convert a bare fn to a closure by adding NULL env.
420420
// Result is an rvalue.

branches/auto/src/librustc/middle/ty.rs

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ pub enum Variance {
293293

294294
#[derive(Clone, Show)]
295295
pub enum AutoAdjustment<'tcx> {
296-
AdjustAddEnv(ast::DefId, ty::TraitStore),
297296
AdjustReifyFnPointer(ast::DefId), // go from a fn-item type to a fn-pointer type
298297
AdjustDerefRef(AutoDerefRef<'tcx>)
299298
}
@@ -4315,33 +4314,6 @@ pub fn adjust_ty<'tcx, F>(cx: &ctxt<'tcx>,
43154314
return match adjustment {
43164315
Some(adjustment) => {
43174316
match *adjustment {
4318-
AdjustAddEnv(_, store) => {
4319-
match unadjusted_ty.sty {
4320-
ty::ty_bare_fn(Some(_), ref b) => {
4321-
let bounds = ty::ExistentialBounds {
4322-
region_bound: ReStatic,
4323-
builtin_bounds: all_builtin_bounds(),
4324-
projection_bounds: vec!(),
4325-
};
4326-
4327-
ty::mk_closure(
4328-
cx,
4329-
ty::ClosureTy {unsafety: b.unsafety,
4330-
onceness: ast::Many,
4331-
store: store,
4332-
bounds: bounds,
4333-
sig: b.sig.clone(),
4334-
abi: b.abi})
4335-
}
4336-
ref b => {
4337-
cx.sess.bug(
4338-
format!("add_env adjustment on non-fn-item: \
4339-
{}",
4340-
b).as_slice());
4341-
}
4342-
}
4343-
}
4344-
43454317
AdjustReifyFnPointer(_) => {
43464318
match unadjusted_ty.sty {
43474319
ty::ty_bare_fn(Some(_), b) => {
@@ -6696,7 +6668,6 @@ pub fn with_freevars<T, F>(tcx: &ty::ctxt, fid: ast::NodeId, f: F) -> T where
66966668
impl<'tcx> AutoAdjustment<'tcx> {
66976669
pub fn is_identity(&self) -> bool {
66986670
match *self {
6699-
AdjustAddEnv(..) => false,
67006671
AdjustReifyFnPointer(..) => false,
67016672
AdjustDerefRef(ref r) => r.is_identity(),
67026673
}
@@ -6820,11 +6791,8 @@ impl DebruijnIndex {
68206791
impl<'tcx> Repr<'tcx> for AutoAdjustment<'tcx> {
68216792
fn repr(&self, tcx: &ctxt<'tcx>) -> String {
68226793
match *self {
6823-
AdjustAddEnv(def_id, ref trait_store) => {
6824-
format!("AdjustAddEnv({},{})", def_id.repr(tcx), trait_store)
6825-
}
68266794
AdjustReifyFnPointer(def_id) => {
6827-
format!("AdjustAddEnv({})", def_id.repr(tcx))
6795+
format!("AdjustReifyFnPointer({})", def_id.repr(tcx))
68286796
}
68296797
AdjustDerefRef(ref data) => {
68306798
data.repr(tcx)

branches/auto/src/librustc_trans/trans/consts.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -189,20 +189,6 @@ pub fn const_expr<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, e: &ast::Expr)
189189
None => { }
190190
Some(adj) => {
191191
match adj {
192-
ty::AdjustAddEnv(def_id, ty::RegionTraitStore(ty::ReStatic, _)) => {
193-
let wrapper = closure::get_wrapper_for_bare_fn(cx,
194-
ety_adjusted,
195-
def_id,
196-
llconst,
197-
true);
198-
llconst = C_struct(cx, &[wrapper, C_null(Type::i8p(cx))], false)
199-
}
200-
ty::AdjustAddEnv(_, store) => {
201-
cx.sess()
202-
.span_bug(e.span,
203-
format!("unexpected static function: {}",
204-
store)[])
205-
}
206192
ty::AdjustReifyFnPointer(_def_id) => {
207193
// FIXME(#19925) once fn item types are
208194
// zero-sized, we'll need to do something here

branches/auto/src/librustc_trans/trans/expr.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ use trans::inline;
5454
use trans::tvec;
5555
use trans::type_of;
5656
use middle::ty::{struct_fields, tup_fields};
57-
use middle::ty::{AdjustDerefRef, AdjustReifyFnPointer, AdjustAddEnv, AutoUnsafe};
57+
use middle::ty::{AdjustDerefRef, AdjustReifyFnPointer, AutoUnsafe};
5858
use middle::ty::{AutoPtr};
5959
use middle::ty::{self, Ty};
6060
use middle::ty::MethodCall;
@@ -179,9 +179,6 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
179179
datum.to_string(bcx.ccx()),
180180
adjustment.repr(bcx.tcx()));
181181
match adjustment {
182-
AdjustAddEnv(def_id, _) => {
183-
datum = unpack_datum!(bcx, add_env(bcx, def_id, expr, datum));
184-
}
185182
AdjustReifyFnPointer(_def_id) => {
186183
// FIXME(#19925) once fn item types are
187184
// zero-sized, we'll need to do something here

branches/auto/src/librustc_typeck/check/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1850,7 +1850,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18501850
span: Span,
18511851
adj: &ty::AutoAdjustment<'tcx>) {
18521852
match *adj {
1853-
ty::AdjustAddEnv(..) |
18541853
ty::AdjustReifyFnPointer(..) => {
18551854
}
18561855
ty::AdjustDerefRef(ref d_r) => {

branches/auto/src/librustc_typeck/check/writeback.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,6 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
266266
Some(adjustment) => {
267267
let adj_object = ty::adjust_is_object(&adjustment);
268268
let resolved_adjustment = match adjustment {
269-
ty::AdjustAddEnv(def_id, store) => {
270-
ty::AdjustAddEnv(def_id, self.resolve(&store, reason))
271-
}
272-
273269
ty::AdjustReifyFnPointer(def_id) => {
274270
ty::AdjustReifyFnPointer(def_id)
275271
}

0 commit comments

Comments
 (0)