Skip to content

Commit d26bc7f

Browse files
committed
---
yaml --- r: 106028 b: refs/heads/auto c: 9b1fee8 h: refs/heads/master v: v3
1 parent bca4233 commit d26bc7f

Some content is hidden

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

69 files changed

+742
-757
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 4fae06824ce1a3de3d24677196bf2e0d53346830
16+
refs/heads/auto: 9b1fee898f03b50113549b74da4c6d19eca4728e
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ fn truncated_hash_result(symbol_hasher: &mut Sha256) -> ~str {
534534

535535

536536
// This calculates STH for a symbol, as defined above
537-
fn symbol_hash(tcx: ty::ctxt, symbol_hasher: &mut Sha256,
537+
fn symbol_hash(tcx: &ty::ctxt, symbol_hasher: &mut Sha256,
538538
t: ty::t, link_meta: &LinkMeta) -> ~str {
539539
// NB: do *not* use abbrevs here as we want the symbol names
540540
// to be independent of one another in the crate.

branches/auto/src/librustc/driver/driver.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -327,60 +327,60 @@ pub fn phase_3_run_analysis_passes(sess: Session,
327327
freevars, region_map, lang_items);
328328

329329
// passes are timed inside typeck
330-
let (method_map, vtable_map) = typeck::check_crate(ty_cx, trait_map, krate);
330+
let (method_map, vtable_map) = typeck::check_crate(&ty_cx, trait_map, krate);
331331

332332
time(time_passes, "check static items", (), |_|
333-
middle::check_static::check_crate(ty_cx, krate));
333+
middle::check_static::check_crate(&ty_cx, krate));
334334

335335
// These next two const passes can probably be merged
336336
time(time_passes, "const marking", (), |_|
337-
middle::const_eval::process_crate(krate, ty_cx));
337+
middle::const_eval::process_crate(krate, &ty_cx));
338338

339339
time(time_passes, "const checking", (), |_|
340-
middle::check_const::check_crate(krate, def_map, method_map, ty_cx));
340+
middle::check_const::check_crate(krate, def_map, method_map, &ty_cx));
341341

342342
let maps = (external_exports, last_private_map);
343343
let (exported_items, public_items) =
344344
time(time_passes, "privacy checking", maps, |(a, b)|
345-
middle::privacy::check_crate(ty_cx, &method_map, &exp_map2,
345+
middle::privacy::check_crate(&ty_cx, &method_map, &exp_map2,
346346
a, b, krate));
347347

348348
time(time_passes, "effect checking", (), |_|
349-
middle::effect::check_crate(ty_cx, method_map, krate));
349+
middle::effect::check_crate(&ty_cx, method_map, krate));
350350

351351
time(time_passes, "loop checking", (), |_|
352-
middle::check_loop::check_crate(ty_cx, krate));
352+
middle::check_loop::check_crate(&ty_cx, krate));
353353

354354
let middle::moves::MoveMaps {moves_map, moved_variables_set,
355355
capture_map} =
356356
time(time_passes, "compute moves", (), |_|
357-
middle::moves::compute_moves(ty_cx, method_map, krate));
357+
middle::moves::compute_moves(&ty_cx, method_map, krate));
358358

359359
time(time_passes, "match checking", (), |_|
360-
middle::check_match::check_crate(ty_cx, method_map,
360+
middle::check_match::check_crate(&ty_cx, method_map,
361361
moves_map, krate));
362362

363363
time(time_passes, "liveness checking", (), |_|
364-
middle::liveness::check_crate(ty_cx, method_map,
364+
middle::liveness::check_crate(&ty_cx, method_map,
365365
capture_map, krate));
366366

367367
let root_map =
368368
time(time_passes, "borrow checking", (), |_|
369-
middle::borrowck::check_crate(ty_cx, method_map,
369+
middle::borrowck::check_crate(&ty_cx, method_map,
370370
moves_map, moved_variables_set,
371371
capture_map, krate));
372372

373373
time(time_passes, "kind checking", (), |_|
374-
kind::check_crate(ty_cx, method_map, krate));
374+
kind::check_crate(&ty_cx, method_map, krate));
375375

376376
let reachable_map =
377377
time(time_passes, "reachability checking", (), |_|
378-
reachable::find_reachable(ty_cx, method_map, &exported_items));
378+
reachable::find_reachable(&ty_cx, method_map, &exported_items));
379379

380380
{
381381
let reachable_map = reachable_map.borrow();
382382
time(time_passes, "death checking", (), |_| {
383-
middle::dead::check_crate(ty_cx,
383+
middle::dead::check_crate(&ty_cx,
384384
method_map,
385385
&exported_items,
386386
reachable_map.get(),
@@ -389,7 +389,7 @@ pub fn phase_3_run_analysis_passes(sess: Session,
389389
}
390390

391391
time(time_passes, "lint checking", (), |_|
392-
lint::check_crate(ty_cx, method_map, &exported_items, krate));
392+
lint::check_crate(&ty_cx, method_map, &exported_items, krate));
393393

394394
CrateAnalysis {
395395
exp_map2: exp_map2,
@@ -640,7 +640,7 @@ impl pprust::PpAnn for TypedAnnotation {
640640
}
641641
}
642642
fn post(&self, node: pprust::AnnNode) -> io::IoResult<()> {
643-
let tcx = self.analysis.ty_cx;
643+
let tcx = &self.analysis.ty_cx;
644644
match node {
645645
pprust::NodeExpr(s, expr) => {
646646
try!(pp::space(&mut s.s));

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub fn each_top_level_item_of_crate(cstore: @cstore::CStore,
8787
callback)
8888
}
8989

90-
pub fn get_item_path(tcx: ty::ctxt, def: ast::DefId) -> Vec<ast_map::PathElem> {
90+
pub fn get_item_path(tcx: &ty::ctxt, def: ast::DefId) -> Vec<ast_map::PathElem> {
9191
let cstore = tcx.cstore;
9292
let cdata = cstore.get_crate_data(def.krate);
9393
let path = decoder::get_item_path(cdata, def.node);
@@ -107,29 +107,29 @@ pub enum found_ast {
107107
// Finds the AST for this item in the crate metadata, if any. If the item was
108108
// not marked for inlining, then the AST will not be present and hence none
109109
// will be returned.
110-
pub fn maybe_get_item_ast(tcx: ty::ctxt, def: ast::DefId,
110+
pub fn maybe_get_item_ast(tcx: &ty::ctxt, def: ast::DefId,
111111
decode_inlined_item: decoder::DecodeInlinedItem)
112112
-> found_ast {
113113
let cstore = tcx.cstore;
114114
let cdata = cstore.get_crate_data(def.krate);
115115
decoder::maybe_get_item_ast(cdata, tcx, def.node, decode_inlined_item)
116116
}
117117

118-
pub fn get_enum_variants(tcx: ty::ctxt, def: ast::DefId)
118+
pub fn get_enum_variants(tcx: &ty::ctxt, def: ast::DefId)
119119
-> Vec<@ty::VariantInfo> {
120120
let cstore = tcx.cstore;
121121
let cdata = cstore.get_crate_data(def.krate);
122122
return decoder::get_enum_variants(cstore.intr, cdata, def.node, tcx)
123123
}
124124

125125
/// Returns information about the given implementation.
126-
pub fn get_impl(tcx: ty::ctxt, impl_def_id: ast::DefId)
126+
pub fn get_impl(tcx: &ty::ctxt, impl_def_id: ast::DefId)
127127
-> ty::Impl {
128128
let cdata = tcx.cstore.get_crate_data(impl_def_id.krate);
129129
decoder::get_impl(tcx.cstore.intr, cdata, impl_def_id.node, tcx)
130130
}
131131

132-
pub fn get_method(tcx: ty::ctxt, def: ast::DefId) -> ty::Method {
132+
pub fn get_method(tcx: &ty::ctxt, def: ast::DefId) -> ty::Method {
133133
let cdata = tcx.cstore.get_crate_data(def.krate);
134134
decoder::get_method(tcx.cstore.intr, cdata, def.node, tcx)
135135
}
@@ -154,15 +154,15 @@ pub fn get_item_variances(cstore: @cstore::CStore,
154154
decoder::get_item_variances(cdata, def.node)
155155
}
156156

157-
pub fn get_provided_trait_methods(tcx: ty::ctxt,
157+
pub fn get_provided_trait_methods(tcx: &ty::ctxt,
158158
def: ast::DefId)
159159
-> Vec<@ty::Method> {
160160
let cstore = tcx.cstore;
161161
let cdata = cstore.get_crate_data(def.krate);
162162
decoder::get_provided_trait_methods(cstore.intr, cdata, def.node, tcx)
163163
}
164164

165-
pub fn get_supertraits(tcx: ty::ctxt, def: ast::DefId) -> Vec<@ty::TraitRef> {
165+
pub fn get_supertraits(tcx: &ty::ctxt, def: ast::DefId) -> Vec<@ty::TraitRef> {
166166
let cstore = tcx.cstore;
167167
let cdata = cstore.get_crate_data(def.krate);
168168
decoder::get_supertraits(cdata, def.node, tcx)
@@ -195,21 +195,21 @@ pub fn get_struct_fields(cstore: @cstore::CStore,
195195
decoder::get_struct_fields(cstore.intr, cdata, def.node)
196196
}
197197

198-
pub fn get_type(tcx: ty::ctxt,
198+
pub fn get_type(tcx: &ty::ctxt,
199199
def: ast::DefId)
200200
-> ty::ty_param_bounds_and_ty {
201201
let cstore = tcx.cstore;
202202
let cdata = cstore.get_crate_data(def.krate);
203203
decoder::get_type(cdata, def.node, tcx)
204204
}
205205

206-
pub fn get_trait_def(tcx: ty::ctxt, def: ast::DefId) -> ty::TraitDef {
206+
pub fn get_trait_def(tcx: &ty::ctxt, def: ast::DefId) -> ty::TraitDef {
207207
let cstore = tcx.cstore;
208208
let cdata = cstore.get_crate_data(def.krate);
209209
decoder::get_trait_def(cdata, def.node, tcx)
210210
}
211211

212-
pub fn get_field_type(tcx: ty::ctxt, class_id: ast::DefId,
212+
pub fn get_field_type(tcx: &ty::ctxt, class_id: ast::DefId,
213213
def: ast::DefId) -> ty::ty_param_bounds_and_ty {
214214
let cstore = tcx.cstore;
215215
let cdata = cstore.get_crate_data(class_id.krate);
@@ -232,15 +232,15 @@ pub fn get_field_type(tcx: ty::ctxt, class_id: ast::DefId,
232232

233233
// Given a def_id for an impl, return the trait it implements,
234234
// if there is one.
235-
pub fn get_impl_trait(tcx: ty::ctxt,
235+
pub fn get_impl_trait(tcx: &ty::ctxt,
236236
def: ast::DefId) -> Option<@ty::TraitRef> {
237237
let cstore = tcx.cstore;
238238
let cdata = cstore.get_crate_data(def.krate);
239239
decoder::get_impl_trait(cdata, def.node, tcx)
240240
}
241241

242242
// Given a def_id for an impl, return information about its vtables
243-
pub fn get_impl_vtables(tcx: ty::ctxt,
243+
pub fn get_impl_vtables(tcx: &ty::ctxt,
244244
def: ast::DefId) -> typeck::impl_res {
245245
let cstore = tcx.cstore;
246246
let cdata = cstore.get_crate_data(def.krate);
@@ -295,7 +295,7 @@ pub fn each_implementation_for_trait(cstore: @cstore::CStore,
295295
/// the trait that the method belongs to. Otherwise, returns `None`.
296296
pub fn get_trait_of_method(cstore: @cstore::CStore,
297297
def_id: ast::DefId,
298-
tcx: ty::ctxt)
298+
tcx: &ty::ctxt)
299299
-> Option<ast::DefId> {
300300
let cdata = cstore.get_crate_data(def_id.krate);
301301
decoder::get_trait_of_method(cdata, def_id.node, tcx)

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -219,35 +219,35 @@ fn variant_disr_val(d: ebml::Doc) -> Option<ty::Disr> {
219219
})
220220
}
221221

222-
fn doc_type(doc: ebml::Doc, tcx: ty::ctxt, cdata: Cmd) -> ty::t {
222+
fn doc_type(doc: ebml::Doc, tcx: &ty::ctxt, cdata: Cmd) -> ty::t {
223223
let tp = reader::get_doc(doc, tag_items_data_item_type);
224224
parse_ty_data(tp.data, cdata.cnum, tp.start, tcx,
225225
|_, did| translate_def_id(cdata, did))
226226
}
227227

228-
fn doc_method_fty(doc: ebml::Doc, tcx: ty::ctxt, cdata: Cmd) -> ty::BareFnTy {
228+
fn doc_method_fty(doc: ebml::Doc, tcx: &ty::ctxt, cdata: Cmd) -> ty::BareFnTy {
229229
let tp = reader::get_doc(doc, tag_item_method_fty);
230230
parse_bare_fn_ty_data(tp.data, cdata.cnum, tp.start, tcx,
231231
|_, did| translate_def_id(cdata, did))
232232
}
233233

234234
pub fn item_type(_item_id: ast::DefId, item: ebml::Doc,
235-
tcx: ty::ctxt, cdata: Cmd) -> ty::t {
235+
tcx: &ty::ctxt, cdata: Cmd) -> ty::t {
236236
doc_type(item, tcx, cdata)
237237
}
238238

239-
fn doc_trait_ref(doc: ebml::Doc, tcx: ty::ctxt, cdata: Cmd) -> ty::TraitRef {
239+
fn doc_trait_ref(doc: ebml::Doc, tcx: &ty::ctxt, cdata: Cmd) -> ty::TraitRef {
240240
parse_trait_ref_data(doc.data, cdata.cnum, doc.start, tcx,
241241
|_, did| translate_def_id(cdata, did))
242242
}
243243

244-
fn item_trait_ref(doc: ebml::Doc, tcx: ty::ctxt, cdata: Cmd) -> ty::TraitRef {
244+
fn item_trait_ref(doc: ebml::Doc, tcx: &ty::ctxt, cdata: Cmd) -> ty::TraitRef {
245245
let tp = reader::get_doc(doc, tag_item_trait_ref);
246246
doc_trait_ref(tp, tcx, cdata)
247247
}
248248

249249
fn item_ty_param_defs(item: ebml::Doc,
250-
tcx: ty::ctxt,
250+
tcx: &ty::ctxt,
251251
cdata: Cmd,
252252
tag: uint)
253253
-> Rc<Vec<ty::TypeParameterDef> > {
@@ -378,7 +378,7 @@ fn item_to_def_like(item: ebml::Doc, did: ast::DefId, cnum: ast::CrateNum)
378378

379379
pub fn get_trait_def(cdata: Cmd,
380380
item_id: ast::NodeId,
381-
tcx: ty::ctxt) -> ty::TraitDef
381+
tcx: &ty::ctxt) -> ty::TraitDef
382382
{
383383
let item_doc = lookup_item(item_id, cdata.data());
384384
let tp_defs = item_ty_param_defs(item_doc, tcx, cdata,
@@ -403,7 +403,7 @@ pub fn get_trait_def(cdata: Cmd,
403403
}
404404
}
405405

406-
pub fn get_type(cdata: Cmd, id: ast::NodeId, tcx: ty::ctxt)
406+
pub fn get_type(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
407407
-> ty::ty_param_bounds_and_ty {
408408

409409
let item = lookup_item(id, cdata.data());
@@ -427,7 +427,7 @@ pub fn get_type_param_count(data: &[u8], id: ast::NodeId) -> uint {
427427

428428
pub fn get_impl_trait(cdata: Cmd,
429429
id: ast::NodeId,
430-
tcx: ty::ctxt) -> Option<@ty::TraitRef>
430+
tcx: &ty::ctxt) -> Option<@ty::TraitRef>
431431
{
432432
let item_doc = lookup_item(id, cdata.data());
433433
reader::maybe_get_doc(item_doc, tag_item_trait_ref).map(|tp| {
@@ -437,7 +437,7 @@ pub fn get_impl_trait(cdata: Cmd,
437437

438438
pub fn get_impl_vtables(cdata: Cmd,
439439
id: ast::NodeId,
440-
tcx: ty::ctxt) -> typeck::impl_res
440+
tcx: &ty::ctxt) -> typeck::impl_res
441441
{
442442
let item_doc = lookup_item(id, cdata.data());
443443
let vtables_doc = reader::get_doc(item_doc, tag_item_impl_vtables);
@@ -672,12 +672,12 @@ pub fn get_item_path(cdata: Cmd, id: ast::NodeId) -> Vec<ast_map::PathElem> {
672672
}
673673

674674
pub type DecodeInlinedItem<'a> = 'a |cdata: @cstore::crate_metadata,
675-
tcx: ty::ctxt,
676-
path: Vec<ast_map::PathElem> ,
675+
tcx: &ty::ctxt,
676+
path: Vec<ast_map::PathElem>,
677677
par_doc: ebml::Doc|
678678
-> Result<ast::InlinedItem, Vec<ast_map::PathElem> >;
679679

680-
pub fn maybe_get_item_ast(cdata: Cmd, tcx: ty::ctxt, id: ast::NodeId,
680+
pub fn maybe_get_item_ast(cdata: Cmd, tcx: &ty::ctxt, id: ast::NodeId,
681681
decode_inlined_item: DecodeInlinedItem)
682682
-> csearch::found_ast {
683683
debug!("Looking up item: {}", id);
@@ -702,7 +702,7 @@ pub fn maybe_get_item_ast(cdata: Cmd, tcx: ty::ctxt, id: ast::NodeId,
702702
}
703703

704704
pub fn get_enum_variants(intr: @IdentInterner, cdata: Cmd, id: ast::NodeId,
705-
tcx: ty::ctxt) -> Vec<@ty::VariantInfo> {
705+
tcx: &ty::ctxt) -> Vec<@ty::VariantInfo> {
706706
let data = cdata.data();
707707
let items = reader::get_doc(reader::Doc(data), tag_items);
708708
let item = find_item(id, items);
@@ -761,7 +761,7 @@ fn get_explicit_self(item: ebml::Doc) -> ast::ExplicitSelf_ {
761761
}
762762

763763
fn item_impl_methods(intr: @IdentInterner, cdata: Cmd, item: ebml::Doc,
764-
tcx: ty::ctxt) -> Vec<@ty::Method> {
764+
tcx: &ty::ctxt) -> Vec<@ty::Method> {
765765
let mut rslt = Vec::new();
766766
reader::tagged_docs(item, tag_item_impl_method, |doc| {
767767
let m_did = reader::with_doc_data(doc, parse_def_id);
@@ -774,7 +774,7 @@ fn item_impl_methods(intr: @IdentInterner, cdata: Cmd, item: ebml::Doc,
774774

775775
/// Returns information about the given implementation.
776776
pub fn get_impl(intr: @IdentInterner, cdata: Cmd, impl_id: ast::NodeId,
777-
tcx: ty::ctxt)
777+
tcx: &ty::ctxt)
778778
-> ty::Impl {
779779
let data = cdata.data();
780780
let impl_item = lookup_item(impl_id, data);
@@ -800,7 +800,7 @@ pub fn get_method_name_and_explicit_self(
800800
}
801801

802802
pub fn get_method(intr: @IdentInterner, cdata: Cmd, id: ast::NodeId,
803-
tcx: ty::ctxt) -> ty::Method
803+
tcx: &ty::ctxt) -> ty::Method
804804
{
805805
let method_doc = lookup_item(id, cdata.data());
806806
let def_id = item_def_id(method_doc, cdata);
@@ -858,7 +858,7 @@ pub fn get_item_variances(cdata: Cmd, id: ast::NodeId) -> ty::ItemVariances {
858858
}
859859

860860
pub fn get_provided_trait_methods(intr: @IdentInterner, cdata: Cmd,
861-
id: ast::NodeId, tcx: ty::ctxt) ->
861+
id: ast::NodeId, tcx: &ty::ctxt) ->
862862
Vec<@ty::Method> {
863863
let data = cdata.data();
864864
let item = lookup_item(id, data);
@@ -878,7 +878,7 @@ pub fn get_provided_trait_methods(intr: @IdentInterner, cdata: Cmd,
878878
}
879879

880880
/// Returns the supertraits of the given trait.
881-
pub fn get_supertraits(cdata: Cmd, id: ast::NodeId, tcx: ty::ctxt)
881+
pub fn get_supertraits(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
882882
-> Vec<@ty::TraitRef> {
883883
let mut results = Vec::new();
884884
let item_doc = lookup_item(id, cdata.data());
@@ -1235,7 +1235,7 @@ pub fn each_implementation_for_trait(cdata: Cmd,
12351235
});
12361236
}
12371237

1238-
pub fn get_trait_of_method(cdata: Cmd, id: ast::NodeId, tcx: ty::ctxt)
1238+
pub fn get_trait_of_method(cdata: Cmd, id: ast::NodeId, tcx: &ty::ctxt)
12391239
-> Option<ast::DefId> {
12401240
let item_doc = lookup_item(id, cdata.data());
12411241
let parent_item_id = match item_parent_item(item_doc) {

0 commit comments

Comments
 (0)