Skip to content

Commit 1d418fc

Browse files
committed
---
yaml --- r: 13450 b: refs/heads/master c: ce750a7 h: refs/heads/master v: v3
1 parent 2227f55 commit 1d418fc

Some content is hidden

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

75 files changed

+630
-604
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: bdd20000665a35e14b4ec2c54f893fc80fe451ef
2+
refs/heads/master: ce750a7dbcd2dc68db6de89956b1de3ecf9f2d0a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/cargo/cargo.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ fn load_link(mis: [@ast::meta_item]) -> (option<str>,
224224
for mis.each {|a|
225225
alt a.node {
226226
ast::meta_name_value(v, {node: ast::lit_str(s), span: _}) {
227-
alt v {
228-
"name" { name = some(s); }
229-
"vers" { vers = some(s); }
230-
"uuid" { uuid = some(s); }
227+
alt *v {
228+
"name" { name = some(*s); }
229+
"vers" { vers = some(*s); }
230+
"uuid" { uuid = some(*s); }
231231
_ { }
232232
}
233233
}
@@ -259,15 +259,15 @@ fn load_crate(filename: str) -> option<crate> {
259259
for c.node.attrs.each {|a|
260260
alt a.node.value.node {
261261
ast::meta_name_value(v, {node: ast::lit_str(s), span: _}) {
262-
alt v {
263-
"desc" { desc = some(v); }
264-
"sigs" { sigs = some(v); }
265-
"crate_type" { crate_type = some(v); }
262+
alt *v {
263+
"desc" { desc = some(*v); }
264+
"sigs" { sigs = some(*v); }
265+
"crate_type" { crate_type = some(*v); }
266266
_ { }
267267
}
268268
}
269269
ast::meta_list(v, mis) {
270-
if v == "link" {
270+
if *v == "link" {
271271
let (n, v, u) = load_link(mis);
272272
name = n;
273273
vers = v;
@@ -290,7 +290,7 @@ fn load_crate(filename: str) -> option<crate> {
290290
ast::view_item_use(ident, metas, id) {
291291
let name_items = attr::find_meta_items_by_name(metas, "name");
292292
let m = if name_items.is_empty() {
293-
metas + [attr::mk_name_value_item_str("name", ident)]
293+
metas + [attr::mk_name_value_item_str(@"name", *ident)]
294294
} else {
295295
metas
296296
};
@@ -303,9 +303,9 @@ fn load_crate(filename: str) -> option<crate> {
303303
some(value) {
304304
let name = attr::get_meta_item_name(item);
305305

306-
alt name {
307-
"vers" { attr_vers = value; }
308-
"from" { attr_from = value; }
306+
alt *name {
307+
"vers" { attr_vers = *value; }
308+
"from" { attr_from = *value; }
309309
_ {}
310310
}
311311
}
@@ -317,11 +317,11 @@ fn load_crate(filename: str) -> option<crate> {
317317
attr_from
318318
} else {
319319
if !str::is_empty(attr_vers) {
320-
attr_name + "@" + attr_vers
321-
} else { attr_name }
320+
*attr_name + "@" + attr_vers
321+
} else { *attr_name }
322322
};
323323

324-
alt attr_name {
324+
alt *attr_name {
325325
"std" | "core" { }
326326
_ { e.deps += [query]; }
327327
}

trunk/src/fuzzer/fuzzer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn common_exprs() -> [ast::expr] {
4545
dse(ast::expr_cont),
4646
dse(ast::expr_fail(option::none)),
4747
dse(ast::expr_fail(option::some(
48-
@dse(ast::expr_lit(@dsl(ast::lit_str("boo"))))))),
48+
@dse(ast::expr_lit(@dsl(ast::lit_str(@"boo"))))))),
4949
dse(ast::expr_ret(option::none)),
5050
dse(ast::expr_lit(@dsl(ast::lit_nil))),
5151
dse(ast::expr_lit(@dsl(ast::lit_bool(false)))),

trunk/src/libstd/map.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import chained::hashmap;
44
export hashmap, hashfn, eqfn, set, map, chained, hashmap, str_hash;
5+
export box_str_hash;
56
export bytes_hash, int_hash, uint_hash, set_add;
67
export hash_from_vec, hash_from_strs, hash_from_bytes;
78
export hash_from_ints, hash_from_uints;
@@ -292,6 +293,11 @@ fn str_hash<V: copy>() -> hashmap<str, V> {
292293
ret hashmap(str::hash, str::eq);
293294
}
294295

296+
#[doc = "Construct a hashmap for boxed string keys"]
297+
fn box_str_hash<V: copy>() -> hashmap<@str, V> {
298+
ret hashmap({|x: @str|str::hash(*x)}, {|x,y|str::eq(*x,*y)});
299+
}
300+
295301
#[doc = "Construct a hashmap for byte string keys"]
296302
fn bytes_hash<V: copy>() -> hashmap<[u8], V> {
297303
ret hashmap(vec::u8::hash, vec::u8::eq);

trunk/src/libsyntax/ast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn deserialize_span<D>(_d: D) -> span {
3030
type spanned<T> = {node: T, span: span};
3131

3232
#[auto_serialize]
33-
type ident = str;
33+
type ident = @str;
3434

3535
// Functions may or may not have names.
3636
#[auto_serialize]
@@ -399,11 +399,11 @@ type lit = spanned<lit_>;
399399

400400
#[auto_serialize]
401401
enum lit_ {
402-
lit_str(str),
402+
lit_str(@str),
403403
lit_int(i64, int_ty),
404404
lit_uint(u64, uint_ty),
405405
lit_int_unsuffixed(i64, int_ty),
406-
lit_float(str, float_ty),
406+
lit_float(@str, float_ty),
407407
lit_nil,
408408
lit_bool(bool),
409409
}

trunk/src/libsyntax/ast_map.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ import ast_util::path_to_ident;
66
import ast_util::inlined_item_methods;
77
import diagnostic::span_handler;
88

9-
enum path_elt { path_mod(str), path_name(str) }
9+
enum path_elt { path_mod(ident), path_name(ident) }
1010
type path = [path_elt];
1111

1212
fn path_to_str_with_sep(p: path, sep: str) -> str {
1313
let strs = vec::map(p) {|e|
1414
alt e {
15-
path_mod(s) { /* FIXME: bad */ copy s }
16-
path_name(s) { /* FIXME: bad */ copy s }
15+
path_mod(s) { /* FIXME: bad */ copy *s }
16+
path_name(s) { /* FIXME: bad */ copy *s }
1717
}
1818
};
1919
str::connect(strs, sep)
2020
}
2121

2222
fn path_ident_to_str(p: path, i: ident) -> str {
2323
if vec::is_empty(p) {
24-
/* FIXME: bad */ copy i
24+
/* FIXME: bad */ copy *i
2525
} else {
26-
#fmt["%s::%s", path_to_str(p), i]
26+
#fmt["%s::%s", path_to_str(p), *i]
2727
}
2828
}
2929

@@ -59,7 +59,7 @@ type ctx = {map: map, mut path: path,
5959
mut local_id: uint, diag: span_handler};
6060
type vt = visit::vt<ctx>;
6161

62-
fn extend(cx: ctx, +elt: str) -> @path {
62+
fn extend(cx: ctx, +elt: ident) -> @path {
6363
@(cx.path + [path_name(elt)])
6464
}
6565

@@ -192,7 +192,7 @@ fn map_item(i: @item, cx: ctx, v: vt) {
192192
item_impl(_, _, _, _, ms) {
193193
let impl_did = ast_util::local_def(i.id);
194194
for ms.each {|m|
195-
map_method(impl_did, extend(cx, /* FIXME: bad */ copy i.ident), m,
195+
map_method(impl_did, extend(cx, i.ident), m,
196196
cx);
197197
}
198198
}
@@ -208,7 +208,7 @@ fn map_item(i: @item, cx: ctx, v: vt) {
208208
for vs.each {|v|
209209
cx.map.insert(v.node.id, node_variant(
210210
/* FIXME: bad */ copy v, i,
211-
extend(cx, /* FIXME: bad */ copy i.ident)));
211+
extend(cx, i.ident)));
212212
}
213213
}
214214
item_native_mod(nm) {
@@ -229,17 +229,17 @@ fn map_item(i: @item, cx: ctx, v: vt) {
229229
vec::iter(ifces) {|p| cx.map.insert(p.id,
230230
node_item(i, item_path)); };
231231
let d_id = ast_util::local_def(i.id);
232-
let p = extend(cx, /* FIXME: bad */ copy i.ident);
232+
let p = extend(cx, i.ident);
233233
// only need to handle methods
234234
vec::iter(ms) {|m| map_method(d_id, p, m, cx); }
235235
}
236236
_ { }
237237
}
238238
alt i.node {
239239
item_mod(_) | item_native_mod(_) {
240-
cx.path += [path_mod(/* FIXME: bad */ copy i.ident)];
240+
cx.path += [path_mod(i.ident)];
241241
}
242-
_ { cx.path += [path_name(/* FIXME: bad */ copy i.ident)]; }
242+
_ { cx.path += [path_name(i.ident)]; }
243243
}
244244
visit::visit_item(i, cx, v);
245245
vec::pop(cx.path);
@@ -281,11 +281,11 @@ fn node_id_to_str(map: map, id: node_id) -> str {
281281
}
282282
some(node_method(m, impl_did, path)) {
283283
#fmt["method %s in %s (id=%?)",
284-
m.ident, path_to_str(*path), id]
284+
*m.ident, path_to_str(*path), id]
285285
}
286286
some(node_variant(variant, def_id, path)) {
287287
#fmt["variant %s in %s (id=%?)",
288-
variant.node.name, path_to_str(*path), id]
288+
*variant.node.name, path_to_str(*path), id]
289289
}
290290
some(node_expr(expr)) {
291291
#fmt["expr %s (id=%?)",

trunk/src/libsyntax/ast_util.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ pure fn dummy_sp() -> span { ret mk_sp(0u, 0u); }
2323

2424
pure fn path_name(p: @path) -> str { path_name_i(p.idents) }
2525

26-
pure fn path_name_i(idents: [ident]) -> str { str::connect(idents, "::") }
26+
pure fn path_name_i(idents: [ident]) -> str {
27+
// FIXME: Bad copies
28+
str::connect(idents.map({|i|*i}), "::")
29+
}
2730

2831
pure fn path_to_ident(p: @path) -> ident { vec::last(p.idents) }
2932

@@ -380,7 +383,7 @@ fn dtor_dec() -> fn_decl {
380383
let nil_t = @{id: 0, node: ty_nil, span: dummy_sp()};
381384
// dtor has one argument, of type ()
382385
{inputs: [{mode: ast::expl(ast::by_ref),
383-
ty: nil_t, ident: "_", id: 0}],
386+
ty: nil_t, ident: @"_", id: 0}],
384387
output: nil_t, purity: impure_fn, cf: return_val, constraints: []}
385388
}
386389

0 commit comments

Comments
 (0)