Skip to content

Commit d87cad2

Browse files
committed
---
yaml --- r: 95071 b: refs/heads/dist-snap c: af3b132 h: refs/heads/master i: 95069: 41b2f39 95067: 34b8088 95063: d5039a7 95055: 15afef3 95039: efa6863 v: v3
1 parent 73af493 commit d87cad2

35 files changed

+343
-343
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 7e709bfd0dac1d5bbe5c97494980731b4d477e8f
9+
refs/heads/dist-snap: af3b132285bc9314d545cae2e4eaef079a26252a
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libextra/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ impl<T:Freeze + Send> RWArc<T> {
505505
let inner = x.unwrap();
506506
let RWArcInner { failed: failed, data: data, _ } = inner;
507507
if failed {
508-
fail2!(~"Can't unwrap poisoned RWArc - another task failed inside!")
508+
fail2!("Can't unwrap poisoned RWArc - another task failed inside!")
509509
}
510510
data
511511
}

branches/dist-snap/src/libextra/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ pub fn test_main(args: &[~str], tests: ~[TestDescAndFn]) {
125125
let opts =
126126
match parse_opts(args) {
127127
Some(Ok(o)) => o,
128-
Some(Err(msg)) => fail2!(msg),
128+
Some(Err(msg)) => fail2!("{}", msg),
129129
None => return
130130
};
131131
if !run_tests_console(&opts, tests) { fail2!("Some tests failed"); }

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl AbiSet {
221221
let data = abi.data();
222222
for other_abi in abis.slice(0, i).iter() {
223223
let other_data = other_abi.data();
224-
debug!("abis=(%?,%?) datas=(%?,%?)",
224+
debug2!("abis=({:?},{:?}) datas=({:?},{:?})",
225225
abi, data.abi_arch,
226226
other_abi, other_data.abi_arch);
227227
match (&data.abi_arch, &other_data.abi_arch) {
@@ -273,7 +273,7 @@ impl ToStr for AbiSet {
273273
strs.push(abi.data().name);
274274
true
275275
};
276-
fmt!("\"%s\"", strs.connect(" "))
276+
format!("\"{}\"", strs.connect(" "))
277277
}
278278
}
279279

@@ -306,7 +306,7 @@ fn cannot_combine(n: Abi, m: Abi) {
306306
(m == a && n == b));
307307
}
308308
None => {
309-
fail!("Invalid match not detected");
309+
fail2!("Invalid match not detected");
310310
}
311311
}
312312
}
@@ -318,7 +318,7 @@ fn can_combine(n: Abi, m: Abi) {
318318
set.add(m);
319319
match set.check_valid() {
320320
Some((_, _)) => {
321-
fail!("Valid match declared invalid");
321+
fail2!("Valid match declared invalid");
322322
}
323323
None => {}
324324
}
@@ -367,15 +367,15 @@ fn abi_to_str_c_aaps() {
367367
let mut set = AbiSet::empty();
368368
set.add(Aapcs);
369369
set.add(C);
370-
debug!("set = %s", set.to_str());
370+
debug2!("set = {}", set.to_str());
371371
assert!(set.to_str() == ~"\"aapcs C\"");
372372
}
373373

374374
#[test]
375375
fn abi_to_str_rust() {
376376
let mut set = AbiSet::empty();
377377
set.add(Rust);
378-
debug!("set = %s", set.to_str());
378+
debug2!("set = {}", set.to_str());
379379
assert!(set.to_str() == ~"\"Rust\"");
380380
}
381381

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ impl Eq for Ident {
4747
// if it should be non-hygienic (most things are), just compare the
4848
// 'name' fields of the idents. Or, even better, replace the idents
4949
// with Name's.
50-
fail!(fmt!("not allowed to compare these idents: %?, %?. Probably \
51-
related to issue #6993", self, other));
50+
fail2!("not allowed to compare these idents: {:?}, {:?}.
51+
Probably related to issue \\#6993", self, other);
5252
}
5353
}
5454
fn ne(&self, other: &Ident) -> bool {

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub fn path_ident_to_str(p: &path, i: Ident, itr: @ident_interner) -> ~str {
6666
if p.is_empty() {
6767
itr.get(i.name).to_owned()
6868
} else {
69-
fmt!("%s::%s", path_to_str(*p, itr), itr.get(i.name))
69+
format!("{}::{}", path_to_str(*p, itr), itr.get(i.name))
7070
}
7171
}
7272

@@ -96,7 +96,7 @@ pub fn impl_pretty_name(trait_ref: &Option<trait_ref>,
9696
// XXX: this dollar sign is actually a relic of being one of the
9797
// very few valid symbol names on unix. These kinds of
9898
// details shouldn't be exposed way up here in the ast.
99-
let s = fmt!("%s$%s",
99+
let s = format!("{}${}",
100100
itr.get(trait_ref.path.segments.last().identifier.name),
101101
itr.get(ty_ident.name));
102102
path_pretty_name(Ident::new(itr.gensym(s)), hash)
@@ -185,7 +185,7 @@ impl Ctx {
185185
item,
186186
p));
187187
}
188-
_ => fail!("struct def parent wasn't an item")
188+
_ => fail2!("struct def parent wasn't an item")
189189
}
190190
}
191191
}
@@ -426,7 +426,7 @@ pub fn map_decoded_item(diag: @mut span_handler,
426426
pub fn node_id_to_str(map: map, id: NodeId, itr: @ident_interner) -> ~str {
427427
match map.find(&id) {
428428
None => {
429-
fmt!("unknown node (id=%d)", id)
429+
format!("unknown node (id={})", id)
430430
}
431431
Some(&node_item(item, path)) => {
432432
let path_str = path_ident_to_str(path, item.ident, itr);
@@ -442,46 +442,46 @@ pub fn node_id_to_str(map: map, id: NodeId, itr: @ident_interner) -> ~str {
442442
item_impl(*) => ~"impl",
443443
item_mac(*) => ~"macro"
444444
};
445-
fmt!("%s %s (id=%?)", item_str, path_str, id)
445+
format!("{} {} (id={})", item_str, path_str, id)
446446
}
447447
Some(&node_foreign_item(item, abi, _, path)) => {
448-
fmt!("foreign item %s with abi %? (id=%?)",
448+
format!("foreign item {} with abi {:?} (id={})",
449449
path_ident_to_str(path, item.ident, itr), abi, id)
450450
}
451451
Some(&node_method(m, _, path)) => {
452-
fmt!("method %s in %s (id=%?)",
452+
format!("method {} in {} (id={})",
453453
itr.get(m.ident.name), path_to_str(*path, itr), id)
454454
}
455455
Some(&node_trait_method(ref tm, _, path)) => {
456456
let m = ast_util::trait_method_to_ty_method(&**tm);
457-
fmt!("method %s in %s (id=%?)",
457+
format!("method {} in {} (id={})",
458458
itr.get(m.ident.name), path_to_str(*path, itr), id)
459459
}
460460
Some(&node_variant(ref variant, _, path)) => {
461-
fmt!("variant %s in %s (id=%?)",
461+
format!("variant {} in {} (id={})",
462462
itr.get(variant.node.name.name), path_to_str(*path, itr), id)
463463
}
464464
Some(&node_expr(expr)) => {
465-
fmt!("expr %s (id=%?)", pprust::expr_to_str(expr, itr), id)
465+
format!("expr {} (id={})", pprust::expr_to_str(expr, itr), id)
466466
}
467467
Some(&node_callee_scope(expr)) => {
468-
fmt!("callee_scope %s (id=%?)", pprust::expr_to_str(expr, itr), id)
468+
format!("callee_scope {} (id={})", pprust::expr_to_str(expr, itr), id)
469469
}
470470
Some(&node_stmt(stmt)) => {
471-
fmt!("stmt %s (id=%?)",
471+
format!("stmt {} (id={})",
472472
pprust::stmt_to_str(stmt, itr), id)
473473
}
474474
Some(&node_arg(pat)) => {
475-
fmt!("arg %s (id=%?)", pprust::pat_to_str(pat, itr), id)
475+
format!("arg {} (id={})", pprust::pat_to_str(pat, itr), id)
476476
}
477477
Some(&node_local(ident)) => {
478-
fmt!("local (id=%?, name=%s)", id, itr.get(ident.name))
478+
format!("local (id={}, name={})", id, itr.get(ident.name))
479479
}
480480
Some(&node_block(ref block)) => {
481-
fmt!("block %s (id=%?)", pprust::block_to_str(block, itr), id)
481+
format!("block {} (id={})", pprust::block_to_str(block, itr), id)
482482
}
483483
Some(&node_struct_ctor(_, _, path)) => {
484-
fmt!("struct_ctor %s (id=%?)", path_to_str(*path, itr), id)
484+
format!("struct_ctor {} (id={})", path_to_str(*path, itr), id)
485485
}
486486
}
487487
}
@@ -491,6 +491,6 @@ pub fn node_item_query<Result>(items: map, id: NodeId,
491491
error_msg: ~str) -> Result {
492492
match items.find(&id) {
493493
Some(&node_item(it, _)) => query(it),
494-
_ => fail!(error_msg)
494+
_ => fail2!("{}", error_msg)
495495
}
496496
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub fn stmt_id(s: &Stmt) -> NodeId {
4545
StmtDecl(_, id) => id,
4646
StmtExpr(_, id) => id,
4747
StmtSemi(_, id) => id,
48-
StmtMac(*) => fail!("attempted to analyze unexpanded stmt")
48+
StmtMac(*) => fail2!("attempted to analyze unexpanded stmt")
4949
}
5050
}
5151

@@ -72,7 +72,7 @@ pub fn def_id_of_def(d: Def) -> DefId {
7272
local_def(id)
7373
}
7474

75-
DefPrimTy(_) => fail!()
75+
DefPrimTy(_) => fail2!()
7676
}
7777
}
7878

@@ -756,7 +756,7 @@ pub fn new_mark_internal(m:Mrk, tail:SyntaxContext,table:&mut SCTable)
756756
}
757757
true => {
758758
match table.mark_memo.find(&key) {
759-
None => fail!(~"internal error: key disappeared 2013042901"),
759+
None => fail2!("internal error: key disappeared 2013042901"),
760760
Some(idxptr) => {*idxptr}
761761
}
762762
}
@@ -783,7 +783,7 @@ pub fn new_rename_internal(id:Ident, to:Name, tail:SyntaxContext, table: &mut SC
783783
}
784784
true => {
785785
match table.rename_memo.find(&key) {
786-
None => fail!(~"internal error: key disappeared 2013042902"),
786+
None => fail2!("internal error: key disappeared 2013042902"),
787787
Some(idxptr) => {*idxptr}
788788
}
789789
}
@@ -816,9 +816,9 @@ pub fn get_sctable() -> @mut SCTable {
816816

817817
/// print out an SCTable for debugging
818818
pub fn display_sctable(table : &SCTable) {
819-
error!("SC table:");
819+
error2!("SC table:");
820820
for (idx,val) in table.table.iter().enumerate() {
821-
error!("%4u : %?",idx,val);
821+
error2!("{:4u} : {:?}",idx,val);
822822
}
823823
}
824824

@@ -880,7 +880,7 @@ pub fn resolve_internal(id : Ident,
880880
resolvedthis
881881
}
882882
}
883-
IllegalCtxt() => fail!(~"expected resolvable context, got IllegalCtxt")
883+
IllegalCtxt() => fail2!("expected resolvable context, got IllegalCtxt")
884884
}
885885
};
886886
resolve_table.insert(key,resolved);
@@ -921,7 +921,7 @@ pub fn marksof(ctxt: SyntaxContext, stopname: Name, table: &SCTable) -> ~[Mrk] {
921921
loopvar = tl;
922922
}
923923
}
924-
IllegalCtxt => fail!(~"expected resolvable context, got IllegalCtxt")
924+
IllegalCtxt => fail2!("expected resolvable context, got IllegalCtxt")
925925
}
926926
}
927927
}
@@ -932,7 +932,7 @@ pub fn mtwt_outer_mark(ctxt: SyntaxContext) -> Mrk {
932932
let sctable = get_sctable();
933933
match sctable.table[ctxt] {
934934
ast::Mark(mrk,_) => mrk,
935-
_ => fail!("can't retrieve outer mark when outside is not a mark")
935+
_ => fail2!("can't retrieve outer mark when outside is not a mark")
936936
}
937937
}
938938

@@ -1064,7 +1064,7 @@ mod test {
10641064
sc = tail;
10651065
loop;
10661066
}
1067-
IllegalCtxt => fail!("expected resolvable context, got IllegalCtxt")
1067+
IllegalCtxt => fail2!("expected resolvable context, got IllegalCtxt")
10681068
}
10691069
}
10701070
}

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,17 @@ pub fn mk_sugared_doc_attr(text: @str, lo: BytePos, hi: BytePos) -> Attribute {
168168
/// span included in the `==` comparison a plain MetaItem.
169169
pub fn contains(haystack: &[@ast::MetaItem],
170170
needle: @ast::MetaItem) -> bool {
171-
debug!("attr::contains (name=%s)", needle.name());
171+
debug2!("attr::contains (name={})", needle.name());
172172
do haystack.iter().any |item| {
173-
debug!(" testing: %s", item.name());
173+
debug2!(" testing: {}", item.name());
174174
item.node == needle.node
175175
}
176176
}
177177

178178
pub fn contains_name<AM: AttrMetaMethods>(metas: &[AM], name: &str) -> bool {
179-
debug!("attr::contains_name (name=%s)", name);
179+
debug2!("attr::contains_name (name={})", name);
180180
do metas.iter().any |item| {
181-
debug!(" testing: %s", item.name());
181+
debug2!(" testing: {}", item.name());
182182
name == item.name()
183183
}
184184
}
@@ -279,23 +279,23 @@ pub fn test_cfg<AM: AttrMetaMethods, It: Iterator<AM>>
279279
// this would be much nicer as a chain of iterator adaptors, but
280280
// this doesn't work.
281281
let some_cfg_matches = do metas.any |mi| {
282-
debug!("testing name: %s", mi.name());
282+
debug2!("testing name: {}", mi.name());
283283
if "cfg" == mi.name() { // it is a #[cfg()] attribute
284-
debug!("is cfg");
284+
debug2!("is cfg");
285285
no_cfgs = false;
286286
// only #[cfg(...)] ones are understood.
287287
match mi.meta_item_list() {
288288
Some(cfg_meta) => {
289-
debug!("is cfg(...)");
289+
debug2!("is cfg(...)");
290290
do cfg_meta.iter().all |cfg_mi| {
291-
debug!("cfg(%s[...])", cfg_mi.name());
291+
debug2!("cfg({}[...])", cfg_mi.name());
292292
match cfg_mi.node {
293293
ast::MetaList(s, ref not_cfgs) if "not" == s => {
294-
debug!("not!");
294+
debug2!("not!");
295295
// inside #[cfg(not(...))], so these need to all
296296
// not match.
297297
not_cfgs.iter().all(|mi| {
298-
debug!("cfg(not(%s[...]))", mi.name());
298+
debug2!("cfg(not({}[...]))", mi.name());
299299
!contains(cfg, *mi)
300300
})
301301
}
@@ -309,7 +309,7 @@ pub fn test_cfg<AM: AttrMetaMethods, It: Iterator<AM>>
309309
false
310310
}
311311
};
312-
debug!("test_cfg (no_cfgs=%?, some_cfg_matches=%?)", no_cfgs, some_cfg_matches);
312+
debug2!("test_cfg (no_cfgs={}, some_cfg_matches={})", no_cfgs, some_cfg_matches);
313313
no_cfgs || some_cfg_matches
314314
}
315315

@@ -359,7 +359,7 @@ pub fn require_unique_names(diagnostic: @mut span_handler,
359359

360360
if !set.insert(name) {
361361
diagnostic.span_fatal(meta.span,
362-
fmt!("duplicate meta item `%s`", name));
362+
format!("duplicate meta item `{}`", name));
363363
}
364364
}
365365
}

0 commit comments

Comments
 (0)