Skip to content

Commit cc16146

Browse files
committed
---
yaml --- r: 158637 b: refs/heads/try c: fba8656 h: refs/heads/master i: 158635: ef44a5d v: v3
1 parent 99c666d commit cc16146

Some content is hidden

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

84 files changed

+3855
-3613
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: a0a7ab461283322215f0343cd2b5e66fc19a7bd5
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 1b2ad7831f1745bf4a4709a1fa1772afb47c933c
5-
refs/heads/try: 49447195fd9031874c49b979800c81af23117b94
5+
refs/heads/try: fba86567a95ca5e8711f3cfd92e347a37281a92c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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: &ty::ctxt,
200-
symbol_hasher: &mut Sha256,
201-
t: Ty,
202-
link_meta: &LinkMeta)
203-
-> String {
199+
fn symbol_hash<'tcx>(tcx: &ty::ctxt<'tcx>,
200+
symbol_hasher: &mut Sha256,
201+
t: Ty<'tcx>,
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: &ty::ctxt,
219219
hash
220220
}
221221

222-
fn get_symbol_hash(ccx: &CrateContext, t: Ty) -> String {
222+
fn get_symbol_hash<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> 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(ccx: &CrateContext, path: PathElems,
324-
t: Ty, id: ast::NodeId) -> String {
323+
pub fn mangle_exported_name<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, path: PathElems,
324+
t: Ty<'tcx>, 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(ccx: &CrateContext, path: PathElems,
345345
exported_name(path, hash.as_slice())
346346
}
347347

348-
pub fn mangle_internal_name_by_type_and_seq(ccx: &CrateContext,
349-
t: Ty,
350-
name: &str) -> String {
348+
pub fn mangle_internal_name_by_type_and_seq<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
349+
t: Ty<'tcx>,
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::t_box_>,
371+
type_arena: &'tcx TypedArena<ty::TyS<'tcx>>,
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::t_box_>,
97+
type_arena: &'tcx TypedArena<ty::TyS<'tcx>>,
9898
id: String,
9999
payload: B,
100100
f: |&PrinterSupport, B| -> A) -> A {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,8 @@ declare_lint!(BOX_POINTERS, Allow,
471471
pub struct BoxPointers;
472472

473473
impl BoxPointers {
474-
fn check_heap_type(&self, cx: &Context, span: Span, ty: Ty) {
474+
fn check_heap_type<'a, 'tcx>(&self, cx: &Context<'a, 'tcx>,
475+
span: Span, ty: Ty<'tcx>) {
475476
let mut n_uniq = 0i;
476477
ty::fold_ty(cx.tcx, ty, |t| {
477478
match ty::get(t).sty {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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 {
548+
fn get_item_ty(&self, id: ast::DefId) -> ty::Polytype<'tcx> {
549549
ty::lookup_item_type(self.tcx, id)
550550
}
551551

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

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

560-
fn associated_types_of_trait_are_valid(&self, _: Ty, _: ast::DefId)
560+
fn associated_types_of_trait_are_valid(&self, _: Ty<'tcx>, _: 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>,
568+
_: Option<Ty<'tcx>>,
569569
trait_id: ast::DefId,
570570
associated_type_id: ast::DefId)
571-
-> Ty {
571+
-> Ty<'tcx> {
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,

branches/try/src/librustc/metadata/csearch.rs

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ pub fn get_enum_variant_defs(cstore: &cstore::CStore, enum_id: ast::DefId)
121121
decoder::get_enum_variant_defs(&*cstore.intr, &*cdata, enum_id.node)
122122
}
123123

124-
pub fn get_enum_variants(tcx: &ty::ctxt, def: ast::DefId)
125-
-> Vec<Rc<ty::VariantInfo>> {
124+
pub fn get_enum_variants<'tcx>(tcx: &ty::ctxt<'tcx>, def: ast::DefId)
125+
-> Vec<Rc<ty::VariantInfo<'tcx>>> {
126126
let cstore = &tcx.sess.cstore;
127127
let cdata = cstore.get_crate_data(def.krate);
128128
decoder::get_enum_variants(cstore.intr.clone(), &*cdata, def.node, tcx)
@@ -135,8 +135,8 @@ pub fn get_impl_items(cstore: &cstore::CStore, impl_def_id: ast::DefId)
135135
decoder::get_impl_items(&*cdata, impl_def_id.node)
136136
}
137137

138-
pub fn get_impl_or_trait_item(tcx: &ty::ctxt, def: ast::DefId)
139-
-> ty::ImplOrTraitItem {
138+
pub fn get_impl_or_trait_item<'tcx>(tcx: &ty::ctxt<'tcx>, def: ast::DefId)
139+
-> ty::ImplOrTraitItem<'tcx> {
140140
let cdata = tcx.sess.cstore.get_crate_data(def.krate);
141141
decoder::get_impl_or_trait_item(tcx.sess.cstore.intr.clone(),
142142
&*cdata,
@@ -164,15 +164,17 @@ pub fn get_item_variances(cstore: &cstore::CStore,
164164
decoder::get_item_variances(&*cdata, def.node)
165165
}
166166

167-
pub fn get_provided_trait_methods(tcx: &ty::ctxt,
168-
def: ast::DefId)
169-
-> Vec<Rc<ty::Method>> {
167+
pub fn get_provided_trait_methods<'tcx>(tcx: &ty::ctxt<'tcx>,
168+
def: ast::DefId)
169+
-> Vec<Rc<ty::Method<'tcx>>> {
170170
let cstore = &tcx.sess.cstore;
171171
let cdata = cstore.get_crate_data(def.krate);
172172
decoder::get_provided_trait_methods(cstore.intr.clone(), &*cdata, def.node, tcx)
173173
}
174174

175-
pub fn get_supertraits(tcx: &ty::ctxt, def: ast::DefId) -> Vec<Rc<ty::TraitRef>> {
175+
pub fn get_supertraits<'tcx>(tcx: &ty::ctxt<'tcx>,
176+
def: ast::DefId)
177+
-> Vec<Rc<ty::TraitRef<'tcx>>> {
176178
let cstore = &tcx.sess.cstore;
177179
let cdata = cstore.get_crate_data(def.krate);
178180
decoder::get_supertraits(&*cdata, def.node, tcx)
@@ -211,22 +213,22 @@ pub fn get_struct_field_attrs(cstore: &cstore::CStore, def: ast::DefId) -> HashM
211213
decoder::get_struct_field_attrs(&*cdata)
212214
}
213215

214-
pub fn get_type(tcx: &ty::ctxt,
215-
def: ast::DefId)
216-
-> ty::Polytype {
216+
pub fn get_type<'tcx>(tcx: &ty::ctxt<'tcx>,
217+
def: ast::DefId)
218+
-> ty::Polytype<'tcx> {
217219
let cstore = &tcx.sess.cstore;
218220
let cdata = cstore.get_crate_data(def.krate);
219221
decoder::get_type(&*cdata, def.node, tcx)
220222
}
221223

222-
pub fn get_trait_def(tcx: &ty::ctxt, def: ast::DefId) -> ty::TraitDef {
224+
pub fn get_trait_def<'tcx>(tcx: &ty::ctxt<'tcx>, def: ast::DefId) -> ty::TraitDef<'tcx> {
223225
let cstore = &tcx.sess.cstore;
224226
let cdata = cstore.get_crate_data(def.krate);
225227
decoder::get_trait_def(&*cdata, def.node, tcx)
226228
}
227229

228-
pub fn get_field_type(tcx: &ty::ctxt, class_id: ast::DefId,
229-
def: ast::DefId) -> ty::Polytype {
230+
pub fn get_field_type<'tcx>(tcx: &ty::ctxt<'tcx>, class_id: ast::DefId,
231+
def: ast::DefId) -> ty::Polytype<'tcx> {
230232
let cstore = &tcx.sess.cstore;
231233
let cdata = cstore.get_crate_data(class_id.krate);
232234
let all_items = reader::get_doc(rbml::Doc::new(cdata.data()), tag_items);
@@ -253,17 +255,18 @@ pub fn get_field_type(tcx: &ty::ctxt, class_id: ast::DefId,
253255

254256
// Given a def_id for an impl, return the trait it implements,
255257
// if there is one.
256-
pub fn get_impl_trait(tcx: &ty::ctxt,
257-
def: ast::DefId) -> Option<Rc<ty::TraitRef>> {
258+
pub fn get_impl_trait<'tcx>(tcx: &ty::ctxt<'tcx>,
259+
def: ast::DefId)
260+
-> Option<Rc<ty::TraitRef<'tcx>>> {
258261
let cstore = &tcx.sess.cstore;
259262
let cdata = cstore.get_crate_data(def.krate);
260263
decoder::get_impl_trait(&*cdata, def.node, tcx)
261264
}
262265

263266
// Given a def_id for an impl, return information about its vtables
264-
pub fn get_impl_vtables(tcx: &ty::ctxt,
265-
def: ast::DefId)
266-
-> typeck::vtable_res {
267+
pub fn get_impl_vtables<'tcx>(tcx: &ty::ctxt<'tcx>,
268+
def: ast::DefId)
269+
-> typeck::vtable_res<'tcx> {
267270
let cstore = &tcx.sess.cstore;
268271
let cdata = cstore.get_crate_data(def.krate);
269272
decoder::get_impl_vtables(&*cdata, def.node, tcx)

branches/try/src/librustc/metadata/decoder.rs

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -221,39 +221,44 @@ fn variant_disr_val(d: rbml::Doc) -> Option<ty::Disr> {
221221
})
222222
}
223223

224-
fn doc_type(doc: rbml::Doc, tcx: &ty::ctxt, cdata: Cmd) -> Ty {
224+
fn doc_type<'tcx>(doc: rbml::Doc, tcx: &ty::ctxt<'tcx>, cdata: Cmd) -> Ty<'tcx> {
225225
let tp = reader::get_doc(doc, tag_items_data_item_type);
226226
parse_ty_data(tp.data, cdata.cnum, tp.start, tcx,
227227
|_, did| translate_def_id(cdata, did))
228228
}
229229

230-
fn doc_method_fty(doc: rbml::Doc, tcx: &ty::ctxt, cdata: Cmd) -> ty::BareFnTy {
230+
fn doc_method_fty<'tcx>(doc: rbml::Doc, tcx: &ty::ctxt<'tcx>,
231+
cdata: Cmd) -> ty::BareFnTy<'tcx> {
231232
let tp = reader::get_doc(doc, tag_item_method_fty);
232233
parse_bare_fn_ty_data(tp.data, cdata.cnum, tp.start, tcx,
233234
|_, did| translate_def_id(cdata, did))
234235
}
235236

236-
pub fn item_type(_item_id: ast::DefId, item: rbml::Doc,
237-
tcx: &ty::ctxt, cdata: Cmd) -> Ty {
237+
pub fn item_type<'tcx>(_item_id: ast::DefId, item: rbml::Doc,
238+
tcx: &ty::ctxt<'tcx>, cdata: Cmd) -> Ty<'tcx> {
238239
doc_type(item, tcx, cdata)
239240
}
240241

241-
fn doc_trait_ref(doc: rbml::Doc, tcx: &ty::ctxt, cdata: Cmd) -> ty::TraitRef {
242+
fn doc_trait_ref<'tcx>(doc: rbml::Doc, tcx: &ty::ctxt<'tcx>, cdata: Cmd)
243+
-> ty::TraitRef<'tcx> {
242244
parse_trait_ref_data(doc.data, cdata.cnum, doc.start, tcx,
243245
|_, did| translate_def_id(cdata, did))
244246
}
245247

246-
fn item_trait_ref(doc: rbml::Doc, tcx: &ty::ctxt, cdata: Cmd) -> ty::TraitRef {
248+
fn item_trait_ref<'tcx>(doc: rbml::Doc, tcx: &ty::ctxt<'tcx>, cdata: Cmd)
249+
-> ty::TraitRef<'tcx> {
247250
let tp = reader::get_doc(doc, tag_item_trait_ref);
248251
doc_trait_ref(tp, tcx, cdata)
249252
}
250253

251-
fn doc_bounds(doc: rbml::Doc, tcx: &ty::ctxt, cdata: Cmd) -> ty::ParamBounds {
254+
fn doc_bounds<'tcx>(doc: rbml::Doc, tcx: &ty::ctxt<'tcx>, cdata: Cmd)
255+
-> ty::ParamBounds<'tcx> {
252256
parse_bounds_data(doc.data, cdata.cnum, doc.start, tcx,
253257
|_, did| translate_def_id(cdata, did))
254258
}
255259

256-
fn trait_def_bounds(doc: rbml::Doc, tcx: &ty::ctxt, cdata: Cmd) -> ty::ParamBounds {
260+
fn trait_def_bounds<'tcx>(doc: rbml::Doc, tcx: &ty::ctxt<'tcx>, cdata: Cmd)
261+
-> ty::ParamBounds<'tcx> {
257262
let d = reader::get_doc(doc, tag_trait_def_bounds);
258263
doc_bounds(d, tcx, cdata)
259264
}
@@ -350,9 +355,9 @@ fn item_to_def_like(item: rbml::Doc, did: ast::DefId, cnum: ast::CrateNum)
350355
}
351356
}
352357

353-
pub fn get_trait_def(cdata: Cmd,
354-
item_id: ast::NodeId,
355-
tcx: &ty::ctxt) -> ty::TraitDef
358+
pub fn get_trait_def<'tcx>(cdata: Cmd,
359+
item_id: ast::NodeId,
360+
tcx: &ty::ctxt<'tcx>) -> ty::TraitDef<'tcx>
356361
{
357362
let item_doc = lookup_item(item_id, cdata.data());
358363
let generics = doc_generics(item_doc, tcx, cdata, tag_item_generics);
@@ -365,8 +370,8 @@ pub fn get_trait_def(cdata: Cmd,
365370
}
366371
}
367372

368-
pub fn get_type(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
369-
-> ty::Polytype {
373+
pub fn get_type<'tcx>(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt<'tcx>)
374+
-> ty::Polytype<'tcx> {
370375

371376
let item = lookup_item(id, cdata.data());
372377

@@ -400,20 +405,21 @@ pub fn get_repr_attrs(cdata: Cmd, id: ast::NodeId) -> Vec<attr::ReprAttr> {
400405
}
401406
}
402407

403-
pub fn get_impl_trait(cdata: Cmd,
404-
id: ast::NodeId,
405-
tcx: &ty::ctxt) -> Option<Rc<ty::TraitRef>>
408+
pub fn get_impl_trait<'tcx>(cdata: Cmd,
409+
id: ast::NodeId,
410+
tcx: &ty::ctxt<'tcx>)
411+
-> Option<Rc<ty::TraitRef<'tcx>>>
406412
{
407413
let item_doc = lookup_item(id, cdata.data());
408414
reader::maybe_get_doc(item_doc, tag_item_trait_ref).map(|tp| {
409415
Rc::new(doc_trait_ref(tp, tcx, cdata))
410416
})
411417
}
412418

413-
pub fn get_impl_vtables(cdata: Cmd,
414-
id: ast::NodeId,
415-
tcx: &ty::ctxt)
416-
-> typeck::vtable_res
419+
pub fn get_impl_vtables<'tcx>(cdata: Cmd,
420+
id: ast::NodeId,
421+
tcx: &ty::ctxt<'tcx>)
422+
-> typeck::vtable_res<'tcx>
417423
{
418424
let item_doc = lookup_item(id, cdata.data());
419425
let vtables_doc = reader::get_doc(item_doc, tag_item_impl_vtables);
@@ -679,8 +685,8 @@ pub fn get_enum_variant_defs(intr: &IdentInterner,
679685
}).collect()
680686
}
681687

682-
pub fn get_enum_variants(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::NodeId,
683-
tcx: &ty::ctxt) -> Vec<Rc<ty::VariantInfo>> {
688+
pub fn get_enum_variants<'tcx>(intr: Rc<IdentInterner>, cdata: Cmd, id: ast::NodeId,
689+
tcx: &ty::ctxt<'tcx>) -> Vec<Rc<ty::VariantInfo<'tcx>>> {
684690
let data = cdata.data();
685691
let items = reader::get_doc(rbml::Doc::new(data), tag_items);
686692
let item = find_item(id, items);
@@ -783,11 +789,11 @@ pub fn get_trait_item_name_and_kind(intr: Rc<IdentInterner>,
783789
}
784790
}
785791

786-
pub fn get_impl_or_trait_item(intr: Rc<IdentInterner>,
787-
cdata: Cmd,
788-
id: ast::NodeId,
789-
tcx: &ty::ctxt)
790-
-> ty::ImplOrTraitItem {
792+
pub fn get_impl_or_trait_item<'tcx>(intr: Rc<IdentInterner>,
793+
cdata: Cmd,
794+
id: ast::NodeId,
795+
tcx: &ty::ctxt<'tcx>)
796+
-> ty::ImplOrTraitItem<'tcx> {
791797
let method_doc = lookup_item(id, cdata.data());
792798

793799
let def_id = item_def_id(method_doc, cdata);
@@ -857,11 +863,11 @@ pub fn get_item_variances(cdata: Cmd, id: ast::NodeId) -> ty::ItemVariances {
857863
Decodable::decode(&mut decoder).unwrap()
858864
}
859865

860-
pub fn get_provided_trait_methods(intr: Rc<IdentInterner>,
861-
cdata: Cmd,
862-
id: ast::NodeId,
863-
tcx: &ty::ctxt)
864-
-> Vec<Rc<ty::Method>> {
866+
pub fn get_provided_trait_methods<'tcx>(intr: Rc<IdentInterner>,
867+
cdata: Cmd,
868+
id: ast::NodeId,
869+
tcx: &ty::ctxt<'tcx>)
870+
-> Vec<Rc<ty::Method<'tcx>>> {
865871
let data = cdata.data();
866872
let item = lookup_item(id, data);
867873
let mut result = Vec::new();
@@ -889,8 +895,8 @@ pub fn get_provided_trait_methods(intr: Rc<IdentInterner>,
889895
}
890896

891897
/// Returns the supertraits of the given trait.
892-
pub fn get_supertraits(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
893-
-> Vec<Rc<ty::TraitRef>> {
898+
pub fn get_supertraits<'tcx>(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt<'tcx>)
899+
-> Vec<Rc<ty::TraitRef<'tcx>>> {
894900
let mut results = Vec::new();
895901
let item_doc = lookup_item(id, cdata.data());
896902
reader::tagged_docs(item_doc, tag_item_super_trait_ref, |trait_doc| {
@@ -1385,11 +1391,11 @@ pub fn is_typedef(cdata: Cmd, id: ast::NodeId) -> bool {
13851391
}
13861392
}
13871393

1388-
fn doc_generics(base_doc: rbml::Doc,
1389-
tcx: &ty::ctxt,
1390-
cdata: Cmd,
1391-
tag: uint)
1392-
-> ty::Generics
1394+
fn doc_generics<'tcx>(base_doc: rbml::Doc,
1395+
tcx: &ty::ctxt<'tcx>,
1396+
cdata: Cmd,
1397+
tag: uint)
1398+
-> ty::Generics<'tcx>
13931399
{
13941400
let doc = reader::get_doc(base_doc, tag);
13951401

0 commit comments

Comments
 (0)