Skip to content

Commit 16f39c4

Browse files
committed
---
yaml --- r: 53243 b: refs/heads/dist-snap c: 27e235b h: refs/heads/master i: 53241: f2b3302 53239: 0a280bc v: v3
1 parent a7fffab commit 16f39c4

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
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: 1a5b8e4aba6b28670116897774afde88cf5bee11
10+
refs/heads/dist-snap: 27e235b64a78ccae92639833c6701d4d22077e1c
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn anon_src() -> ~str { ~"<anon>" }
6262
6363
pub fn source_name(input: input) -> ~str {
6464
match input {
65-
file_input(ref ifile) => (*ifile).to_str(),
65+
file_input(ref ifile) => ifile.to_str(),
6666
str_input(_) => anon_src()
6767
}
6868
}
@@ -112,9 +112,9 @@ pub fn default_configuration(sess: Session, +argv0: ~str, input: input) ->
112112
pub fn append_configuration(+cfg: ast::crate_cfg, +name: ~str)
113113
-> ast::crate_cfg {
114114
if attr::contains_name(cfg, name) {
115-
return cfg;
115+
cfg
116116
} else {
117-
return vec::append_one(cfg, attr::mk_word_item(name));
117+
vec::append_one(cfg, attr::mk_word_item(name))
118118
}
119119
}
120120

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ fn encode_crate_deps(ecx: @encode_ctxt,
11241124
type numdep = decoder::crate_dep;
11251125
11261126
// Pull the cnums and name,vers,hash out of cstore
1127-
let mut deps: ~[numdep] = ~[];
1127+
let mut deps = ~[];
11281128
do cstore::iter_crate_data(cstore) |key, val| {
11291129
let dep = {cnum: key,
11301130
name: ecx.tcx.sess.ident_of(/*bad*/copy val.name),
@@ -1134,10 +1134,7 @@ fn encode_crate_deps(ecx: @encode_ctxt,
11341134
};
11351135
11361136
// Sort by cnum
1137-
pure fn lteq(kv1: &numdep, kv2: &numdep) -> bool {
1138-
kv1.cnum <= kv2.cnum
1139-
}
1140-
std::sort::quick_sort(deps, lteq);
1137+
std::sort::quick_sort(deps, |kv1, kv2| kv1.cnum <= kv2.cnum);
11411138
11421139
// Sanity-check the crate numbers
11431140
let mut expected_cnum = 1;
@@ -1147,7 +1144,7 @@ fn encode_crate_deps(ecx: @encode_ctxt,
11471144
}
11481145
11491146
// mut -> immutable hack for vec::map
1150-
return vec::slice(deps, 0u, vec::len(deps)).to_vec();
1147+
deps.slice(0, deps.len())
11511148
}
11521149
11531150
// We're just going to write a list of crate 'name-hash-version's, with

branches/dist-snap/src/libsyntax/attr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ pub fn sort_meta_items(+items: ~[@ast::meta_item]) -> ~[@ast::meta_item] {
267267
}
268268

269269
// This is sort of stupid here, converting to a vec of mutables and back
270-
let mut v: ~[@ast::meta_item] = items;
270+
let mut v = items;
271271
std::sort::quick_sort(v, lteq);
272272

273273
// There doesn't seem to be a more optimal way to do this
@@ -371,7 +371,7 @@ pub fn require_unique_names(diagnostic: span_handler,
371371
let name = get_meta_item_name(*meta);
372372

373373
// FIXME: How do I silence the warnings? --pcw (#2619)
374-
if !set.insert(name) {
374+
if !set.insert(copy name) {
375375
diagnostic.span_fatal(meta.span,
376376
fmt!("duplicate meta item `%s`", name));
377377
}

branches/dist-snap/src/libsyntax/ext/expand.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use core::prelude::*;
1313
use ast::{crate, expr_, expr_mac, mac_invoc_tt};
1414
use ast::{tt_delim, tt_tok, item_mac, stmt_, stmt_mac, stmt_expr, stmt_semi};
1515
use ast;
16+
use attr;
1617
use codemap::{span, ExpandedFrom};
1718
use ext::base::*;
1819
use fold::*;
@@ -99,11 +100,8 @@ pub fn expand_mod_items(exts: HashMap<~str, SyntaxExtension>, cx: ext_ctxt,
99100
// the item into a new set of items.
100101
let new_items = do vec::flat_map(module_.items) |item| {
101102
do vec::foldr(item.attrs, ~[*item]) |attr, items| {
102-
let mname = match attr.node.value.node {
103-
ast::meta_word(ref n) => (*n),
104-
ast::meta_name_value(ref n, _) => (*n),
105-
ast::meta_list(ref n, _) => (*n)
106-
};
103+
let mname = attr::get_attr_name(attr);
104+
107105
match exts.find(&mname) {
108106
None | Some(NormalTT(_)) | Some(ItemTT(*)) => items,
109107
Some(ItemDecorator(dec_fn)) => {

0 commit comments

Comments
 (0)