Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

`m1!{...}` -> `m1!(...)`

  • Loading branch information...
commit 29f32b4a7298b0807408658bc8add1de8a06ab12 1 parent 226fd87
@paulstansifer paulstansifer authored
Showing with 4,912 additions and 2,288 deletions.
  1. +74 −74 src/cargo/cargo.rs
  2. +17 −17 src/compiletest/compiletest.rs
  3. +1 −1  src/compiletest/errors.rs
  4. +2 −2 src/compiletest/header.rs
  5. +31 −31 src/compiletest/runtest.rs
  6. +1 −1  src/compiletest/util.rs
  7. +1 −1  src/fuzzer/ast_match.rs
  8. +18 −18 src/fuzzer/fuzzer.rs
  9. +2 −2 src/libcore/extfmt.rs
  10. +4 −4 src/libcore/future.rs
  11. +16 −16 src/libcore/hash.rs
  12. +4 −4 src/libcore/int-template.rs
  13. +6 −6 src/libcore/io.rs
  14. +3 −3 src/libcore/iter.rs
  15. +1 −1  src/libcore/os.rs
  16. +23 −23 src/libcore/pipes.rs
  17. +1 −1  src/libcore/priv.rs
  18. +1 −1  src/libcore/rand.rs
  19. +1 −1  src/libcore/result.rs
  20. +3 −3 src/libcore/run.rs
  21. +6 −6 src/libcore/send_map.rs
  22. +3 −3 src/libcore/stackwalk.rs
  23. +4 −4 src/libcore/str.rs
  24. +2 −2 src/libcore/task.rs
  25. +11 −11 src/libstd/deque.rs
  26. +34 −34 src/libstd/ebml.rs
  27. +1 −1  src/libstd/getopts.rs
  28. +1 −1  src/libstd/json.rs
  29. +47 −47 src/libstd/map.rs
  30. +23 −23 src/libstd/net_ip.rs
  31. +69 −69 src/libstd/net_tcp.rs
  32. +4 −4 src/libstd/par.rs
  33. +15 −15 src/libstd/prettyprint.rs
  34. +2 −2 src/libstd/smallintmap.rs
  35. +1 −1  src/libstd/sort.rs
  36. +10 −10 src/libstd/test.rs
  37. +34 −34 src/libstd/time.rs
  38. +4 −4 src/libstd/timer.rs
  39. +16 −16 src/libstd/uv_global_loop.rs
  40. +11 −11 src/libstd/uv_iotask.rs
  41. +84 −84 src/libstd/uv_ll.rs
  42. +20 −20 src/libsyntax/ast_map.rs
  43. +1 −1  src/libsyntax/attr.rs
  44. +6 −6 src/libsyntax/codemap.rs
  45. +9 −9 src/libsyntax/diagnostic.rs
  46. +5 −5 src/libsyntax/ext/auto_serialize.rs
  47. +6 −6 src/libsyntax/ext/base.rs
  48. +11 −11 src/libsyntax/ext/expand.rs
  49. +25 −25 src/libsyntax/ext/fmt.rs
  50. +6 −6 src/libsyntax/ext/pipes/check.rs
  51. +8 −8 src/libsyntax/ext/pipes/liveness.rs
  52. +19 −19 src/libsyntax/ext/pipes/pipec.rs
  53. +2 −2 src/libsyntax/ext/pipes/proto.rs
  54. +2 −2 src/libsyntax/ext/qquote.rs
  55. +2 −2 src/libsyntax/ext/simplext.rs
  56. +3 −3 src/libsyntax/ext/source_util.rs
  57. +4 −4 src/libsyntax/ext/tt/earley_parser.rs
  58. +4 −4 src/libsyntax/ext/tt/transcribe.rs
  59. +10 −10 src/libsyntax/parse/comments.rs
  60. +1 −1  src/libsyntax/parse/common.rs
  61. +5 −5 src/libsyntax/parse/eval.rs
  62. +8 −8 src/libsyntax/parse/lexer.rs
  63. +23 −23 src/libsyntax/parse/parser.rs
  64. +37 −37 src/libsyntax/print/pp.rs
  65. +2 −2 src/libsyntax/print/pprust.rs
  66. +19 −19 src/rustc/back/link.rs
  67. +14 −14 src/rustc/back/rpath.rs
  68. +6 −6 src/rustc/driver/driver.rs
  69. +13 −13 src/rustc/driver/rustc.rs
  70. +1 −1  src/rustc/front/intrinsic_inject.rs
  71. +9 −9 src/rustc/front/test.rs
  72. +1 −1  src/rustc/lib/llvm.rs
  73. +11 −11 src/rustc/metadata/creader.rs
  74. +7 −7 src/rustc/metadata/csearch.rs
  75. +3 −3 src/rustc/metadata/cstore.rs
  76. +19 −19 src/rustc/metadata/decoder.rs
  77. +15 −15 src/rustc/metadata/encoder.rs
  78. +6 −6 src/rustc/metadata/filesearch.rs
  79. +15 −15 src/rustc/metadata/loader.rs
  80. +9 −9 src/rustc/metadata/tydecode.rs
  81. +4 −4 src/rustc/metadata/tyencode.rs
  82. +18 −18 src/rustc/middle/astencode.rs
  83. +19 −19 src/rustc/middle/borrowck.rs
  84. +29 −29 src/rustc/middle/borrowck/check_loans.rs
  85. +6 −6 src/rustc/middle/borrowck/gather_loans.rs
  86. +2 −2 src/rustc/middle/borrowck/loan.rs
  87. +6 −6 src/rustc/middle/borrowck/preserve.rs
  88. +6 −6 src/rustc/middle/capture.rs
  89. +3 −3 src/rustc/middle/kind.rs
  90. +3 −3 src/rustc/middle/lang_items.rs
  91. +13 −13 src/rustc/middle/lint.rs
  92. +47 −47 src/rustc/middle/liveness.rs
  93. +29 −29 src/rustc/middle/mem_categorization.rs
  94. +17 −17 src/rustc/middle/region.rs
  95. +180 −180 src/rustc/middle/resolve3.rs
  96. +80 −80 src/rustc/middle/trans/base.rs
  97. +6 −6 src/rustc/middle/trans/build.rs
  98. +16 −16 src/rustc/middle/trans/closure.rs
  99. +14 −14 src/rustc/middle/trans/common.rs
  100. +2 −2 src/rustc/middle/trans/debuginfo.rs
  101. +2 −2 src/rustc/middle/trans/foreign.rs
  102. +2 −2 src/rustc/middle/trans/reachable.rs
  103. +6 −6 src/rustc/middle/trans/reflect.rs
  104. +6 −6 src/rustc/middle/trans/tvec.rs
  105. +4 −4 src/rustc/middle/trans/type_of.rs
  106. +2 −2 src/rustc/middle/trans/type_use.rs
  107. +2 −2 src/rustc/middle/trans/uniq.rs
  108. +76 −0 src/rustc/middle/tstate/annotate.rs
  109. +990 −0 src/rustc/middle/tstate/auxiliary.rs
  110. +153 −0 src/rustc/middle/tstate/ck.rs
  111. +165 −0 src/rustc/middle/tstate/collect_locals.rs
  112. +617 −0 src/rustc/middle/tstate/pre_post_conditions.rs
  113. +623 −0 src/rustc/middle/tstate/states.rs
  114. +46 −46 src/rustc/middle/ty.rs
  115. +3 −3 src/rustc/middle/typeck.rs
  116. +11 −11 src/rustc/middle/typeck/astconv.rs
  117. +68 −68 src/rustc/middle/typeck/check.rs
  118. +18 −18 src/rustc/middle/typeck/check/alt.rs
  119. +33 −33 src/rustc/middle/typeck/check/method.rs
  120. +6 −6 src/rustc/middle/typeck/check/regionck.rs
  121. +7 −7 src/rustc/middle/typeck/check/regionmanip.rs
  122. +10 −10 src/rustc/middle/typeck/check/vtable.rs
  123. +10 −10 src/rustc/middle/typeck/check/writeback.rs
  124. +26 −26 src/rustc/middle/typeck/coherence.rs
  125. +16 −16 src/rustc/middle/typeck/collect.rs
  126. +16 −16 src/rustc/middle/typeck/infer.rs
  127. +9 −9 src/rustc/middle/typeck/infer/assignment.rs
  128. +6 −6 src/rustc/middle/typeck/infer/combine.rs
  129. +4 −4 src/rustc/middle/typeck/infer/glb.rs
  130. +1 −1  src/rustc/middle/typeck/infer/integral.rs
  131. +8 −8 src/rustc/middle/typeck/infer/lattice.rs
  132. +4 −4 src/rustc/middle/typeck/infer/lub.rs
  133. +7 −7 src/rustc/middle/typeck/infer/resolve.rs
  134. +7 −7 src/rustc/middle/typeck/infer/sub.rs
  135. +5 −5 src/rustc/middle/typeck/infer/to_str.rs
  136. +24 −24 src/rustc/middle/typeck/infer/unify.rs
  137. +4 −4 src/rustc/util/common.rs
  138. +22 −22 src/rustc/util/ppaux.rs
  139. +1 −1  src/rustdoc/attr_parser.rs
  140. +4 −4 src/rustdoc/config.rs
  141. +24 −24 src/rustdoc/markdown_pass.rs
  142. +5 −5 src/rustdoc/markdown_writer.rs
  143. +3 −3 src/rustdoc/rustdoc.rs
  144. +2 −2 src/rustdoc/tystr_pass.rs
  145. +3 −3 src/test/auxiliary/cci_class_4.rs
  146. +3 −3 src/test/auxiliary/cci_class_cast.rs
  147. +1 −1  src/test/auxiliary/extern-crosscrate-source.rs
  148. +1 −1  src/test/auxiliary/issue_2242_b.rs
  149. +1 −1  src/test/auxiliary/issue_2242_c.rs
  150. +2 −2 src/test/auxiliary/test_comm.rs
  151. +8 −8 src/test/bench/core-std.rs
  152. +10 −10 src/test/bench/core-vec-append.rs
  153. +21 −21 src/test/bench/graph500-bfs.rs
  154. +10 −10 src/test/bench/msgsend-pipes-shared.rs
  155. +10 −10 src/test/bench/msgsend-pipes.rs
  156. +6 −6 src/test/bench/msgsend-ring-mutex-arcs.rs
  157. +7 −7 src/test/bench/msgsend-ring-pipes.rs
  158. +6 −6 src/test/bench/msgsend-ring-rw-arcs.rs
  159. +4 −4 src/test/bench/msgsend-ring.rs
  160. +4 −4 src/test/bench/msgsend.rs
  161. +19 −19 src/test/bench/pingpong.rs
  162. +1 −1  src/test/bench/shootout-ackermann.rs
  163. +6 −6 src/test/bench/shootout-binarytrees.rs
  164. +1 −1  src/test/bench/shootout-chameneos-redux.rs
  165. +2 −2 src/test/bench/shootout-fannkuchredux.rs
  166. +1 −1  src/test/bench/shootout-fibo.rs
  167. +8 −8 src/test/bench/shootout-k-nucleotide-pipes.rs
  168. +8 −8 src/test/bench/shootout-k-nucleotide.rs
  169. +5 −5 src/test/bench/shootout-mandelbrot.rs
  170. +2 −2 src/test/bench/shootout-nbody.rs
  171. +3 −3 src/test/bench/shootout-pfib.rs
  172. +1 −1  src/test/bench/shootout-spectralnorm.rs
  173. +2 −2 src/test/bench/shootout-threadring.rs
  174. +4 −4 src/test/bench/std-smallintmap.rs
  175. +2 −2 src/test/bench/sudoku.rs
  176. +3 −3 src/test/bench/task-perf-alloc-unwind.rs
  177. +1 −1  src/test/bench/task-perf-one-million.rs
  178. +8 −8 src/test/bench/task-perf-word-count-generic.rs
  179. +2 −2 src/test/compile-fail/assign-imm-local-twice.rs
  180. +1 −1  src/test/compile-fail/assign-to-method.rs
  181. +1 −1  src/test/compile-fail/attr-before-ext.rs
  182. +2 −2 src/test/compile-fail/bogus-tag.rs
  183. +2 −2 src/test/compile-fail/borrowck-loan-blocks-move-cc.rs
  184. +3 −3 src/test/compile-fail/class-cast-to-trait.rs
  185. +1 −1  src/test/compile-fail/class-missing-self.rs
  186. +1 −1  src/test/compile-fail/dead-code-ret.rs
  187. +1 −1  src/test/compile-fail/does-nothing.rs
  188. +1 −1  src/test/compile-fail/export2.rs
  189. +1 −1  src/test/compile-fail/ext-after-attrib.rs
  190. +1 −1  src/test/compile-fail/ext-nonexistent.rs
  191. +1 −1  src/test/compile-fail/extenv-no-args.rs
  192. +1 −1  src/test/compile-fail/extenv-not-string-literal.rs
  193. +1 −1  src/test/compile-fail/extenv-too-many-args.rs
  194. +1 −1  src/test/compile-fail/extfmt-missing-type.rs
  195. +1 −1  src/test/compile-fail/extfmt-no-args.rs
  196. +1 −1  src/test/compile-fail/extfmt-non-literal.rs
  197. +1 −1  src/test/compile-fail/extfmt-non-literal2.rs
  198. +1 −1  src/test/compile-fail/extfmt-not-enough-args.rs
  199. +1 −1  src/test/compile-fail/extfmt-too-many-args.rs
  200. +1 −1  src/test/compile-fail/extfmt-unknown-type.rs
  201. +1 −1  src/test/compile-fail/extfmt-unsigned-plus.rs
  202. +1 −1  src/test/compile-fail/extfmt-unsigned-space.rs
  203. +1 −1  src/test/compile-fail/extfmt-unterminated-conv.rs
  204. +1 −1  src/test/compile-fail/for-loop-decl.rs
  205. +4 −4 src/test/compile-fail/import-glob-0.rs
  206. +2 −2 src/test/compile-fail/import-glob-circular.rs
  207. +1 −1  src/test/compile-fail/import.rs
  208. +1 −1  src/test/compile-fail/import2.rs
  209. +1 −1  src/test/compile-fail/import3.rs
  210. +1 −1  src/test/compile-fail/import4.rs
  211. +1 −1  src/test/compile-fail/issue-1448-1.rs
  212. +1 −1  src/test/compile-fail/issue-1448-2.rs
  213. +1 −1  src/test/compile-fail/liveness-if-with-else.rs
  214. +1 −1  src/test/compile-fail/liveness-while-break.rs
  215. +1 −1  src/test/compile-fail/macro-2.rs
  216. +1 −1  src/test/compile-fail/macro.rs
  217. +1 −1  src/test/compile-fail/not-utf8.rs
  218. +1 −1  src/test/compile-fail/pure-higher-order.rs
  219. +1 −1  src/test/compile-fail/regions-addr-of-self.rs
  220. +1 −1  src/test/compile-fail/regions-escape-via-trait-or-not.rs
  221. +1 −1  src/test/compile-fail/regions-ret-borrowed-1.rs
  222. +1 −1  src/test/compile-fail/regions-ret-borrowed.rs
  223. +1 −1  src/test/compile-fail/unbalanced-comment.rs
  224. +1 −1  src/test/pretty/block-arg-disambig.rs
  225. +2 −2 src/test/run-fail/bug-2470-bounds-check-overflow-2.rs
  226. +4 −4 src/test/run-fail/bug-2470-bounds-check-overflow-3.rs
  227. +6 −6 src/test/run-fail/bug-2470-bounds-check-overflow.rs
  228. +1 −1  src/test/run-fail/extern-fail.rs
  229. +1 −1  src/test/run-fail/fmt-fail.rs
  230. +1 −1  src/test/run-pass-fulldeps/qquote.rs
  231. +2 −2 src/test/run-pass/acyclic-unwind.rs
  232. +1 −1  src/test/run-pass/alignment-gep-tup-like-1.rs
  233. +1 −1  src/test/run-pass/alignment-gep-tup-like-2.rs
  234. +1 −1  src/test/run-pass/alt-join.rs
  235. +1 −1  src/test/run-pass/alt-pattern-drop.rs
  236. +2 −2 src/test/run-pass/alt-pattern-lit.rs
  237. +1 −1  src/test/run-pass/alt-pattern-no-type-params.rs
  238. +3 −3 src/test/run-pass/alt-tag.rs
  239. +1 −1  src/test/run-pass/alt-unique-bind.rs
  240. +1 −1  src/test/run-pass/auto_serialize.rs
  241. +7 −7 src/test/run-pass/basic-1.rs
  242. +7 −7 src/test/run-pass/basic-2.rs
  243. +12 −12 src/test/run-pass/basic.rs
  244. +2 −2 src/test/run-pass/binops.rs
  245. +2 −2 src/test/run-pass/borrowck-mut-uniq.rs
  246. +1 −1  src/test/run-pass/borrowck-preserve-box-in-discr.rs
  247. +1 −1  src/test/run-pass/borrowck-preserve-box-in-field.rs
  248. +1 −1  src/test/run-pass/borrowck-preserve-box-in-pat.rs
  249. +1 −1  src/test/run-pass/borrowck-preserve-box-in-uniq.rs
  250. +1 −1  src/test/run-pass/borrowck-preserve-box.rs
  251. +2 −2 src/test/run-pass/borrowck-preserve-cond-box.rs
  252. +1 −1  src/test/run-pass/borrowck-preserve-expl-deref.rs
  253. +1 −1  src/test/run-pass/box-inside-if.rs
  254. +1 −1  src/test/run-pass/box-inside-if2.rs
  255. +1 −1  src/test/run-pass/box-unbox.rs
  256. +1 −1  src/test/run-pass/by-val-and-by-move.rs
  257. +1 −1  src/test/run-pass/cast-region-to-uint.rs
  258. +1 −1  src/test/run-pass/cci_borrow.rs
  259. +3 −3 src/test/run-pass/cci_impl_exe.rs
  260. +2 −2 src/test/run-pass/cci_iter_exe.rs
  261. +3 −3 src/test/run-pass/cci_no_inline_exe.rs
  262. +1 −1  src/test/run-pass/class-attributes-1.rs
  263. +1 −1  src/test/run-pass/class-attributes-2.rs
  264. +1 −1  src/test/run-pass/class-cast-to-trait-cross-crate-2.rs
  265. +4 −4 src/test/run-pass/class-cast-to-trait-cross-crate.rs
  266. +3 −3 src/test/run-pass/class-cast-to-trait-multiple-types.rs
  267. +3 −3 src/test/run-pass/class-cast-to-trait.rs
  268. +3 −3 src/test/run-pass/class-impl-parameterized-trait.rs
  269. +3 −3 src/test/run-pass/class-impl-very-parameterized-trait.rs
  270. +3 −3 src/test/run-pass/class-implement-trait-cross-crate.rs
  271. +3 −3 src/test/run-pass/class-implement-traits.rs
  272. +6 −6 src/test/run-pass/class-implements-multiple-traits.rs
  273. +4 −4 src/test/run-pass/class-separate-impl.rs
  274. +3 −3 src/test/run-pass/classes.rs
  275. +1 −1  src/test/run-pass/close-over-big-then-small-data.rs
  276. +3 −3 src/test/run-pass/comm.rs
  277. +1 −1  src/test/run-pass/complex.rs
  278. +1 −1  src/test/run-pass/const-rec-and-tup.rs
  279. +2 −2 src/test/run-pass/const-struct.rs
  280. +1 −1  src/test/run-pass/dead-code-one-arm-if.rs
  281. +1 −1  src/test/run-pass/export-non-interference2.rs
  282. +1 −1  src/test/run-pass/export-non-interference3.rs
  283. +2 −2 src/test/run-pass/extern-call-deep.rs
  284. +2 −2 src/test/run-pass/extern-call-deep2.rs
  285. +2 −2 src/test/run-pass/extern-call-scrub.rs
  286. +2 −2 src/test/run-pass/extern-call.rs
  287. +2 −2 src/test/run-pass/extern-crosscrate.rs
  288. +1 −1  src/test/run-pass/extern-yield.rs
  289. +5 −5 src/test/run-pass/fact.rs
  290. +1 −1  src/test/run-pass/float.rs
  291. +1 −1  src/test/run-pass/fn-bare-item.rs
  292. +3 −3 src/test/run-pass/foreach-simple-outer-slot.rs
  293. +1 −1  src/test/run-pass/generic-tag-alt.rs
  294. +2 −2 src/test/run-pass/hashmap-memory.rs
  295. +1 −1  src/test/run-pass/hello.rs
  296. +2 −2 src/test/run-pass/html-literals.rs
  297. +6 −6 src/test/run-pass/import-glob-0.rs
  298. +1 −1  src/test/run-pass/import-glob-1.rs
  299. +1 −1  src/test/run-pass/import2.rs
  300. +1 −1  src/test/run-pass/import3.rs
Sorry, we could not display the entire diff because too many files (380) changed.
View
148 src/cargo/cargo.rs
@@ -371,7 +371,7 @@ fn rest(s: ~str, start: uint) -> ~str {
fn need_dir(s: ~str) {
if os::path_is_dir(s) { return; }
if !os::make_dir(s, 493_i32 /* oct: 755 */) {
- fail fmt!{"can't make_dir %s", s};
+ fail fmt!("can't make_dir %s", s);
}
}
@@ -389,7 +389,7 @@ fn valid_pkg_name(s: ~str) -> bool {
fn parse_source(name: ~str, j: json::json) -> source {
if !valid_pkg_name(name) {
- fail fmt!{"'%s' is an invalid source name", name};
+ fail fmt!("'%s' is an invalid source name", name);
}
match j {
@@ -432,11 +432,11 @@ fn try_parse_sources(filename: ~str, sources: map::hashmap<~str, source>) {
ok(json::dict(j)) => {
for j.each |k, v| {
sources.insert(k, parse_source(k, v));
- debug!{"source: %s", k};
+ debug!("source: %s", k);
}
}
ok(_) => fail ~"malformed sources.json",
- err(e) => fail fmt!{"%s:%s", filename, e.to_str()}
+ err(e) => fail fmt!("%s:%s", filename, e.to_str())
}
}
@@ -559,7 +559,7 @@ fn load_source_info(c: cargo, src: source) {
~"(source info is not a dict)");
}
err(e) => {
- warn(fmt!{"%s:%s", src.name, e.to_str()});
+ warn(fmt!("%s:%s", src.name, e.to_str()));
}
};
}
@@ -588,7 +588,7 @@ fn load_source_packages(c: cargo, src: source) {
~"(packages is not a list)");
}
err(e) => {
- warn(fmt!{"%s:%s", src.name, e.to_str()});
+ warn(fmt!("%s:%s", src.name, e.to_str()));
}
};
}
@@ -597,7 +597,7 @@ fn build_cargo_options(argv: ~[~str]) -> options {
let matches = match getopts::getopts(argv, opts()) {
result::ok(m) => m,
result::err(f) => {
- fail fmt!{"%s", getopts::fail_str(f)};
+ fail fmt!("%s", getopts::fail_str(f));
}
};
@@ -707,11 +707,11 @@ fn run_in_buildpath(what: ~str, path: ~str, subdir: ~str, cf: ~str,
extra_flags: ~[~str]) -> option<~str> {
let buildpath = path::connect(path, subdir);
need_dir(buildpath);
- debug!{"%s: %s -> %s", what, cf, buildpath};
+ debug!("%s: %s -> %s", what, cf, buildpath);
let p = run::program_output(rustc_sysroot(),
~[~"--out-dir", buildpath, cf] + extra_flags);
if p.status != 0 {
- error(fmt!{"rustc failed: %d\n%s\n%s", p.status, p.err, p.out});
+ error(fmt!("rustc failed: %d\n%s\n%s", p.status, p.err, p.out));
return none;
}
some(buildpath)
@@ -738,7 +738,7 @@ fn install_one_crate(c: cargo, path: ~str, cf: ~str) {
if (exec_suffix != ~"" && str::ends_with(ct, exec_suffix)) ||
(exec_suffix == ~"" && !str::starts_with(path::basename(ct),
~"lib")) {
- debug!{" bin: %s", ct};
+ debug!(" bin: %s", ct);
install_to_dir(ct, c.bindir);
if c.opts.mode == system_mode {
// FIXME (#2662): Put this file in PATH / symlink it so it can
@@ -746,7 +746,7 @@ fn install_one_crate(c: cargo, path: ~str, cf: ~str) {
// `cargo install -G rustray` and `rustray file.obj`
}
} else {
- debug!{" lib: %s", ct};
+ debug!(" lib: %s", ct);
install_to_dir(ct, c.libdir);
}
}
@@ -758,7 +758,7 @@ fn rustc_sysroot() -> ~str {
some(path) => {
let path = ~[path, ~"..", ~"bin", ~"rustc"];
let rustc = path::normalize(path::connect_many(path));
- debug!{" rustc: %s", rustc};
+ debug!(" rustc: %s", rustc);
rustc
}
none => ~"rustc"
@@ -766,7 +766,7 @@ fn rustc_sysroot() -> ~str {
}
fn install_source(c: cargo, path: ~str) {
- debug!{"source: %s", path};
+ debug!("source: %s", path);
os::change_dir(path);
let mut cratefiles = ~[];
@@ -792,7 +792,7 @@ fn install_source(c: cargo, path: ~str) {
let wd_base = c.workdir + path::path_sep();
let wd = match tempfile::mkdtemp(wd_base, ~"") {
some(wd) => wd,
- none => fail fmt!{"needed temp dir: %s", wd_base}
+ none => fail fmt!("needed temp dir: %s", wd_base)
};
install_query(c, wd, query);
@@ -825,7 +825,7 @@ fn install_curl(c: cargo, wd: ~str, url: ~str) {
let p = run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o",
tarpath, url]);
if p.status != 0 {
- fail fmt!{"fetch of %s failed: %s", url, p.err};
+ fail fmt!("fetch of %s failed: %s", url, p.err);
}
run::run_program(~"tar", ~[~"-x", ~"--strip-components=1",
~"-C", wd, ~"-f", tarpath]);
@@ -846,7 +846,7 @@ fn install_package(c: cargo, src: ~str, wd: ~str, pkg: package) {
_ => ~"curl"
};
- info(fmt!{"installing %s/%s via %s...", src, pkg.name, method});
+ info(fmt!("installing %s/%s via %s...", src, pkg.name, method));
match method {
~"git" => install_git(c, wd, url, copy pkg.reference),
@@ -1076,7 +1076,7 @@ fn cmd_install(c: cargo) unsafe {
let wd_base = c.workdir + path::path_sep();
let wd = match tempfile::mkdtemp(wd_base, ~"") {
some(wd) => wd,
- none => fail fmt!{"needed temp dir: %s", wd_base}
+ none => fail fmt!("needed temp dir: %s", wd_base)
};
if vec::len(c.opts.free) == 2u {
@@ -1084,7 +1084,7 @@ fn cmd_install(c: cargo) unsafe {
let status = run::run_program(~"cp", ~[~"-R", cwd, wd]);
if status != 0 {
- fail fmt!{"could not copy directory: %s", cwd};
+ fail fmt!("could not copy directory: %s", cwd);
}
install_source(c, wd);
@@ -1120,7 +1120,7 @@ fn sync_one_file(c: cargo, dir: ~str, src: source) -> bool {
let mut has_src_file = false;
if !os::copy_file(path::connect(url, ~"packages.json"), pkgfile) {
- error(fmt!{"fetch for source %s (url %s) failed", name, url});
+ error(fmt!("fetch for source %s (url %s) failed", name, url));
return false;
}
@@ -1136,7 +1136,7 @@ fn sync_one_file(c: cargo, dir: ~str, src: source) -> bool {
let p = run::program_output(~"curl",
~[~"-f", ~"-s", ~"-o", keyfile, u]);
if p.status != 0 {
- error(fmt!{"fetch for source %s (key %s) failed", name, u});
+ error(fmt!("fetch for source %s (key %s) failed", name, u));
return false;
}
pgp::add(c.root, keyfile);
@@ -1148,8 +1148,8 @@ fn sync_one_file(c: cargo, dir: ~str, src: source) -> bool {
let r = pgp::verify(c.root, pkgfile, sigfile, f);
if !r {
- error(fmt!{"signature verification failed for source %s",
- name});
+ error(fmt!("signature verification failed for source %s",
+ name));
return false;
}
@@ -1157,8 +1157,8 @@ fn sync_one_file(c: cargo, dir: ~str, src: source) -> bool {
let e = pgp::verify(c.root, srcfile, srcsigfile, f);
if !e {
- error(fmt!{"signature verification failed for source %s",
- name});
+ error(fmt!("signature verification failed for source %s",
+ name));
return false;
}
}
@@ -1178,7 +1178,7 @@ fn sync_one_file(c: cargo, dir: ~str, src: source) -> bool {
os::remove_file(pkgfile);
os::remove_file(sigfile);
- info(fmt!{"synced source: %s", name});
+ info(fmt!("synced source: %s", name));
return true;
}
@@ -1194,7 +1194,7 @@ fn sync_one_git(c: cargo, dir: ~str, src: source) -> bool {
fn rollback(name: ~str, dir: ~str, insecure: bool) {
fn msg(name: ~str, insecure: bool) {
- error(fmt!{"could not rollback source: %s", name});
+ error(fmt!("could not rollback source: %s", name));
if insecure {
warn(~"a past security check failed on source " +
@@ -1220,20 +1220,20 @@ fn sync_one_git(c: cargo, dir: ~str, src: source) -> bool {
let p = run::program_output(~"git", ~[~"clone", url, dir]);
if p.status != 0 {
- error(fmt!{"fetch for source %s (url %s) failed", name, url});
+ error(fmt!("fetch for source %s (url %s) failed", name, url));
return false;
}
}
else {
if !os::change_dir(dir) {
- error(fmt!{"fetch for source %s (url %s) failed", name, url});
+ error(fmt!("fetch for source %s (url %s) failed", name, url));
return false;
}
let p = run::program_output(~"git", ~[~"pull"]);
if p.status != 0 {
- error(fmt!{"fetch for source %s (url %s) failed", name, url});
+ error(fmt!("fetch for source %s (url %s) failed", name, url));
return false;
}
}
@@ -1245,7 +1245,7 @@ fn sync_one_git(c: cargo, dir: ~str, src: source) -> bool {
let p = run::program_output(~"curl",
~[~"-f", ~"-s", ~"-o", keyfile, u]);
if p.status != 0 {
- error(fmt!{"fetch for source %s (key %s) failed", name, u});
+ error(fmt!("fetch for source %s (key %s) failed", name, u));
rollback(name, dir, false);
return false;
}
@@ -1258,8 +1258,8 @@ fn sync_one_git(c: cargo, dir: ~str, src: source) -> bool {
let r = pgp::verify(c.root, pkgfile, sigfile, f);
if !r {
- error(fmt!{"signature verification failed for source %s",
- name});
+ error(fmt!("signature verification failed for source %s",
+ name));
rollback(name, dir, false);
return false;
}
@@ -1268,8 +1268,8 @@ fn sync_one_git(c: cargo, dir: ~str, src: source) -> bool {
let e = pgp::verify(c.root, srcfile, srcsigfile, f);
if !e {
- error(fmt!{"signature verification failed for source %s",
- name});
+ error(fmt!("signature verification failed for source %s",
+ name));
rollback(name, dir, false);
return false;
}
@@ -1280,7 +1280,7 @@ fn sync_one_git(c: cargo, dir: ~str, src: source) -> bool {
os::remove_file(keyfile);
- info(fmt!{"synced source: %s", name});
+ info(fmt!("synced source: %s", name));
return true;
}
@@ -1306,7 +1306,7 @@ fn sync_one_curl(c: cargo, dir: ~str, src: source) -> bool {
~[~"-f", ~"-s", ~"-o", pkgfile, url]);
if p.status != 0 {
- error(fmt!{"fetch for source %s (url %s) failed", name, url});
+ error(fmt!("fetch for source %s (url %s) failed", name, url));
return false;
}
if smart {
@@ -1325,7 +1325,7 @@ fn sync_one_curl(c: cargo, dir: ~str, src: source) -> bool {
let p = run::program_output(~"curl",
~[~"-f", ~"-s", ~"-o", keyfile, u]);
if p.status != 0 {
- error(fmt!{"fetch for source %s (key %s) failed", name, u});
+ error(fmt!("fetch for source %s (key %s) failed", name, u));
return false;
}
pgp::add(c.root, keyfile);
@@ -1344,15 +1344,15 @@ fn sync_one_curl(c: cargo, dir: ~str, src: source) -> bool {
let mut p = run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o",
sigfile, url]);
if p.status != 0 {
- error(fmt!{"fetch for source %s (sig %s) failed", name, url});
+ error(fmt!("fetch for source %s (sig %s) failed", name, url));
return false;
}
let r = pgp::verify(c.root, pkgfile, sigfile, f);
if !r {
- error(fmt!{"signature verification failed for source %s",
- name});
+ error(fmt!("signature verification failed for source %s",
+ name));
return false;
}
@@ -1363,8 +1363,8 @@ fn sync_one_curl(c: cargo, dir: ~str, src: source) -> bool {
~[~"-f", ~"-s", ~"-o",
srcsigfile, url]);
if p.status != 0 {
- error(fmt!{"fetch for source %s (sig %s) failed",
- name, url});
+ error(fmt!("fetch for source %s (sig %s) failed",
+ name, url));
return false;
}
@@ -1392,7 +1392,7 @@ fn sync_one_curl(c: cargo, dir: ~str, src: source) -> bool {
os::remove_file(pkgfile);
os::remove_file(sigfile);
- info(fmt!{"synced source: %s", name});
+ info(fmt!("synced source: %s", name));
return true;
}
@@ -1401,7 +1401,7 @@ fn sync_one(c: cargo, src: source) {
let name = src.name;
let dir = path::connect(c.sourcedir, name);
- info(fmt!{"syncing source: %s...", name});
+ info(fmt!("syncing source: %s...", name));
need_dir(dir);
@@ -1428,20 +1428,20 @@ fn cmd_init(c: cargo) {
let p =
run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o", srcfile, srcurl]);
if p.status != 0 {
- error(fmt!{"fetch of sources.json failed: %s", p.out});
+ error(fmt!("fetch of sources.json failed: %s", p.out));
return;
}
let p =
run::program_output(~"curl", ~[~"-f", ~"-s", ~"-o", sigfile, sigurl]);
if p.status != 0 {
- error(fmt!{"fetch of sources.json.sig failed: %s", p.out});
+ error(fmt!("fetch of sources.json.sig failed: %s", p.out));
return;
}
let r = pgp::verify(c.root, srcfile, sigfile, pgp::signing_key_fp());
if !r {
- error(fmt!{"signature verification failed for '%s'", srcfile});
+ error(fmt!("signature verification failed for '%s'", srcfile));
return;
}
@@ -1449,7 +1449,7 @@ fn cmd_init(c: cargo) {
os::remove_file(srcfile);
os::remove_file(sigfile);
- info(fmt!{"initialized .cargo in %s", c.root});
+ info(fmt!("initialized .cargo in %s", c.root));
}
fn print_pkg(s: source, p: package) {
@@ -1490,14 +1490,14 @@ fn cmd_list(c: cargo) {
if vec::len(c.opts.free) >= 3u {
do vec::iter_between(c.opts.free, 2u, vec::len(c.opts.free)) |name| {
if !valid_pkg_name(name) {
- error(fmt!{"'%s' is an invalid source name", name});
+ error(fmt!("'%s' is an invalid source name", name));
} else {
match c.sources.find(name) {
some(source) => {
print_source(source);
}
none => {
- error(fmt!{"no such source: %s", name});
+ error(fmt!("no such source: %s", name));
}
}
}
@@ -1527,7 +1527,7 @@ fn cmd_search(c: cargo) {
n += 1;
}
});
- info(fmt!{"found %d packages", n});
+ info(fmt!("found %d packages", n));
}
fn install_to_dir(srcfile: ~str, destdir: ~str) {
@@ -1535,9 +1535,9 @@ fn install_to_dir(srcfile: ~str, destdir: ~str) {
let status = run::run_program(~"cp", ~[~"-r", srcfile, newfile]);
if status == 0 {
- info(fmt!{"installed: '%s'", newfile});
+ info(fmt!("installed: '%s'", newfile));
} else {
- error(fmt!{"could not install: '%s'", newfile});
+ error(fmt!("could not install: '%s'", newfile));
}
}
@@ -1595,22 +1595,22 @@ fn dump_sources(c: cargo) {
writer.write_str(json::to_str(root));
}
result::err(e) => {
- error(fmt!{"could not dump sources: %s", e});
+ error(fmt!("could not dump sources: %s", e));
}
}
}
fn copy_warn(srcfile: ~str, destfile: ~str) {
if !os::copy_file(srcfile, destfile) {
- warn(fmt!{"copying %s to %s failed", srcfile, destfile});
+ warn(fmt!("copying %s to %s failed", srcfile, destfile));
}
}
fn cmd_sources(c: cargo) {
if vec::len(c.opts.free) < 3u {
for c.sources.each_value |v| {
- info(fmt!{"%s (%s) via %s",
- v.name, v.url, v.method});
+ info(fmt!("%s (%s) via %s",
+ v.name, v.url, v.method));
}
return;
}
@@ -1635,13 +1635,13 @@ fn cmd_sources(c: cargo) {
let url = c.opts.free[4u];
if !valid_pkg_name(name) {
- error(fmt!{"'%s' is an invalid source name", name});
+ error(fmt!("'%s' is an invalid source name", name));
return;
}
match c.sources.find(name) {
some(source) => {
- error(fmt!{"source already exists: %s", name});
+ error(fmt!("source already exists: %s", name));
}
none => {
c.sources.insert(name, @{
@@ -1652,7 +1652,7 @@ fn cmd_sources(c: cargo) {
mut keyfp: none,
mut packages: ~[mut]
});
- info(fmt!{"added source: %s", name});
+ info(fmt!("added source: %s", name));
}
}
}
@@ -1665,17 +1665,17 @@ fn cmd_sources(c: cargo) {
let name = c.opts.free[3u];
if !valid_pkg_name(name) {
- error(fmt!{"'%s' is an invalid source name", name});
+ error(fmt!("'%s' is an invalid source name", name));
return;
}
match c.sources.find(name) {
some(source) => {
c.sources.remove(name);
- info(fmt!{"removed source: %s", name});
+ info(fmt!("removed source: %s", name));
}
none => {
- error(fmt!{"no such source: %s", name});
+ error(fmt!("no such source: %s", name));
}
}
}
@@ -1689,7 +1689,7 @@ fn cmd_sources(c: cargo) {
let url = c.opts.free[4u];
if !valid_pkg_name(name) {
- error(fmt!{"'%s' is an invalid source name", name});
+ error(fmt!("'%s' is an invalid source name", name));
return;
}
@@ -1703,10 +1703,10 @@ fn cmd_sources(c: cargo) {
c.sources.insert(name, source);
- info(fmt!{"changed source url: '%s' to '%s'", old, url});
+ info(fmt!("changed source url: '%s' to '%s'", old, url));
}
none => {
- error(fmt!{"no such source: %s", name});
+ error(fmt!("no such source: %s", name));
}
}
}
@@ -1720,7 +1720,7 @@ fn cmd_sources(c: cargo) {
let method = c.opts.free[4u];
if !valid_pkg_name(name) {
- error(fmt!{"'%s' is an invalid source name", name});
+ error(fmt!("'%s' is an invalid source name", name));
return;
}
@@ -1736,11 +1736,11 @@ fn cmd_sources(c: cargo) {
c.sources.insert(name, source);
- info(fmt!{"changed source method: '%s' to '%s'", old,
- method});
+ info(fmt!("changed source method: '%s' to '%s'", old,
+ method));
}
none => {
- error(fmt!{"no such source: %s", name});
+ error(fmt!("no such source: %s", name));
}
}
}
@@ -1754,11 +1754,11 @@ fn cmd_sources(c: cargo) {
let newn = c.opts.free[4u];
if !valid_pkg_name(name) {
- error(fmt!{"'%s' is an invalid source name", name});
+ error(fmt!("'%s' is an invalid source name", name));
return;
}
if !valid_pkg_name(newn) {
- error(fmt!{"'%s' is an invalid source name", newn});
+ error(fmt!("'%s' is an invalid source name", newn));
return;
}
@@ -1766,10 +1766,10 @@ fn cmd_sources(c: cargo) {
some(source) => {
c.sources.remove(name);
c.sources.insert(newn, source);
- info(fmt!{"renamed source: %s to %s", name, newn});
+ info(fmt!("renamed source: %s to %s", name, newn));
}
none => {
- error(fmt!{"no such source: %s", name});
+ error(fmt!("no such source: %s", name));
}
}
}
View
34 src/compiletest/compiletest.rs
@@ -63,20 +63,20 @@ fn parse_config(args: ~[~str]) -> config {
fn log_config(config: config) {
let c = config;
- logv(c, fmt!{"configuration:"});
- logv(c, fmt!{"compile_lib_path: %s", config.compile_lib_path});
- logv(c, fmt!{"run_lib_path: %s", config.run_lib_path});
- logv(c, fmt!{"rustc_path: %s", config.rustc_path});
- logv(c, fmt!{"src_base: %s", config.src_base});
- logv(c, fmt!{"build_base: %s", config.build_base});
- logv(c, fmt!{"stage_id: %s", config.stage_id});
- logv(c, fmt!{"mode: %s", mode_str(config.mode)});
- logv(c, fmt!{"run_ignored: %b", config.run_ignored});
- logv(c, fmt!{"filter: %s", opt_str(config.filter)});
- logv(c, fmt!{"runtool: %s", opt_str(config.runtool)});
- logv(c, fmt!{"rustcflags: %s", opt_str(config.rustcflags)});
- logv(c, fmt!{"verbose: %b", config.verbose});
- logv(c, fmt!{"\n"});
+ logv(c, fmt!("configuration:"));
+ logv(c, fmt!("compile_lib_path: %s", config.compile_lib_path));
+ logv(c, fmt!("run_lib_path: %s", config.run_lib_path));
+ logv(c, fmt!("rustc_path: %s", config.rustc_path));
+ logv(c, fmt!("src_base: %s", config.src_base));
+ logv(c, fmt!("build_base: %s", config.build_base));
+ logv(c, fmt!("stage_id: %s", config.stage_id));
+ logv(c, fmt!("mode: %s", mode_str(config.mode)));
+ logv(c, fmt!("run_ignored: %b", config.run_ignored));
+ logv(c, fmt!("filter: %s", opt_str(config.filter)));
+ logv(c, fmt!("runtool: %s", opt_str(config.runtool)));
+ logv(c, fmt!("rustcflags: %s", opt_str(config.rustcflags)));
+ logv(c, fmt!("verbose: %b", config.verbose));
+ logv(c, fmt!("\n"));
}
fn opt_str(maybestr: option<~str>) -> ~str {
@@ -129,11 +129,11 @@ fn test_opts(config: config) -> test::test_opts {
}
fn make_tests(config: config) -> ~[test::test_desc] {
- debug!{"making tests from %s", config.src_base};
+ debug!("making tests from %s", config.src_base);
let mut tests = ~[];
for os::list_dir_path(config.src_base).each |file| {
let file = file;
- debug!{"inspecting file %s", file};
+ debug!("inspecting file %s", file);
if is_test(config, file) {
vec::push(tests, make_test(config, file))
}
@@ -175,7 +175,7 @@ fn make_test(config: config, testfile: ~str) ->
}
fn make_test_name(config: config, testfile: ~str) -> ~str {
- fmt!{"[%s] %s", mode_str(config.mode), testfile}
+ fmt!("[%s] %s", mode_str(config.mode), testfile)
}
fn make_test_closure(config: config, testfile: ~str) -> test::test_fn {
View
2  src/compiletest/errors.rs
@@ -45,7 +45,7 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[expected_error] unsafe {
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
let msg = str::slice(line, idx, len);
- debug!{"line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg};
+ debug!("line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg);
return ~[{line: line_num - adjust_line, kind: kind, msg: msg}];
}
View
4 src/compiletest/header.rs
@@ -109,7 +109,7 @@ fn parse_exec_env(line: ~str) -> option<(~str, ~str)> {
match strs.len() {
1u => (strs[0], ~""),
2u => (strs[0], strs[1]),
- n => fail fmt!{"Expected 1 or 2 strings, not %u", n}
+ n => fail fmt!("Expected 1 or 2 strings, not %u", n)
}
}
}
@@ -138,7 +138,7 @@ fn parse_name_value_directive(line: ~str,
option::some(colon) => {
let value = str::slice(line, colon + str::len(keycolon),
str::len(line));
- debug!{"%s: %s", directive, value};
+ debug!("%s: %s", directive, value);
option::some(value)
}
option::none => option::none
View
62 src/compiletest/runtest.rs
@@ -16,7 +16,7 @@ fn run(config: config, testfile: ~str) {
// We're going to be dumping a lot of info. Start on a new line.
io::stdout().write_str(~"\n\n");
}
- debug!{"running %s", testfile};
+ debug!("running %s", testfile);
let props = load_props(testfile);
match config.mode {
mode_compile_fail => run_cfail_test(config, props, testfile),
@@ -68,8 +68,8 @@ fn check_correct_failure_status(procres: procres) {
const rust_err: int = 101;
if procres.status != rust_err {
fatal_procres(
- fmt!{"failure produced the wrong error code: %d",
- procres.status},
+ fmt!("failure produced the wrong error code: %d",
+ procres.status),
procres);
}
}
@@ -96,11 +96,11 @@ fn run_pretty_test(config: config, props: test_props, testfile: ~str) {
let mut round = 0;
while round < rounds {
- logv(config, fmt!{"pretty-printing round %d", round});
+ logv(config, fmt!("pretty-printing round %d", round));
let procres = print_source(config, testfile, srcs[round]);
if procres.status != 0 {
- fatal_procres(fmt!{"pretty-printing failed in round %d", round},
+ fatal_procres(fmt!("pretty-printing failed in round %d", round),
procres);
}
@@ -151,7 +151,7 @@ fn run_pretty_test(config: config, props: test_props, testfile: ~str) {
if expected != actual {
error(~"pretty-printed source does not match expected source");
let msg =
- fmt!{"\n\
+ fmt!("\n\
expected:\n\
------------------------------------------\n\
%s\n\
@@ -161,7 +161,7 @@ actual:\n\
%s\n\
------------------------------------------\n\
\n",
- expected, actual};
+ expected, actual);
io::stdout().write_str(msg);
fail;
}
@@ -201,10 +201,10 @@ fn check_error_patterns(props: test_props,
let mut done = false;
for str::split_char(procres.stderr, '\n').each |line| {
if str::contains(line, next_err_pat) {
- debug!{"found error pattern %s", next_err_pat};
+ debug!("found error pattern %s", next_err_pat);
next_err_idx += 1u;
if next_err_idx == vec::len(props.error_patterns) {
- debug!{"found all error patterns"};
+ debug!("found all error patterns");
done = true;
break;
}
@@ -217,11 +217,11 @@ fn check_error_patterns(props: test_props,
vec::slice(props.error_patterns, next_err_idx,
vec::len(props.error_patterns));
if vec::len(missing_patterns) == 1u {
- fatal_procres(fmt!{"error pattern '%s' not found!",
- missing_patterns[0]}, procres);
+ fatal_procres(fmt!("error pattern '%s' not found!",
+ missing_patterns[0]), procres);
} else {
for missing_patterns.each |pattern| {
- error(fmt!{"error pattern '%s' not found!", pattern});
+ error(fmt!("error pattern '%s' not found!", pattern));
}
fatal_procres(~"multiple error patterns not found", procres);
}
@@ -240,7 +240,7 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
}
let prefixes = vec::map(expected_errors, |ee| {
- fmt!{"%s:%u:", testfile, ee.line}
+ fmt!("%s:%u:", testfile, ee.line)
});
// Scan and extract our error/warning messages,
@@ -253,8 +253,8 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
let mut was_expected = false;
for vec::eachi(expected_errors) |i, ee| {
if !found_flags[i] {
- debug!{"prefix=%s ee.kind=%s ee.msg=%s line=%s",
- prefixes[i], ee.kind, ee.msg, line};
+ debug!("prefix=%s ee.kind=%s ee.msg=%s line=%s",
+ prefixes[i], ee.kind, ee.msg, line);
if (str::starts_with(line, prefixes[i]) &&
str::contains(line, ee.kind) &&
str::contains(line, ee.msg)) {
@@ -272,7 +272,7 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
if !was_expected && (str::contains(line, ~"error") ||
str::contains(line, ~"warning")) {
- fatal_procres(fmt!{"unexpected error pattern '%s'!", line},
+ fatal_procres(fmt!("unexpected error pattern '%s'!", line),
procres);
}
}
@@ -280,8 +280,8 @@ fn check_expected_errors(expected_errors: ~[errors::expected_error],
for uint::range(0u, vec::len(found_flags)) |i| {
if !found_flags[i] {
let ee = expected_errors[i];
- fatal_procres(fmt!{"expected %s on line %u not found: %s",
- ee.kind, ee.line, ee.msg}, procres);
+ fatal_procres(fmt!("expected %s on line %u not found: %s",
+ ee.kind, ee.line, ee.msg), procres);
}
}
}
@@ -330,7 +330,7 @@ fn compose_and_run_compiler(
config.compile_lib_path, option::none);
if auxres.status != 0 {
fatal_procres(
- fmt!{"auxiliary build of %s failed to compile: ", abs_ab},
+ fmt!("auxiliary build of %s failed to compile: ", abs_ab),
auxres);
}
}
@@ -342,7 +342,7 @@ fn compose_and_run_compiler(
fn ensure_dir(path: Path) {
if os::path_is_dir(path) { return; }
if !os::make_dir(path, 0x1c0i32) {
- fail fmt!{"can't make dir %s", path};
+ fail fmt!("can't make dir %s", path);
}
}
@@ -414,7 +414,7 @@ fn program_output(config: config, testfile: ~str, lib_path: ~str, prog: ~str,
let cmdline =
{
let cmdline = make_cmdline(lib_path, prog, args);
- logv(config, fmt!{"executing %s", cmdline});
+ logv(config, fmt!("executing %s", cmdline));
cmdline
};
let res = procsrv::run(lib_path, prog, args, env, input);
@@ -430,19 +430,19 @@ fn program_output(config: config, testfile: ~str, lib_path: ~str, prog: ~str,
#[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")]
fn make_cmdline(_libpath: ~str, prog: ~str, args: ~[~str]) -> ~str {
- fmt!{"%s %s", prog, str::connect(args, ~" ")}
+ fmt!("%s %s", prog, str::connect(args, ~" "))
}
#[cfg(target_os = "win32")]
fn make_cmdline(libpath: ~str, prog: ~str, args: ~[~str]) -> ~str {
- fmt!{"%s %s %s", lib_path_cmd_prefix(libpath), prog,
- str::connect(args, ~" ")}
+ fmt!("%s %s %s", lib_path_cmd_prefix(libpath), prog,
+ str::connect(args, ~" "))
}
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
// for diagnostic purposes
fn lib_path_cmd_prefix(path: ~str) -> ~str {
- fmt!{"%s=\"%s\"", util::lib_path_env_var(), util::make_new_path(path)}
+ fmt!("%s=\"%s\"", util::lib_path_env_var(), util::make_new_path(path))
}
fn dump_output(config: config, testfile: ~str, out: ~str, err: ~str) {
@@ -475,13 +475,13 @@ fn output_testname(testfile: ~str) -> ~str {
fn output_base_name(config: config, testfile: ~str) -> ~str {
let base = config.build_base;
let filename = output_testname(testfile);
- fmt!{"%s%s.%s", base, filename, config.stage_id}
+ fmt!("%s%s.%s", base, filename, config.stage_id)
}
fn maybe_dump_to_stdout(config: config, out: ~str, err: ~str) {
if config.verbose {
- let sep1 = fmt!{"------%s------------------------------", ~"stdout"};
- let sep2 = fmt!{"------%s------------------------------", ~"stderr"};
+ let sep1 = fmt!("------%s------------------------------", ~"stdout");
+ let sep2 = fmt!("------%s------------------------------", ~"stderr");
let sep3 = ~"------------------------------------------";
io::stdout().write_line(sep1);
io::stdout().write_line(out);
@@ -491,13 +491,13 @@ fn maybe_dump_to_stdout(config: config, out: ~str, err: ~str) {
}
}
-fn error(err: ~str) { io::stdout().write_line(fmt!{"\nerror: %s", err}); }
+fn error(err: ~str) { io::stdout().write_line(fmt!("\nerror: %s", err)); }
fn fatal(err: ~str) -> ! { error(err); fail; }
fn fatal_procres(err: ~str, procres: procres) -> ! {
let msg =
- fmt!{"\n\
+ fmt!("\n\
error: %s\n\
command: %s\n\
stdout:\n\
@@ -509,7 +509,7 @@ stderr:\n\
%s\n\
------------------------------------------\n\
\n",
- err, procres.cmdline, procres.stdout, procres.stderr};
+ err, procres.cmdline, procres.stdout, procres.stderr);
io::stdout().write_str(msg);
fail;
}
View
2  src/compiletest/util.rs
@@ -9,7 +9,7 @@ fn make_new_path(path: ~str) -> ~str {
// maintain the current value while adding our own
match getenv(lib_path_env_var()) {
option::some(curr) => {
- fmt!{"%s%s%s", path, path_div(), curr}
+ fmt!("%s%s%s", path, path_div(), curr)
}
option::none => path
}
View
2  src/fuzzer/ast_match.rs
@@ -26,5 +26,5 @@ fn main() {
assert (!vec_equal(~[5, 5], ~[4, 5], builtin_equal_int));
assert (vec_equal(~[5, 5], ~[5, 5], builtin_equal_int));
- error!{"Pass"};
+ error!("Pass");
}
View
36 src/fuzzer/fuzzer.rs
@@ -242,8 +242,8 @@ fn check_variants_T<T: copy>(
replacer: fn@(ast::crate, uint, T, test_mode) -> ast::crate,
cx: context
) {
- error!{"%s contains %u %s objects", filename,
- vec::len(things), thing_label};
+ error!("%s contains %u %s objects", filename,
+ vec::len(things), thing_label);
// Assuming we're not generating any token_trees
let intr = syntax::parse::token::mk_fake_ident_interner();
@@ -274,9 +274,9 @@ fn check_variants_T<T: copy>(
check_roundtrip_convergence(str3, 1u);
}
tm_run => {
- let file_label = fmt!{"rusttmp/%s_%s_%u_%u",
+ let file_label = fmt!("rusttmp/%s_%s_%u_%u",
last_part(filename),
- thing_label, i, j};
+ thing_label, i, j);
let safe_to_run = !(content_is_dangerous_to_run(*str3)
|| has_raw_pointers(*crate2));
check_whole_compiler(*str3, file_label, safe_to_run);
@@ -386,7 +386,7 @@ fn check_compiling(filename: ~str) -> happiness {
stage1/bin/rustc",
~[filename]);
- //error!{"Status: %d", p.status};
+ //error!("Status: %d", p.status);
if p.status == 0 {
passed
} else if p.err != ~"" {
@@ -515,9 +515,9 @@ fn check_roundtrip_convergence(code: @~str, maxIters: uint) {
}
if oldv == newv {
- error!{"Converged after %u iterations", i};
+ error!("Converged after %u iterations", i);
} else {
- error!{"Did not converge after %u iterations!", i};
+ error!("Did not converge after %u iterations!", i);
write_file(~"round-trip-a.rs", *oldv);
write_file(~"round-trip-b.rs", *newv);
run::run_program(~"diff",
@@ -528,12 +528,12 @@ fn check_roundtrip_convergence(code: @~str, maxIters: uint) {
}
fn check_convergence(files: ~[~str]) {
- error!{"pp convergence tests: %u files", vec::len(files)};
+ error!("pp convergence tests: %u files", vec::len(files));
for files.each |file| {
if !file_might_not_converge(file) {
let s = @result::get(io::read_whole_file_str(file));
if !content_might_not_converge(*s) {
- error!{"pp converge: %s", file};
+ error!("pp converge: %s", file);
// Change from 7u to 2u once
// https://github.com/mozilla/rust/issues/850 is fixed
check_roundtrip_convergence(s, 7u);
@@ -545,8 +545,8 @@ fn check_convergence(files: ~[~str]) {
fn check_variants(files: ~[~str], cx: context) {
for files.each |file| {
if cx.mode == tm_converge && file_might_not_converge(file) {
- error!{"Skipping convergence test based on\
- file_might_not_converge"};
+ error!("Skipping convergence test based on\
+ file_might_not_converge");
again;
}
@@ -568,7 +568,7 @@ fn check_variants(files: ~[~str], cx: context) {
file,
s, ~[], sess);
io::with_str_reader(*s, |rdr| {
- error!{"%s",
+ error!("%s",
as_str(|a| pprust::print_crate(
sess.cm,
// Assuming no token_trees
@@ -578,7 +578,7 @@ fn check_variants(files: ~[~str], cx: context) {
file,
rdr, a,
pprust::no_ann(),
- false) )}
+ false) ))
});
check_variants_of_ast(*crate, sess.cm, file, cx);
}
@@ -586,21 +586,21 @@ fn check_variants(files: ~[~str], cx: context) {
fn main(args: ~[~str]) {
if vec::len(args) != 2u {
- error!{"usage: %s <testdir>", args[0]};
+ error!("usage: %s <testdir>", args[0]);
return;
}
let mut files = ~[];
let root = args[1];
find_rust_files(files, root);
- error!{"== check_convergence =="};
+ error!("== check_convergence ==");
check_convergence(files);
- error!{"== check_variants: converge =="};
+ error!("== check_variants: converge ==");
check_variants(files, { mode: tm_converge });
- error!{"== check_variants: run =="};
+ error!("== check_variants: run ==");
check_variants(files, { mode: tm_run });
- error!{"Fuzzer done"};
+ error!("Fuzzer done");
}
// Local Variables:
View
4 src/libcore/extfmt.rs
@@ -21,7 +21,7 @@ combinations at the moment.
Example:
-debug!{"hello, %s!", "world"};
+debug!("hello, %s!", "world");
*/
@@ -446,7 +446,7 @@ mod test {
#[test]
fn fmt_slice() {
let s = "abc";
- let _s = fmt!{"%s", s};
+ let _s = fmt!("%s", s);
}
}
View
8 src/libcore/future.rs
@@ -11,7 +11,7 @@
* ~~~
* let delayed_fib = future::spawn {|| fib(5000) };
* make_a_sandwich();
- * io::println(fmt!{"fib(5000) = %?", delayed_fib.get()})
+ * io::println(fmt!("fib(5000) = %?", delayed_fib.get()))
* ~~~
*/
@@ -64,9 +64,9 @@ fn from_value<A>(+val: A) -> Future<A> {
})
}
-macro_rules! move_it {
+macro_rules! move_it (
{$x:expr} => { unsafe { let y <- *ptr::addr_of($x); y } }
-}
+)
fn from_port<A:send>(+port: future_pipe::client::waiting<A>) -> Future<A> {
#[doc = "
@@ -82,7 +82,7 @@ fn from_port<A:send>(+port: future_pipe::client::waiting<A>) -> Future<A> {
port_ <-> *port;
let port = option::unwrap(port_);
match recv(port) {
- future_pipe::completed(data) => move_it!{data}
+ future_pipe::completed(data) => move_it!(data)
}
}
}
View
32 src/libcore/hash.rs
@@ -174,11 +174,11 @@ impl &SipState : io::Writer {
t += 1;
}
- let m = u8to64_le!{self.tail, 0};
+ let m = u8to64_le!(self.tail, 0);
self.v3 ^= m;
- compress!{self.v0, self.v1, self.v2, self.v3};
- compress!{self.v0, self.v1, self.v2, self.v3};
+ compress!(self.v0, self.v1, self.v2, self.v3);
+ compress!(self.v0, self.v1, self.v2, self.v3);
self.v0 ^= m;
self.ntail = 0;
@@ -191,11 +191,11 @@ impl &SipState : io::Writer {
let mut i = needed;
while i < end {
- let mi = u8to64_le!{msg, i};
+ let mi = u8to64_le!(msg, i);
self.v3 ^= mi;
- compress!{self.v0, self.v1, self.v2, self.v3};
- compress!{self.v0, self.v1, self.v2, self.v3};
+ compress!(self.v0, self.v1, self.v2, self.v3);
+ compress!(self.v0, self.v1, self.v2, self.v3);
self.v0 ^= mi;
i += 8;
@@ -246,15 +246,15 @@ impl &SipState : Streaming {
if self.ntail > 6 { b |= self.tail[6] as u64 << 48; }
v3 ^= b;
- compress!{v0, v1, v2, v3};
- compress!{v0, v1, v2, v3};
+ compress!(v0, v1, v2, v3);
+ compress!(v0, v1, v2, v3);
v0 ^= b;
v2 ^= 0xff;
- compress!{v0, v1, v2, v3};
- compress!{v0, v1, v2, v3};
- compress!{v0, v1, v2, v3};
- compress!{v0, v1, v2, v3};
+ compress!(v0, v1, v2, v3);
+ compress!(v0, v1, v2, v3);
+ compress!(v0, v1, v2, v3);
+ compress!(v0, v1, v2, v3);
return (v0 ^ v1 ^ v2 ^ v3);
}
@@ -373,10 +373,10 @@ fn test_siphash() {
}
while t < 64 {
- debug!{"siphash test %?", t};
- let vec = u8to64_le!{vecs[t], 0};
+ debug!("siphash test %?", t);
+ let vec = u8to64_le!(vecs[t], 0);
let out = hash_bytes_keyed(buf, k0, k1);
- debug!{"got %?, expected %?", out, vec};
+ debug!("got %?, expected %?", out, vec);
assert vec == out;
stream_full.reset();
@@ -384,7 +384,7 @@ fn test_siphash() {
let f = stream_full.result_str();
let i = stream_inc.result_str();
let v = to_hex_str(&vecs[t]);
- debug!{"%d: (%s) => inc=%s full=%s", t, v, i, f};
+ debug!("%d: (%s) => inc=%s full=%s", t, v, i, f);
assert f == i && f == v;
View
8 src/libcore/int-template.rs
@@ -97,8 +97,8 @@ impl T: iter::Times {
`for int::range(0, x) |_i| { /* anything */ }`."]
pure fn times(it: fn() -> bool) {
if self < 0 {
- fail fmt!{"The .times method expects a nonnegative number, \
- but found %?", self};
+ fail fmt!("The .times method expects a nonnegative number, \
+ but found %?", self);
}
let mut i = self;
while i > 0 {
@@ -114,8 +114,8 @@ impl T: iter::TimesIx {
pure fn timesi(it: fn(uint) -> bool) {
let slf = self as uint;
if slf < 0u {
- fail fmt!{"The .timesi method expects a nonnegative number, \
- but found %?", self};
+ fail fmt!("The .timesi method expects a nonnegative number, \
+ but found %?", self);
}
let mut i = 0u;
while i < slf {
View
12 src/libcore/io.rs
@@ -292,7 +292,7 @@ impl ByteBuf: Reader {
return b as int;
}
// FIXME (#2738): implement this
- fn unread_byte(_byte: int) { error!{"Unimplemented: unread_byte"}; fail; }
+ fn unread_byte(_byte: int) { error!("Unimplemented: unread_byte"); fail; }
fn eof() -> bool { self.pos == self.len }
fn seek(offset: int, whence: SeekStyle) {
let pos = self.pos;
@@ -358,7 +358,7 @@ impl *libc::FILE: Writer {
let nout = libc::fwrite(vbuf as *c_void, len as size_t,
1u as size_t, self);
if nout < 1 as size_t {
- error!{"error writing buffer"};
+ error!("error writing buffer");
log(error, os::last_os_error());
fail;
}
@@ -393,7 +393,7 @@ impl fd_t: Writer {
let vb = ptr::const_offset(vbuf, count) as *c_void;
let nout = libc::write(self, vb, len as size_t);
if nout < 0 as ssize_t {
- error!{"error writing buffer"};
+ error!("error writing buffer");
log(error, os::last_os_error());
fail;
}
@@ -402,11 +402,11 @@ impl fd_t: Writer {
}
}
fn seek(_offset: int, _whence: SeekStyle) {
- error!{"need 64-bit foreign calls for seek, sorry"};
+ error!("need 64-bit foreign calls for seek, sorry");
fail;
}
fn tell() -> uint {
- error!{"need 64-bit foreign calls for tell, sorry"};
+ error!("need 64-bit foreign calls for tell, sorry");
fail;
}
fn flush() -> int { 0 }
@@ -453,7 +453,7 @@ fn mk_file_writer(path: ~str, flags: ~[FileFlag])
(S_IRUSR | S_IWUSR) as c_int)
};
if fd < (0 as c_int) {
- result::err(fmt!{"error opening %s: %s", path, os::last_os_error()})
+ result::err(fmt!("error opening %s: %s", path, os::last_os_error()))
} else {
result::ok(fd_writer(fd, true))
}
View
6 src/libcore/iter.rs
@@ -176,7 +176,7 @@ pure fn find<A: copy,IA:BaseIter<A>>(self: IA,
#[test]
fn test_enumerate() {
enumerate(["0", "1", "2"]) {|i,j|
- assert fmt!{"%u",i} == j;
+ assert fmt!("%u",i) == j;
}
}
@@ -254,7 +254,7 @@ fn test_flat_map_with_list() {
let a = bind vec::iter(~[0, 1, 2, 3], _);
let b = bind flat_map(a, repeat, _);
let c = to_vec(b);
- debug!{"c = %?", c};
+ debug!("c = %?", c);
assert c == ~[1, 2, 2, 3, 3, 3];
}
@@ -265,7 +265,7 @@ fn test_repeat() {
c += ~[(i * i)];
i += 1u;
};
- debug!{"c = %?", c};
+ debug!("c = %?", c);
assert c == ~[0u, 1u, 4u, 9u, 16u];
}
View
2  src/libcore/os.rs
@@ -1036,7 +1036,7 @@ mod tests {
assert (libc::fclose(ostream) == (0u as c_int));
let rs = os::copy_file(in, out);
if (!os::path_exists(in)) {
- fail (fmt!{"%s doesn't exist", in});
+ fail (fmt!("%s doesn't exist", in));
}
assert(rs);
let rslt = run::run_program(~"diff", ~[in, out]);
View
46 src/libcore/pipes.rs
@@ -103,9 +103,9 @@ export rt;
#[doc(hidden)]
const SPIN_COUNT: uint = 0;
-macro_rules! move_it {
+macro_rules! move_it (
{ $x:expr } => { unsafe { let y <- *ptr::addr_of($x); y } }
-}
+)
#[doc(hidden)]
enum state {
@@ -335,15 +335,15 @@ struct buffer_resource<T: send> {
let buffer: ~buffer<T>;
new(+b: ~buffer<T>) {
//let p = ptr::addr_of(*b);
- //error!{"take %?", p};
+ //error!("take %?", p);
atomic_add_acq(&mut b.header.ref_count, 1);
self.buffer = b;
}
drop unsafe {
- let b = move_it!{self.buffer};
+ let b = move_it!(self.buffer);
//let p = ptr::addr_of(*b);
- //error!{"drop %?", p};
+ //error!("drop %?", p);
let old_count = atomic_sub_rel(&mut b.header.ref_count, 1);
//let old_count = atomic_xchng_rel(b.header.ref_count, 0);
if old_count == 1 {
@@ -377,7 +377,7 @@ fn send<T: send, Tbuffer: send>(+p: send_packet_buffered<T, Tbuffer>,
}
full => fail ~"duplicate send",
blocked => {
- debug!{"waking up task for %?", p_};
+ debug!("waking up task for %?", p_);
let old_task = swap_task(&mut p.header.blocked_task, ptr::null());
if !old_task.is_null() {
rustrt::task_signal_event(
@@ -461,7 +461,7 @@ fn try_recv<T: send, Tbuffer: send>(+p: recv_packet_buffered<T, Tbuffer>)
blocked);
match old_state {
empty => {
- debug!{"no data available on %?, going to sleep.", p_};
+ debug!("no data available on %?, going to sleep.", p_);
if count == 0 {
wait_event(this);
}
@@ -474,7 +474,7 @@ fn try_recv<T: send, Tbuffer: send>(+p: recv_packet_buffered<T, Tbuffer>)
// sometimes blocking the thing we are waiting on.
task::yield();
}
- debug!{"woke up, p.state = %?", copy p.header.state};
+ debug!("woke up, p.state = %?", copy p.header.state);
}
blocked => if first {
fail ~"blocking on already blocked packet"
@@ -603,7 +603,7 @@ fn wait_many<T: selectable>(pkts: &[T]) -> uint {
}
while !data_avail {
- debug!{"sleeping on %? packets", pkts.len()};
+ debug!("sleeping on %? packets", pkts.len());
let event = wait_event(this) as *packet_header;
let pos = vec::position(pkts, |p| p.header() == event);
@@ -612,11 +612,11 @@ fn wait_many<T: selectable>(pkts: &[T]) -> uint {
ready_packet = i;
data_avail = true;
}
- none => debug!{"ignoring spurious event, %?", event}
+ none => debug!("ignoring spurious event, %?", event)
}
}
- debug!{"%?", pkts[ready_packet]};
+ debug!("%?", pkts[ready_packet]);
for pkts.each |p| { unsafe{ (*p.header()).unblock()} }
@@ -725,7 +725,7 @@ struct send_packet_buffered<T: send, Tbuffer: send> {
let mut p: option<*packet<T>>;
let mut buffer: option<buffer_resource<Tbuffer>>;
new(p: *packet<T>) {
- //debug!{"take send %?", p};
+ //debug!("take send %?", p);
self.p = some(p);
unsafe {
self.buffer = some(
@@ -735,17 +735,17 @@ struct send_packet_buffered<T: send, Tbuffer: send> {
}
drop {
//if self.p != none {
- // debug!{"drop send %?", option::get(self.p)};
+ // debug!("drop send %?", option::get(self.p));
//}
if self.p != none {
let mut p = none;
p <-> self.p;
sender_terminate(option::unwrap(p))
}
- //unsafe { error!{"send_drop: %?",
+ //unsafe { error!("send_drop: %?",
// if self.buffer == none {
// "none"
- // } else { "some" }}; }
+ // } else { "some" }); }
}
fn unwrap() -> *packet<T> {
let mut p = none;
@@ -766,7 +766,7 @@ struct send_packet_buffered<T: send, Tbuffer: send> {
}
fn reuse_buffer() -> buffer_resource<Tbuffer> {
- //error!{"send reuse_buffer"};
+ //error!("send reuse_buffer");
let mut tmp = none;
tmp <-> self.buffer;
option::unwrap(tmp)
@@ -786,7 +786,7 @@ struct recv_packet_buffered<T: send, Tbuffer: send> : selectable {
let mut p: option<*packet<T>>;
let mut buffer: option<buffer_resource<Tbuffer>>;
new(p: *packet<T>) {
- //debug!{"take recv %?", p};
+ //debug!("take recv %?", p);
self.p = some(p);
unsafe {
self.buffer = some(
@@ -796,17 +796,17 @@ struct recv_packet_buffered<T: send, Tbuffer: send> : selectable {
}
drop {
//if self.p != none {
- // debug!{"drop recv %?", option::get(self.p)};
+ // debug!("drop recv %?", option::get(self.p));
//}
if self.p != none {
let mut p = none;
p <-> self.p;
receiver_terminate(option::unwrap(p))
}
- //unsafe { error!{"recv_drop: %?",
+ //unsafe { error!("recv_drop: %?",
// if self.buffer == none {
// "none"
- // } else { "some" }}; }
+ // } else { "some" }); }
}
fn unwrap() -> *packet<T> {
let mut p = none;
@@ -827,7 +827,7 @@ struct recv_packet_buffered<T: send, Tbuffer: send> : selectable {
}
fn reuse_buffer() -> buffer_resource<Tbuffer> {
- //error!{"recv reuse_buffer"};
+ //error!("recv reuse_buffer");
let mut tmp = none;
tmp