Skip to content

Commit 766bb71

Browse files
committed
---
yaml --- r: 5067 b: refs/heads/master c: 498e38b h: refs/heads/master i: 5065: a2a896b 5063: e656cd7 v: v3
1 parent 0fed73c commit 766bb71

Some content is hidden

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

52 files changed

+346
-381
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 959938e89144435c3a2fb1752527cfb17dd071a4
2+
refs/heads/master: 498e38b705348333df9ab02059d07f114baccc45

trunk/src/comp/back/link.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,7 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &istr,
341341
fn crate_meta_extras_hash(sha: sha1, _crate: &ast::crate,
342342
metas: &provided_metas) -> istr {
343343
fn len_and_str(s: &istr) -> istr {
344-
ret istr::from_estr(#fmt["%u_%s",
345-
istr::byte_len(s),
346-
istr::to_estr(s)]);
344+
ret #ifmt["%u_%s", istr::byte_len(s), s];
347345
}
348346

349347
fn len_and_str_lit(l: &ast::lit) -> istr {
@@ -374,9 +372,9 @@ fn build_link_meta(sess: &session::session, c: &ast::crate, output: &istr,
374372

375373
fn warn_missing(sess: &session::session, name: &istr, default: &istr) {
376374
if !sess.get_opts().library { ret; }
377-
sess.warn(istr::from_estr(
378-
#fmt["missing crate link meta '%s', using '%s' as default",
379-
istr::to_estr(name), istr::to_estr(default)]));
375+
sess.warn(
376+
#ifmt["missing crate link meta '%s', using '%s' as default",
377+
name, default]);
380378
}
381379

382380
fn crate_meta_name(sess: &session::session, _crate: &ast::crate,
@@ -461,9 +459,7 @@ fn mangle(ss: &[istr]) -> istr {
461459
let n = ~"_ZN"; // Begin name-sequence.
462460

463461
for s: istr in ss {
464-
n += istr::from_estr(#fmt["%u%s",
465-
istr::byte_len(s),
466-
istr::to_estr(s)]);
462+
n += #ifmt["%u%s", istr::byte_len(s), s];
467463
}
468464
n += ~"E"; // End name-sequence.
469465

trunk/src/comp/driver/rustc.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ fn time<@T>(do_it: bool, what: &istr, thunk: fn() -> T) -> T {
122122
let start = std::time::precise_time_s();
123123
let rv = thunk();
124124
let end = std::time::precise_time_s();
125-
log_err #fmt["time: %s took %s s", istr::to_estr(what),
126-
istr::to_estr(common::float_to_str(end - start, 3u))];
125+
log_err #ifmt["time: %s took %s s", what,
126+
common::float_to_str(end - start, 3u)];
127127
ret rv;
128128
}
129129

@@ -255,21 +255,21 @@ fn pretty_print_input(sess: session::session, cfg: ast::crate_cfg,
255255
}
256256
257257
fn version(argv0: &istr) {
258-
let vers = "unknown version";
258+
let vers = ~"unknown version";
259259
// FIXME: Restore after istr conversion
260260
//let env_vers = #env["CFG_VERSION"];
261-
let env_vers = "FIXME";
262-
if str::byte_len(env_vers) != 0u { vers = env_vers; }
261+
let env_vers = ~"FIXME";
262+
if istr::byte_len(env_vers) != 0u { vers = env_vers; }
263263
io::stdout().write_str(
264-
istr::from_estr(#fmt["%s %s\n",
265-
istr::to_estr(argv0),
266-
vers]));
264+
#ifmt["%s %s\n",
265+
argv0,
266+
vers]);
267267
}
268268

269269
fn usage(argv0: &istr) {
270-
io::stdout().write_str(istr::from_estr(
271-
#fmt["usage: %s [options] <input>\n", istr::to_estr(argv0)] +
272-
"
270+
io::stdout().write_str(
271+
#ifmt["usage: %s [options] <input>\n", argv0] +
272+
~"
273273
options:
274274

275275
-h --help display this message
@@ -302,7 +302,7 @@ options:
302302
--test build test harness
303303
--gc garbage collect shared data (experimental/temporary)
304304

305-
"));
305+
");
306306
}
307307
308308
fn get_os(triple: &istr) -> session::os {
@@ -473,7 +473,7 @@ fn main(args: [str]) {
473473
alt getopts::getopts(args, opts()) {
474474
getopts::success(m) { m }
475475
getopts::failure(f) {
476-
log_err #fmt["error: %s", istr::to_estr(getopts::fail_str(f))];
476+
log_err #ifmt["error: %s", getopts::fail_str(f)];
477477
fail
478478
}
479479
};
@@ -637,11 +637,11 @@ fn main(args: [str]) {
637637

638638
let err_code = run::run_program(prog, gcc_args);
639639
if 0 != err_code {
640-
sess.err(istr::from_estr(
641-
#fmt["linking with gcc failed with code %d", err_code]));
642-
sess.note(istr::from_estr(
643-
#fmt["gcc arguments: %s",
644-
istr::to_estr(istr::connect(gcc_args, ~" "))]));
640+
sess.err(
641+
#ifmt["linking with gcc failed with code %d", err_code]);
642+
sess.note(
643+
#ifmt["gcc arguments: %s",
644+
istr::connect(gcc_args, ~" ")]);
645645
sess.abort_if_errors();
646646
}
647647
// Clean up on Darwin

trunk/src/comp/driver/session.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ obj session(targ_cfg: @config,
9595
}
9696
fn span_bug(sp: span, msg: &istr) -> ! {
9797
self.span_fatal(sp,
98-
istr::from_estr(#fmt["internal compiler error %s",
99-
istr::to_estr(msg)]));
98+
#ifmt["internal compiler error %s",
99+
msg]);
100100
}
101101
fn bug(msg: &istr) -> ! {
102-
self.fatal(istr::from_estr(
103-
#fmt["internal compiler error %s",
104-
istr::to_estr(msg)]));
102+
self.fatal(
103+
#ifmt["internal compiler error %s",
104+
msg]);
105105
}
106106
fn span_unimpl(sp: span, msg: &istr) -> ! {
107107
self.span_bug(sp, ~"unimplemented " + msg);

trunk/src/comp/front/attr.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,11 @@ fn eq(a: @ast::meta_item, b: @ast::meta_item) -> bool {
124124
}
125125

126126
fn contains(haystack: &[@ast::meta_item], needle: @ast::meta_item) -> bool {
127-
log #fmt["looking for %s",
128-
istr::to_estr(
129-
syntax::print::pprust::meta_item_to_str(*needle))];
127+
log #ifmt["looking for %s",
128+
syntax::print::pprust::meta_item_to_str(*needle)];
130129
for item: @ast::meta_item in haystack {
131-
log #fmt["looking in %s",
132-
istr::to_estr(
133-
syntax::print::pprust::meta_item_to_str(*item))];
130+
log #ifmt["looking in %s",
131+
syntax::print::pprust::meta_item_to_str(*item)];
134132
if eq(item, needle) { log "found it!"; ret true; }
135133
}
136134
log "found it not :(";
@@ -185,9 +183,9 @@ fn require_unique_names(sess: &session::session, metas: &[@ast::meta_item]) {
185183
for meta: @ast::meta_item in metas {
186184
let name = get_meta_item_name(meta);
187185
if map.contains_key(name) {
188-
sess.span_fatal(meta.span, istr::from_estr(
189-
#fmt["duplicate meta item `%s`",
190-
istr::to_estr(name)]));
186+
sess.span_fatal(meta.span,
187+
#ifmt["duplicate meta item `%s`",
188+
name]);
191189
}
192190
map.insert(name, ());
193191
}

trunk/src/comp/front/test.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ fn fold_item(cx: &test_ctxt, i: &@ast::item, fld: fold::ast_fold) ->
9292
@ast::item {
9393

9494
cx.path += [i.ident];
95-
log #fmt["current path: %s",
96-
istr::to_estr(ast_util::path_name_i(cx.path))];
95+
log #ifmt["current path: %s",
96+
ast_util::path_name_i(cx.path)];
9797

9898
if is_test_fn(i) {
9999
log "this is a test function";
100100
let test = {path: cx.path, ignore: is_ignored(i)};
101101
cx.testfns += [test];
102-
log #fmt["have %u test functions", vec::len(cx.testfns)];
102+
log #ifmt["have %u test functions", vec::len(cx.testfns)];
103103
}
104104

105105
let res = fold::noop_fold_item(i, fld);
@@ -168,8 +168,8 @@ fn mk_test_module(cx: &test_ctxt) -> @ast::item {
168168
node: item_,
169169
span: dummy_sp()};
170170

171-
log #fmt["Synthetic test module:\n%s\n",
172-
istr::to_estr(pprust::item_to_str(@item))];
171+
log #ifmt["Synthetic test module:\n%s\n",
172+
pprust::item_to_str(@item)];
173173

174174
ret @item;
175175
}
@@ -234,7 +234,7 @@ fn mk_test_desc_vec_ty(cx: &test_ctxt) -> @ast::ty {
234234
}
235235

236236
fn mk_test_desc_vec(cx: &test_ctxt) -> @ast::expr {
237-
log #fmt["building test vector from %u tests", vec::len(cx.testfns)];
237+
log #ifmt["building test vector from %u tests", vec::len(cx.testfns)];
238238
let descs = [];
239239
for test: test in cx.testfns {
240240
let test_ = test; // Satisfy alias analysis
@@ -249,8 +249,8 @@ fn mk_test_desc_vec(cx: &test_ctxt) -> @ast::expr {
249249
fn mk_test_desc_rec(cx: &test_ctxt, test: test) -> @ast::expr {
250250
let path = test.path;
251251

252-
log #fmt["encoding %s",
253-
istr::to_estr(ast_util::path_name_i(path))];
252+
log #ifmt["encoding %s",
253+
ast_util::path_name_i(path)];
254254

255255
let name_lit: ast::lit =
256256
nospan(ast::lit_str(ast_util::path_name_i(path), ast::sk_rc));

trunk/src/comp/lib/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ fn type_to_str_inner(names: type_names, outer0: &[TypeRef], ty: TypeRef) ->
10401040
}
10411041
13 { ret ~"Vector"; }
10421042
14 { ret ~"Metadata"; }
1043-
_ { log_err #fmt["unknown TypeKind %d", kind as int]; fail; }
1043+
_ { log_err #ifmt["unknown TypeKind %d", kind as int]; fail; }
10441044
}
10451045
}
10461046

trunk/src/comp/metadata/creader.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ fn metadata_matches(crate_data: &@[u8], metas: &[@ast::meta_item]) -> bool {
100100
let attrs = decoder::get_crate_attributes(crate_data);
101101
let linkage_metas = attr::find_linkage_metas(attrs);
102102

103-
log #fmt["matching %u metadata requirements against %u items",
103+
log #ifmt["matching %u metadata requirements against %u items",
104104
vec::len(metas), vec::len(linkage_metas)];
105105

106106
for needed: @ast::meta_item in metas {
107107
if !attr::contains(linkage_metas, needed) {
108-
log #fmt["missing %s",
109-
istr::to_estr(pprust::meta_item_to_str(*needed))];
108+
log #ifmt["missing %s",
109+
pprust::meta_item_to_str(*needed)];
110110
ret false;
111111
}
112112
}
@@ -170,27 +170,27 @@ fn find_library_crate_aux(nn: &{prefix: istr, suffix: istr},
170170
// manually filtering fs::list_dir here.
171171

172172
for library_search_path: istr in library_search_paths {
173-
log #fmt["searching %s", istr::to_estr(library_search_path)];
173+
log #ifmt["searching %s", library_search_path];
174174
for path: istr in fs::list_dir(library_search_path) {
175-
log #fmt["searching %s", istr::to_estr(path)];
175+
log #ifmt["searching %s", path];
176176
let f: istr = fs::basename(path);
177177
if !(istr::starts_with(f, prefix) && istr::ends_with(f, suffix))
178178
{
179-
log #fmt["skipping %s, doesn't look like %s*%s",
180-
istr::to_estr(path),
181-
istr::to_estr(prefix),
182-
istr::to_estr(suffix)];
179+
log #ifmt["skipping %s, doesn't look like %s*%s",
180+
path,
181+
prefix,
182+
suffix];
183183
cont;
184184
}
185185
alt get_metadata_section(path) {
186186
option::some(cvec) {
187187
if !metadata_matches(cvec, metas) {
188-
log #fmt["skipping %s, metadata doesn't match",
189-
istr::to_estr(path)];
188+
log #ifmt["skipping %s, metadata doesn't match",
189+
path];
190190
cont;
191191
}
192-
log #fmt["found %s with matching metadata",
193-
istr::to_estr(path)];
192+
log #ifmt["found %s with matching metadata",
193+
path];
194194
ret some({ident: path, data: cvec});
195195
}
196196
_ { }
@@ -230,9 +230,9 @@ fn load_library_crate(sess: &session::session, span: span, ident: &ast::ident,
230230
alt find_library_crate(sess, ident, metas, library_search_paths) {
231231
some(t) { ret t; }
232232
none. {
233-
sess.span_fatal(span, istr::from_estr(
234-
#fmt["can't find crate for '%s'",
235-
istr::to_estr(ident)]));
233+
sess.span_fatal(span,
234+
#ifmt["can't find crate for '%s'",
235+
ident]);
236236
}
237237
}
238238
}
@@ -275,7 +275,7 @@ fn resolve_crate_deps(e: env, cdata: &@[u8]) -> cstore::cnum_map {
275275
for dep: decoder::crate_dep in decoder::get_crate_deps(cdata) {
276276
let extrn_cnum = dep.cnum;
277277
let cname = dep.ident;
278-
log #fmt["resolving dep %s", istr::to_estr(cname)];
278+
log #ifmt["resolving dep %s", cname];
279279
if e.crate_cache.contains_key(cname) {
280280
log "already have it";
281281
// We've already seen this crate

trunk/src/comp/metadata/decoder.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,8 @@ fn get_attributes(md: &ebml::doc) -> [ast::attribute] {
349349
fn list_meta_items(meta_items: &ebml::doc, out: io::writer) {
350350
for mi: @ast::meta_item in get_meta_items(meta_items) {
351351
out.write_str(
352-
istr::from_estr(
353-
#fmt["%s\n",
354-
istr::to_estr(pprust::meta_item_to_str(*mi))]));
352+
#ifmt["%s\n",
353+
pprust::meta_item_to_str(*mi)]);
355354
}
356355
}
357356

@@ -360,9 +359,8 @@ fn list_crate_attributes(md: &ebml::doc, out: io::writer) {
360359

361360
for attr: ast::attribute in get_attributes(md) {
362361
out.write_str(
363-
istr::from_estr(
364-
#fmt["%s\n",
365-
istr::to_estr(pprust::attribute_to_str(attr))]));
362+
#ifmt["%s\n",
363+
pprust::attribute_to_str(attr)]);
366364
}
367365

368366
out.write_str(~"\n\n");
@@ -392,8 +390,8 @@ fn list_crate_deps(data: @[u8], out: io::writer) {
392390

393391
for dep: crate_dep in get_crate_deps(data) {
394392
out.write_str(
395-
istr::from_estr(#fmt["%d %s\n", dep.cnum,
396-
istr::to_estr(dep.ident)]));
393+
#ifmt["%d %s\n", dep.cnum,
394+
dep.ident]);
397395
}
398396

399397
out.write_str(~"\n");
@@ -414,10 +412,9 @@ fn list_crate_items(bytes: &@[u8], md: &ebml::doc, out: io::writer) {
414412
let did_doc = ebml::get_doc(def, tag_def_id);
415413
let did = parse_def_id(ebml::doc_data(did_doc));
416414
out.write_str(
417-
istr::from_estr(
418-
#fmt["%s (%s)\n",
419-
istr::to_estr(data.path),
420-
istr::to_estr(describe_def(items, did))]));
415+
#ifmt["%s (%s)\n",
416+
data.path,
417+
describe_def(items, did)]);
421418
}
422419
}
423420
out.write_str(~"\n");

trunk/src/comp/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ fn encode_inlineness(ebml_w: &ebml::writer, c: u8) {
178178
}
179179

180180
fn def_to_str(did: &def_id) -> istr {
181-
ret istr::from_estr(#fmt["%d:%d", did.crate, did.node]);
181+
ret #ifmt["%d:%d", did.crate, did.node];
182182
}
183183

184184
fn encode_type_param_kinds(ebml_w: &ebml::writer, tps: &[ty_param]) {

trunk/src/comp/middle/alias.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ fn check_call(cx: &ctx, f: &@ast::expr, args: &[@ast::expr], sc: &scope) ->
257257
alt f.node {
258258
ast::expr_path(_) {
259259
if def_is_local(cx.tcx.def_map.get(f.id), true) {
260-
cx.tcx.sess.span_err(f.span, istr::from_estr(
261-
#fmt["function may alias with \
260+
cx.tcx.sess.span_err(f.span,
261+
#ifmt["function may alias with \
262262
argument %u, which is not immutably rooted",
263-
unsafe_t_offsets[0]]));
263+
unsafe_t_offsets[0]]);
264264
}
265265
}
266266
_ { }
@@ -275,10 +275,10 @@ fn check_call(cx: &ctx, f: &@ast::expr, args: &[@ast::expr], sc: &scope) ->
275275
let mut_alias = arg_t.mode == ty::mo_alias(true);
276276
if i != offset &&
277277
ty_can_unsafely_include(cx, unsafe, arg_t.ty, mut_alias) {
278-
cx.tcx.sess.span_err(args[i].span, istr::from_estr(
279-
#fmt["argument %u may alias with \
278+
cx.tcx.sess.span_err(args[i].span,
279+
#ifmt["argument %u may alias with \
280280
argument %u, which is not immutably rooted",
281-
i, offset]));
281+
i, offset]);
282282
}
283283
i += 1u;
284284
}

0 commit comments

Comments
 (0)