Skip to content

Commit 9fdc014

Browse files
committed
---
yaml --- r: 53245 b: refs/heads/dist-snap c: a2b7547 h: refs/heads/master i: 53243: 16f39c4 v: v3
1 parent 12c9ca4 commit 9fdc014

File tree

17 files changed

+131
-133
lines changed

17 files changed

+131
-133
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: 44d4d6de762f3f9aae1fedcf454c66b79b3ad58d
10-
refs/heads/dist-snap: 1808d747f65e43f9a8d40b9214e1221700f026d8
10+
refs/heads/dist-snap: a2b754788d5cef4b03eee0af6137e0195ef5680c
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/librustc/back/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,14 +466,14 @@ pub fn build_link_meta(sess: Session, c: &ast::crate, output: &Path,
466466
let linkage_metas = attr::find_linkage_metas(c.node.attrs);
467467
attr::require_unique_names(sess.diagnostic(), linkage_metas);
468468
for linkage_metas.each |meta| {
469-
if attr::get_meta_item_name(*meta) == ~"name" {
469+
if *attr::get_meta_item_name(*meta) == ~"name" {
470470
match attr::get_meta_item_value_str(*meta) {
471471
// Changing attr would avoid the need for the copy
472472
// here
473473
Some(v) => { name = Some(v.to_managed()); }
474474
None => cmh_items.push(*meta)
475475
}
476-
} else if attr::get_meta_item_name(*meta) == ~"vers" {
476+
} else if *attr::get_meta_item_name(*meta) == ~"vers" {
477477
match attr::get_meta_item_value_str(*meta) {
478478
Some(v) => { vers = Some(v.to_managed()); }
479479
None => cmh_items.push(*meta)

branches/dist-snap/src/librustc/driver/driver.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,24 @@ pub fn default_configuration(sess: Session, +argv0: ~str, input: input) ->
9797
};
9898

9999
return ~[ // Target bindings.
100-
attr::mk_word_item(str::from_slice(os::FAMILY)),
101-
mk(~"target_os", tos),
102-
mk(~"target_family", str::from_slice(os::FAMILY)),
103-
mk(~"target_arch", arch),
104-
mk(~"target_endian", end),
105-
mk(~"target_word_size", wordsz),
106-
mk(~"target_libc", libc),
100+
attr::mk_word_item(@str::from_slice(os::FAMILY)),
101+
mk(@~"target_os", @tos),
102+
mk(@~"target_family", @str::from_slice(os::FAMILY)),
103+
mk(@~"target_arch", @arch),
104+
mk(@~"target_endian", @end),
105+
mk(@~"target_word_size", @wordsz),
106+
mk(@~"target_libc", @libc),
107107
// Build bindings.
108-
mk(~"build_compiler", argv0),
109-
mk(~"build_input", source_name(input))];
108+
mk(@~"build_compiler", @argv0),
109+
mk(@~"build_input", @source_name(input))];
110110
}
111111

112112
pub fn append_configuration(+cfg: ast::crate_cfg, +name: ~str)
113113
-> ast::crate_cfg {
114114
if attr::contains_name(cfg, name) {
115115
cfg
116116
} else {
117-
vec::append_one(cfg, attr::mk_word_item(name))
117+
vec::append_one(cfg, attr::mk_word_item(@name))
118118
}
119119
}
120120

@@ -142,7 +142,7 @@ pub fn parse_cfgspecs(cfgspecs: ~[~str]) -> ast::crate_cfg {
142142
// meta_word variant.
143143
let mut words = ~[];
144144
for cfgspecs.each |s| {
145-
words.push(attr::mk_word_item(/*bad*/copy *s));
145+
words.push(attr::mk_word_item(@/*bad*/copy *s));
146146
}
147147
return words;
148148
}

branches/dist-snap/src/librustc/driver/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ pub fn building_library(req_crate_type: crate_type,
310310
match syntax::attr::first_attr_value_str_by_name(
311311
crate.node.attrs,
312312
~"crate_type") {
313-
option::Some(~"lib") => true,
313+
Some(@~"lib") => true,
314314
_ => false
315315
}
316316
}

branches/dist-snap/src/librustc/front/test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub fn modify_for_testing(sess: session::Session,
5757
// configuration, either with the '--test' or '--cfg test'
5858
// command line options.
5959
let should_test = attr::contains(crate.node.config,
60-
attr::mk_word_item(~"test"));
60+
attr::mk_word_item(@~"test"));
6161

6262
if should_test {
6363
generate_test_harness(sess, crate)
@@ -111,7 +111,7 @@ fn fold_mod(cx: @mut TestCtxt,
111111
fn nomain(cx: @mut TestCtxt, item: @ast::item) -> @ast::item {
112112
if !*cx.sess.building_library {
113113
@ast::item{attrs: item.attrs.filtered(|attr| {
114-
attr::get_attr_name(attr) != ~"main"
114+
*attr::get_attr_name(attr) != ~"main"
115115
}),.. copy *item}
116116
} else { item }
117117
}
@@ -310,7 +310,7 @@ fn mk_test_module(cx: &TestCtxt) -> @ast::item {
310310

311311
// This attribute tells resolve to let us call unexported functions
312312
let resolve_unexported_attr =
313-
attr::mk_attr(attr::mk_word_item(~"!resolve_unexported"));
313+
attr::mk_attr(attr::mk_word_item(@~"!resolve_unexported"));
314314

315315
let item = ast::item {
316316
ident: cx.sess.ident_of(~"__test"),
@@ -366,7 +366,7 @@ fn is_std(cx: &TestCtxt) -> bool {
366366
let is_std = {
367367
let items = attr::find_linkage_metas(cx.crate.node.attrs);
368368
match attr::last_meta_item_value_str_by_name(items, ~"name") {
369-
Some(~"std") => true,
369+
Some(@~"std") => true,
370370
_ => false
371371
}
372372
};

branches/dist-snap/src/librustc/metadata/creader.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn warn_if_multiple_versions(e: @mut Env,
105105
diag.span_note(match_.span, ~"used here");
106106
let attrs = ~[
107107
attr::mk_attr(attr::mk_list_item(
108-
~"link", /*bad*/copy *match_.metas))
108+
@~"link", /*bad*/copy *match_.metas))
109109
];
110110
loader::note_linkage_attrs(e.intr, diag, attrs);
111111
}
@@ -133,7 +133,7 @@ fn visit_crate(e: @mut Env, c: ast::crate) {
133133
for link_args.each |a| {
134134
match attr::get_meta_item_value_str(attr::attr_meta(*a)) {
135135
Some(ref linkarg) => {
136-
cstore::add_used_link_args(cstore, (/*bad*/copy *linkarg));
136+
cstore::add_used_link_args(cstore, **linkarg);
137137
}
138138
None => {/* fallthrough */ }
139139
}
@@ -173,21 +173,22 @@ fn visit_item(e: @mut Env, i: @ast::item) {
173173
match attr::first_attr_value_str_by_name(i.attrs,
174174
~"link_name") {
175175
Some(ref nn) => {
176-
if (*nn) == ~"" {
176+
if **nn == ~"" {
177177
e.diag.span_fatal(
178178
i.span,
179179
~"empty #[link_name] not allowed; use #[nolink].");
180180
}
181181
(/*bad*/copy *nn)
182182
}
183-
None => /*bad*/copy *e.intr.get(i.ident)
183+
None => @/*bad*/copy *e.intr.get(i.ident)
184184
};
185185
if attr::find_attrs_by_name(i.attrs, ~"nolink").is_empty() {
186186
already_added =
187-
!cstore::add_used_library(cstore, copy foreign_name);
187+
!cstore::add_used_library(cstore,
188+
/*bad*/ copy *foreign_name);
188189
}
189190
if !link_args.is_empty() && already_added {
190-
e.diag.span_fatal(i.span, ~"library '" + foreign_name +
191+
e.diag.span_fatal(i.span, ~"library '" + *foreign_name +
191192
~"' already added: can't specify link_args.");
192193
}
193194
}
@@ -197,7 +198,7 @@ fn visit_item(e: @mut Env, i: @ast::item) {
197198
for link_args.each |a| {
198199
match attr::get_meta_item_value_str(attr::attr_meta(*a)) {
199200
Some(ref linkarg) => {
200-
cstore::add_used_link_args(cstore, *linkarg);
201+
cstore::add_used_link_args(cstore, /*bad*/copy **linkarg);
201202
}
202203
None => {/* fallthrough */ }
203204
}
@@ -211,7 +212,7 @@ fn metas_with(+ident: ~str, +key: ~str, +metas: ~[@ast::meta_item])
211212
-> ~[@ast::meta_item] {
212213
let name_items = attr::find_meta_items_by_name(metas, key);
213214
if name_items.is_empty() {
214-
vec::append_one(metas, attr::mk_name_value_item_str(key, ident))
215+
vec::append_one(metas, attr::mk_name_value_item_str(@key, @ident))
215216
} else {
216217
metas
217218
}
@@ -276,9 +277,9 @@ fn resolve_crate(e: @mut Env,
276277
match attr::last_meta_item_value_str_by_name(load_ctxt.metas,
277278
~"name") {
278279
option::Some(ref v) => (/*bad*/copy *v),
279-
option::None => /*bad*/copy *e.intr.get(ident)
280+
option::None => @/*bad*/copy *e.intr.get(ident)
280281
};
281-
let cmeta = @{name: cname, data: cdata,
282+
let cmeta = @{name: /*bad*/copy *cname, data: cdata,
282283
cnum_map: cnum_map, cnum: cnum};
283284

284285
let cstore = e.cstore;

branches/dist-snap/src/librustc/metadata/decoder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ fn get_meta_items(md: ebml::Doc) -> ~[@ast::meta_item] {
962962
for reader::tagged_docs(md, tag_meta_item_word) |meta_item_doc| {
963963
let nd = reader::get_doc(meta_item_doc, tag_meta_item_name);
964964
let n = str::from_bytes(reader::doc_data(nd));
965-
items.push(attr::mk_word_item(n));
965+
items.push(attr::mk_word_item(@n));
966966
};
967967
for reader::tagged_docs(md, tag_meta_item_name_value) |meta_item_doc| {
968968
let nd = reader::get_doc(meta_item_doc, tag_meta_item_name);
@@ -971,13 +971,13 @@ fn get_meta_items(md: ebml::Doc) -> ~[@ast::meta_item] {
971971
let v = str::from_bytes(reader::doc_data(vd));
972972
// FIXME (#623): Should be able to decode meta_name_value variants,
973973
// but currently the encoder just drops them
974-
items.push(attr::mk_name_value_item_str(n, v));
974+
items.push(attr::mk_name_value_item_str(@n, @v));
975975
};
976976
for reader::tagged_docs(md, tag_meta_item_list) |meta_item_doc| {
977977
let nd = reader::get_doc(meta_item_doc, tag_meta_item_name);
978978
let n = str::from_bytes(reader::doc_data(nd));
979979
let subitems = get_meta_items(meta_item_doc);
980-
items.push(attr::mk_list_item(n, subitems));
980+
items.push(attr::mk_list_item(@n, subitems));
981981
};
982982
return items;
983983
}
@@ -1073,7 +1073,7 @@ pub fn get_crate_vers(data: @~[u8]) -> ~str {
10731073
let attrs = decoder::get_crate_attributes(data);
10741074
return match attr::last_meta_item_value_str_by_name(
10751075
attr::find_linkage_metas(attrs), ~"vers") {
1076-
Some(ref ver) => (/*bad*/copy *ver),
1076+
Some(ref ver) => (/*bad*/copy **ver),
10771077
None => ~"0.0"
10781078
};
10791079
}

branches/dist-snap/src/librustc/metadata/encoder.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,11 +1075,11 @@ fn synthesize_crate_attrs(ecx: @encode_ctxt, crate: &crate) -> ~[attribute] {
10751075
assert !ecx.link_meta.vers.is_empty();
10761076
10771077
let name_item =
1078-
attr::mk_name_value_item_str(~"name",
1079-
ecx.link_meta.name.to_owned());
1078+
attr::mk_name_value_item_str(@~"name",
1079+
@ecx.link_meta.name.to_owned());
10801080
let vers_item =
1081-
attr::mk_name_value_item_str(~"vers",
1082-
ecx.link_meta.vers.to_owned());
1081+
attr::mk_name_value_item_str(@~"vers",
1082+
@ecx.link_meta.vers.to_owned());
10831083
10841084
let other_items =
10851085
{
@@ -1088,7 +1088,7 @@ fn synthesize_crate_attrs(ecx: @encode_ctxt, crate: &crate) -> ~[attribute] {
10881088
};
10891089
10901090
let meta_items = vec::append(~[name_item, vers_item], other_items);
1091-
let link_item = attr::mk_list_item(~"link", meta_items);
1091+
let link_item = attr::mk_list_item(@~"link", meta_items);
10921092
10931093
return attr::mk_attr(link_item);
10941094
}
@@ -1097,7 +1097,7 @@ fn synthesize_crate_attrs(ecx: @encode_ctxt, crate: &crate) -> ~[attribute] {
10971097
let mut found_link_attr = false;
10981098
for crate.node.attrs.each |attr| {
10991099
attrs.push(
1100-
if attr::get_attr_name(attr) != ~"link" {
1100+
if *attr::get_attr_name(attr) != ~"link" {
11011101
/*bad*/copy *attr
11021102
} else {
11031103
match /*bad*/copy attr.node.value.node {

branches/dist-snap/src/librustc/metadata/loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ pub fn crate_name_from_metas(+metas: ~[@ast::meta_item]) -> ~str {
147147
match vec::last_opt(name_items) {
148148
Some(i) => {
149149
match attr::get_meta_item_value_str(i) {
150-
Some(ref n) => (/*bad*/copy *n),
150+
Some(ref n) => /*bad*/copy **n,
151151
// FIXME (#2406): Probably want a warning here since the user
152152
// is using the wrong type of meta item.
153153
_ => fail!()

branches/dist-snap/src/librustc/middle/trans/foreign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn abi_info(arch: session::arch) -> cabi::ABIInfo {
5050
pub fn link_name(ccx: @crate_ctxt, i: @ast::foreign_item) -> ~str {
5151
match attr::first_attr_value_str_by_name(i.attrs, ~"link_name") {
5252
None => ccx.sess.str_of(i.ident),
53-
option::Some(ref ln) => (/*bad*/copy *ln)
53+
option::Some(ref ln) => (/*bad*/copy **ln)
5454
}
5555
}
5656

branches/dist-snap/src/librustdoc/attr_parser.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ fn doc_metas(
6565

6666
pub fn parse_crate(attrs: ~[ast::attribute]) -> CrateAttrs {
6767
let link_metas = attr::find_linkage_metas(attrs);
68+
let name = attr::last_meta_item_value_str_by_name(link_metas, ~"name");
6869

6970
CrateAttrs {
70-
name: attr::last_meta_item_value_str_by_name(link_metas, ~"name")
71+
name: name.map(|s| copy **s)
7172
}
7273
}
7374

@@ -97,7 +98,7 @@ fn should_not_extract_crate_name_if_no_name_value_in_link_attribute() {
9798

9899
pub fn parse_desc(attrs: ~[ast::attribute]) -> Option<~str> {
99100
let doc_strs = do doc_metas(attrs).filter_mapped |meta| {
100-
attr::get_meta_item_value_str(*meta)
101+
attr::get_meta_item_value_str(*meta).map(|s| copy **s)
101102
};
102103
if doc_strs.is_empty() {
103104
None

branches/dist-snap/src/librustpkg/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn fold_mod(_ctx: @ReadyCtx, m: ast::_mod,
8181
fn strip_main(item: @ast::item) -> @ast::item {
8282
@ast::item {
8383
attrs: do item.attrs.filtered |attr| {
84-
attr::get_attr_name(*attr) != ~"main"
84+
*attr::get_attr_name(attr) != ~"main"
8585
},
8686
.. copy *item
8787
}
@@ -609,7 +609,7 @@ pub fn compile_input(sysroot: Option<Path>, input: driver::input, dir: &Path,
609609
let mut crate_cfg = options.cfg;
610610

611611
for cfgs.each |&cfg| {
612-
crate_cfg.push(attr::mk_word_item(cfg));
612+
crate_cfg.push(attr::mk_word_item(@cfg));
613613
}
614614

615615
let options = @{

0 commit comments

Comments
 (0)