Skip to content

Commit d8ae66e

Browse files
committed
---
yaml --- r: 36537 b: refs/heads/try2 c: 56ece46 h: refs/heads/master i: 36535: 4e5ba14 v: v3
1 parent b53342a commit d8ae66e

Some content is hidden

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

88 files changed

+938
-924
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 94be14516968501306f1ed95774a3f227956e809
8+
refs/heads/try2: 56ece46f7de9d1703dd39f952afac9bed22633b6
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,12 @@ fn build_link_meta(sess: Session, c: ast::crate, output: &Path,
412412
for linkage_metas.each |meta| {
413413
if attr::get_meta_item_name(*meta) == ~"name" {
414414
match attr::get_meta_item_value_str(*meta) {
415-
Some(v) => { name = Some(v); }
415+
Some(ref v) => { name = Some((*v)); }
416416
None => cmh_items.push(*meta)
417417
}
418418
} else if attr::get_meta_item_name(*meta) == ~"vers" {
419419
match attr::get_meta_item_value_str(*meta) {
420-
Some(v) => { vers = Some(v); }
420+
Some(ref v) => { vers = Some((*v)); }
421421
None => cmh_items.push(*meta)
422422
}
423423
} else { cmh_items.push(*meta); }
@@ -443,12 +443,12 @@ fn build_link_meta(sess: Session, c: ast::crate, output: &Path,
443443
symbol_hasher.reset();
444444
for cmh_items.each |m| {
445445
match m.node {
446-
ast::meta_name_value(key, value) => {
447-
symbol_hasher.write_str(len_and_str(key));
446+
ast::meta_name_value(ref key, value) => {
447+
symbol_hasher.write_str(len_and_str((*key)));
448448
symbol_hasher.write_str(len_and_str_lit(value));
449449
}
450-
ast::meta_word(name) => {
451-
symbol_hasher.write_str(len_and_str(name));
450+
ast::meta_word(ref name) => {
451+
symbol_hasher.write_str(len_and_str((*name)));
452452
}
453453
ast::meta_list(_, _) => {
454454
// FIXME (#607): Implement this
@@ -473,13 +473,13 @@ fn build_link_meta(sess: Session, c: ast::crate, output: &Path,
473473
fn crate_meta_name(sess: Session, _crate: ast::crate,
474474
output: &Path, metas: provided_metas) -> ~str {
475475
return match metas.name {
476-
Some(v) => v,
476+
Some(ref v) => (*v),
477477
None => {
478478
let name = match output.filestem() {
479479
None => sess.fatal(fmt!("output file name `%s` doesn't\
480480
appear to have a stem",
481481
output.to_str())),
482-
Some(s) => s
482+
Some(ref s) => (*s)
483483
};
484484
warn_missing(sess, ~"name", name);
485485
name
@@ -490,7 +490,7 @@ fn build_link_meta(sess: Session, c: ast::crate, output: &Path,
490490
fn crate_meta_vers(sess: Session, _crate: ast::crate,
491491
metas: provided_metas) -> ~str {
492492
return match metas.vers {
493-
Some(v) => v,
493+
Some(ref v) => (*v),
494494
None => {
495495
let vers = ~"0.0";
496496
warn_missing(sess, ~"vers", vers);
@@ -534,7 +534,7 @@ fn symbol_hash(tcx: ty::ctxt, symbol_hasher: &hash::State, t: ty::t,
534534

535535
fn get_symbol_hash(ccx: @crate_ctxt, t: ty::t) -> ~str {
536536
match ccx.type_hashcodes.find(t) {
537-
Some(h) => return h,
537+
Some(ref h) => return (*h),
538538
None => {
539539
let hash = symbol_hash(ccx.tcx, ccx.symbol_hasher, t, ccx.link_meta);
540540
ccx.type_hashcodes.insert(t, hash);

branches/try2/src/librustc/driver/driver.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn anon_src() -> ~str { ~"<anon>" }
3939
4040
fn source_name(input: input) -> ~str {
4141
match input {
42-
file_input(ifile) => ifile.to_str(),
42+
file_input(ref ifile) => (*ifile).to_str(),
4343
str_input(_) => anon_src()
4444
}
4545
}
@@ -121,13 +121,13 @@ enum input {
121121
fn parse_input(sess: Session, cfg: ast::crate_cfg, input: input)
122122
-> @ast::crate {
123123
match input {
124-
file_input(file) => {
125-
parse::parse_crate_from_file(&file, cfg, sess.parse_sess)
124+
file_input(ref file) => {
125+
parse::parse_crate_from_file(&(*file), cfg, sess.parse_sess)
126126
}
127-
str_input(src) => {
127+
str_input(ref src) => {
128128
// FIXME (#2319): Don't really want to box the source string
129129
parse::parse_crate_from_source_str(
130-
anon_src(), @src, cfg, sess.parse_sess)
130+
anon_src(), @(*src), cfg, sess.parse_sess)
131131
}
132132
}
133133
}
@@ -337,10 +337,10 @@ fn pretty_print_input(sess: Session, cfg: ast::crate_cfg, input: input,
337337
pp::space(s.s);
338338
pprust::synth_comment(s, int::to_str(item.id, 10u));
339339
}
340-
pprust::node_block(s, blk) => {
340+
pprust::node_block(s, ref blk) => {
341341
pp::space(s.s);
342342
pprust::synth_comment(s,
343-
~"block " + int::to_str(blk.node.id, 10u));
343+
~"block " + int::to_str((*blk).node.id, 10u));
344344
}
345345
pprust::node_expr(s, expr) => {
346346
pp::space(s.s);
@@ -563,7 +563,7 @@ fn build_session_options(binary: ~str,
563563
let target =
564564
match target_opt {
565565
None => host_triple(),
566-
Some(s) => s
566+
Some(ref s) => (*s)
567567
};
568568

569569
let addl_lib_search_paths =
@@ -743,15 +743,15 @@ fn build_output_filenames(input: input,
743743
// have to make up a name
744744
// We want to toss everything after the final '.'
745745
let dirpath = match *odir {
746-
Some(d) => d,
746+
Some(ref d) => (*d),
747747
None => match input {
748748
str_input(_) => os::getcwd(),
749-
file_input(ifile) => ifile.dir_path()
749+
file_input(ref ifile) => (*ifile).dir_path()
750750
}
751751
};
752752

753753
let stem = match input {
754-
file_input(ifile) => ifile.filestem().get(),
754+
file_input(ref ifile) => (*ifile).filestem().get(),
755755
str_input(_) => ~"rust_out"
756756
};
757757

@@ -764,12 +764,12 @@ fn build_output_filenames(input: input,
764764
}
765765
}
766766

767-
Some(out_file) => {
768-
out_path = out_file;
767+
Some(ref out_file) => {
768+
out_path = (*out_file);
769769
obj_path = if stop_after_codegen {
770-
out_file
770+
(*out_file)
771771
} else {
772-
out_file.with_filetype(obj_suffix)
772+
(*out_file).with_filetype(obj_suffix)
773773
};
774774

775775
if sess.building_library {

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ fn type_to_str(names: type_names, ty: TypeRef) -> ~str {
10861086
fn type_to_str_inner(names: type_names, outer0: ~[TypeRef], ty: TypeRef) ->
10871087
~str {
10881088
match type_has_name(names, ty) {
1089-
option::Some(n) => return n,
1089+
option::Some(ref n) => return (*n),
10901090
_ => {}
10911091
}
10921092

branches/try2/src/librustc/metadata/creader.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ fn visit_item(e: env, i: @ast::item) {
125125
if abi != ast::foreign_abi_cdecl &&
126126
abi != ast::foreign_abi_stdcall { return; }
127127
}
128-
either::Left(msg) => e.diag.span_fatal(i.span, msg)
128+
either::Left(ref msg) => e.diag.span_fatal(i.span, (*msg))
129129
}
130130

131131
let cstore = e.cstore;
@@ -137,13 +137,13 @@ fn visit_item(e: env, i: @ast::item) {
137137
let foreign_name =
138138
match attr::first_attr_value_str_by_name(i.attrs,
139139
~"link_name") {
140-
Some(nn) => {
141-
if nn == ~"" {
140+
Some(ref nn) => {
141+
if (*nn) == ~"" {
142142
e.diag.span_fatal(
143143
i.span,
144144
~"empty #[link_name] not allowed; use #[nolink].");
145145
}
146-
nn
146+
(*nn)
147147
}
148148
None => *e.intr.get(i.ident)
149149
};
@@ -161,8 +161,8 @@ fn visit_item(e: env, i: @ast::item) {
161161

162162
for link_args.each |a| {
163163
match attr::get_meta_item_value_str(attr::attr_meta(*a)) {
164-
Some(linkarg) => {
165-
cstore::add_used_link_args(cstore, linkarg);
164+
Some(ref linkarg) => {
165+
cstore::add_used_link_args(cstore, (*linkarg));
166166
}
167167
None => {/* fallthrough */ }
168168
}
@@ -236,7 +236,7 @@ fn resolve_crate(e: env, ident: ast::ident, metas: ~[@ast::meta_item],
236236

237237
let cname =
238238
match attr::last_meta_item_value_str_by_name(metas, ~"name") {
239-
option::Some(v) => v,
239+
option::Some(ref v) => (*v),
240240
option::None => *e.intr.get(ident)
241241
};
242242
let cmeta = @{name: cname, data: cdata,

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -603,15 +603,15 @@ fn maybe_get_item_ast(intr: @ident_interner, cdata: cmd, tcx: ty::ctxt,
603603
let item_doc = lookup_item(id, cdata.data);
604604
let path = vec::init(item_path(intr, item_doc));
605605
match decode_inlined_item(cdata, tcx, path, item_doc) {
606-
Some(ii) => csearch::found(ii),
606+
Some(ref ii) => csearch::found((*ii)),
607607
None => {
608608
match item_parent_item(item_doc) {
609609
Some(did) => {
610610
let did = translate_def_id(cdata, did);
611611
let parent_item = lookup_item(did.node, cdata.data);
612612
match decode_inlined_item(cdata, tcx, path,
613613
parent_item) {
614-
Some(ii) => csearch::found_parent(did, ii),
614+
Some(ref ii) => csearch::found_parent(did, (*ii)),
615615
None => csearch::not_found
616616
}
617617
}
@@ -635,7 +635,7 @@ fn get_enum_variants(intr: @ident_interner, cdata: cmd, id: ast::node_id,
635635
tcx, cdata);
636636
let name = item_name(intr, item);
637637
let arg_tys = match ty::get(ctor_ty).sty {
638-
ty::ty_fn(f) => f.sig.inputs.map(|a| a.ty),
638+
ty::ty_fn(ref f) => (*f).sig.inputs.map(|a| a.ty),
639639

640640
// Nullary enum variant.
641641
_ => ~[],
@@ -750,7 +750,7 @@ fn get_trait_methods(intr: @ident_interner, cdata: cmd, id: ast::node_id,
750750
let ty = doc_type(mth, tcx, cdata);
751751
let def_id = item_def_id(mth, cdata);
752752
let fty = match ty::get(ty).sty {
753-
ty::ty_fn(f) => f,
753+
ty::ty_fn(ref f) => (*f),
754754
_ => {
755755
tcx.diag.handler().bug(
756756
~"get_trait_methods: id has non-function type");
@@ -781,7 +781,7 @@ fn get_provided_trait_methods(intr: @ident_interner, cdata: cmd,
781781

782782
let fty;
783783
match ty::get(ty).sty {
784-
ty::ty_fn(f) => fty = f,
784+
ty::ty_fn(ref f) => fty = (*f),
785785
_ => {
786786
tcx.diag.handler().bug(~"get_provided_trait_methods(): id \
787787
has non-function type");
@@ -1104,7 +1104,7 @@ fn get_crate_vers(data: @~[u8]) -> ~str {
11041104
let attrs = decoder::get_crate_attributes(data);
11051105
return match attr::last_meta_item_value_str_by_name(
11061106
attr::find_linkage_metas(attrs), ~"vers") {
1107-
Some(ver) => ver,
1107+
Some(ref ver) => (*ver),
11081108
None => ~"0.0"
11091109
};
11101110
}

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ fn encode_type(ecx: @encode_ctxt, ebml_w: Writer::Serializer, typ: ty::t) {
218218
fn encode_symbol(ecx: @encode_ctxt, ebml_w: Writer::Serializer, id: node_id) {
219219
ebml_w.start_tag(tag_items_data_item_symbol);
220220
let sym = match ecx.item_symbols.find(id) {
221-
Some(x) => x,
221+
Some(ref x) => (*x),
222222
None => {
223223
ecx.diag.handler().bug(
224224
fmt!("encode_symbol: id not found %d", id));
@@ -341,9 +341,9 @@ fn encode_info_for_mod(ecx: @encode_ctxt, ebml_w: Writer::Serializer,
341341
// Encode the reexports of this module.
342342
debug!("(encoding info for module) encoding reexports for %d", id);
343343
match ecx.reexports2.find(id) {
344-
Some(exports) => {
344+
Some(ref exports) => {
345345
debug!("(encoding info for module) found reexports for %d", id);
346-
for exports.each |exp| {
346+
for (*exports).each |exp| {
347347
debug!("(encoding info for module) reexport '%s' for %d",
348348
exp.name, id);
349349
ebml_w.start_tag(tag_items_data_item_reexport);
@@ -483,8 +483,8 @@ fn encode_info_for_ctor(ecx: @encode_ctxt, ebml_w: Writer::Serializer,
483483
encode_type(ecx, ebml_w, its_ty);
484484
encode_path(ecx, ebml_w, path, ast_map::path_name(ident));
485485
match item {
486-
Some(it) => {
487-
(ecx.encode_inlined_item)(ecx, ebml_w, path, it);
486+
Some(ref it) => {
487+
(ecx.encode_inlined_item)(ecx, ebml_w, path, (*it));
488488
}
489489
None => {
490490
encode_symbol(ecx, ebml_w, id);
@@ -622,23 +622,23 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: Writer::Serializer,
622622
encode_region_param(ecx, ebml_w, item);
623623
ebml_w.end_tag();
624624
}
625-
item_enum(enum_definition, tps) => {
625+
item_enum(ref enum_definition, tps) => {
626626
add_to_index();
627627
do ebml_w.wr_tag(tag_items_data_item) {
628628
encode_def_id(ebml_w, local_def(item.id));
629629
encode_family(ebml_w, 't');
630630
encode_type_param_bounds(ebml_w, ecx, tps);
631631
encode_type(ecx, ebml_w, node_id_to_type(tcx, item.id));
632632
encode_name(ecx, ebml_w, item.ident);
633-
for enum_definition.variants.each |v| {
633+
for (*enum_definition).variants.each |v| {
634634
encode_variant_id(ebml_w, local_def(v.node.id));
635635
}
636636
(ecx.encode_inlined_item)(ecx, ebml_w, path, ii_item(item));
637637
encode_path(ecx, ebml_w, path, ast_map::path_name(item.ident));
638638
encode_region_param(ecx, ebml_w, item);
639639
}
640640
encode_enum_variant_info(ecx, ebml_w, item.id,
641-
enum_definition.variants, path, index, tps);
641+
(*enum_definition).variants, path, index, tps);
642642
}
643643
item_class(struct_def, tps) => {
644644
/* First, encode the fields and methods
@@ -764,7 +764,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: Writer::Serializer,
764764
vec::append(tps, m.tps));
765765
}
766766
}
767-
item_trait(tps, traits, ms) => {
767+
item_trait(tps, traits, ref ms) => {
768768
let provided_methods = dvec::DVec();
769769

770770
add_to_index();
@@ -778,12 +778,12 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: Writer::Serializer,
778778
encode_attributes(ebml_w, item.attrs);
779779
let mut i = 0u;
780780
for vec::each(*ty::trait_methods(tcx, local_def(item.id))) |mty| {
781-
match ms[i] {
782-
required(ty_m) => {
781+
match (*ms)[i] {
782+
required(ref ty_m) => {
783783
ebml_w.start_tag(tag_item_trait_method);
784-
encode_def_id(ebml_w, local_def(ty_m.id));
784+
encode_def_id(ebml_w, local_def((*ty_m).id));
785785
encode_name(ecx, ebml_w, mty.ident);
786-
encode_type_param_bounds(ebml_w, ecx, ty_m.tps);
786+
encode_type_param_bounds(ebml_w, ecx, (*ty_m).tps);
787787
encode_type(ecx, ebml_w, ty::mk_fn(tcx, mty.fty));
788788
encode_family(ebml_w, purity_fn_family(mty.fty.meta.purity));
789789
encode_self_type(ebml_w, mty.self_ty);
@@ -816,7 +816,7 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: Writer::Serializer,
816816
// method info, we output static methods with type signatures as
817817
// written. Here, we output the *real* type signatures. I feel like
818818
// maybe we should only ever handle the real type signatures.
819-
for vec::each(ms) |m| {
819+
for vec::each((*ms)) |m| {
820820
let ty_m = ast_util::trait_method_to_ty_method(*m);
821821
if ty_m.self_ty.node != ast::sty_static { loop; }
822822

@@ -971,19 +971,19 @@ fn write_int(writer: io::Writer, &&n: int) {
971971

972972
fn encode_meta_item(ebml_w: Writer::Serializer, mi: meta_item) {
973973
match mi.node {
974-
meta_word(name) => {
974+
meta_word(ref name) => {
975975
ebml_w.start_tag(tag_meta_item_word);
976976
ebml_w.start_tag(tag_meta_item_name);
977-
ebml_w.writer.write(str::to_bytes(name));
977+
ebml_w.writer.write(str::to_bytes((*name)));
978978
ebml_w.end_tag();
979979
ebml_w.end_tag();
980980
}
981-
meta_name_value(name, value) => {
981+
meta_name_value(ref name, value) => {
982982
match value.node {
983983
lit_str(value) => {
984984
ebml_w.start_tag(tag_meta_item_name_value);
985985
ebml_w.start_tag(tag_meta_item_name);
986-
ebml_w.writer.write(str::to_bytes(name));
986+
ebml_w.writer.write(str::to_bytes((*name)));
987987
ebml_w.end_tag();
988988
ebml_w.start_tag(tag_meta_item_value);
989989
ebml_w.writer.write(str::to_bytes(*value));
@@ -993,10 +993,10 @@ fn encode_meta_item(ebml_w: Writer::Serializer, mi: meta_item) {
993993
_ => {/* FIXME (#623): encode other variants */ }
994994
}
995995
}
996-
meta_list(name, items) => {
996+
meta_list(ref name, items) => {
997997
ebml_w.start_tag(tag_meta_item_list);
998998
ebml_w.start_tag(tag_meta_item_name);
999-
ebml_w.writer.write(str::to_bytes(name));
999+
ebml_w.writer.write(str::to_bytes((*name)));
10001000
ebml_w.end_tag();
10011001
for items.each |inner_item| {
10021002
encode_meta_item(ebml_w, **inner_item);

0 commit comments

Comments
 (0)