diff --git a/src/librustc/front/intrinsic.rs b/src/librustc/front/intrinsic.rs index 2a87f089c8db..9a9229ebaef1 100644 --- a/src/librustc/front/intrinsic.rs +++ b/src/librustc/front/intrinsic.rs @@ -1,4 +1,4 @@ -// NB: this file is #include_str'ed into the compiler, re-parsed +// NB: this file is include_str!'ed into the compiler, re-parsed // and injected into each crate the compiler builds. Keep it small. mod intrinsic { diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index ec7c2ffc6f1d..0790208244e9 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -1536,7 +1536,7 @@ fn check_expr(expr: @expr, &&self: @Liveness, vt: vt<@Liveness>) { // Probably a bad error message (what's an rvalue?) // but I can't think of anything better self.tcx.sess.span_err(arg_expr.span, - #fmt("Move mode argument must be an rvalue: try \ + fmt!("Move mode argument must be an rvalue: try \ (move %s) instead", expr_to_str(*arg_expr, self.tcx.sess.intr()))); } diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index e7cf5fa8ad8a..efa89e217399 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -1533,7 +1533,7 @@ fn subst(cx: ctxt, cx, typ, |r| match r { re_bound(br_self) => substs.self_r.expect( - #fmt("ty::subst: \ + fmt!("ty::subst: \ Reference to self region when given substs with no \ self region, ty = %s", ty_to_str(cx, typ))), _ => r diff --git a/src/librustc/middle/typeck/check.rs b/src/librustc/middle/typeck/check.rs index 3f96f5af1a1a..80cc61a8d074 100644 --- a/src/librustc/middle/typeck/check.rs +++ b/src/librustc/middle/typeck/check.rs @@ -2430,7 +2430,7 @@ fn check_enum_variants(ccx: @crate_ctxt, } Err(err) => { ccx.tcx.sess.span_err(e.span, - #fmt("expected constant: %s", err)); + fmt!("expected constant: %s", err)); } } diff --git a/src/libstd/serialization.rs b/src/libstd/serialization.rs index 1b2cd0aaa3db..93d025a77860 100644 --- a/src/libstd/serialization.rs +++ b/src/libstd/serialization.rs @@ -376,7 +376,7 @@ pub impl> Option: Deserializable { match i { 0 => None, 1 => Some(d.read_enum_variant_arg(0u, || deserialize(d))), - _ => fail(#fmt("Bad variant for option: %u", i)) + _ => fail(fmt!("Bad variant for option: %u", i)) } } } diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs index 9b41d90e6d04..45c8fd76e4f2 100644 --- a/src/libsyntax/ext/source_util.rs +++ b/src/libsyntax/ext/source_util.rs @@ -57,7 +57,7 @@ fn expand_mod(cx: ext_ctxt, sp: span, arg: ast::mac_arg, _body: ast::mac_body) fn expand_include(cx: ext_ctxt, sp: span, arg: ast::mac_arg, _body: ast::mac_body) -> @ast::expr { let args = get_mac_args(cx, sp, arg, 1u, option::Some(1u), ~"include"); - let file = expr_to_str(cx, args[0], ~"#include_str requires a string"); + let file = expr_to_str(cx, args[0], ~"include_str! requires a string"); let p = parse::new_parser_from_file(cx.parse_sess(), cx.cfg(), &res_rel_file(cx, sp, &Path(file)), parse::parser::SOURCE_FILE); @@ -68,7 +68,7 @@ fn expand_include_str(cx: ext_ctxt, sp: codemap::span, arg: ast::mac_arg, _body: ast::mac_body) -> @ast::expr { let args = get_mac_args(cx,sp,arg,1u,option::Some(1u),~"include_str"); - let file = expr_to_str(cx, args[0], ~"#include_str requires a string"); + let file = expr_to_str(cx, args[0], ~"include_str! requires a string"); let res = io::read_whole_file_str(&res_rel_file(cx, sp, &Path(file))); match res { @@ -85,7 +85,7 @@ fn expand_include_bin(cx: ext_ctxt, sp: codemap::span, arg: ast::mac_arg, _body: ast::mac_body) -> @ast::expr { let args = get_mac_args(cx,sp,arg,1u,option::Some(1u),~"include_bin"); - let file = expr_to_str(cx, args[0], ~"#include_bin requires a string"); + let file = expr_to_str(cx, args[0], ~"include_bin! requires a string"); match io::read_whole_file(&res_rel_file(cx, sp, &Path(file))) { result::Ok(src) => { diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index 6f90a2c99e81..3cc1163eb22b 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -8,14 +8,12 @@ use std::map::{Map, HashMap}; use io::{Reader, ReaderUtil}; +macro_rules! bench ( + ($id:ident) => (maybe_run_test(argv, stringify!($id), $id)) +) + fn main() { let argv = os::args(); - #macro[ - [#bench[id], - maybe_run_test(argv, #stringify(id), id) - ] - ]; - let tests = vec::view(argv, 1, argv.len()); bench!(shift_push); diff --git a/src/test/bench/msgsend-ring-pipes.rs b/src/test/bench/msgsend-ring-pipes.rs index 636fef53732d..da49b006cd9e 100644 --- a/src/test/bench/msgsend-ring-pipes.rs +++ b/src/test/bench/msgsend-ring-pipes.rs @@ -18,12 +18,9 @@ proto! ring ( } ) -fn macros() { - #macro[ - [#move_out[x], - unsafe { let y = move *ptr::addr_of(&x); move y }] - ]; -} +macro_rules! move_out ( + ($x:expr) => { unsafe { let y = move *ptr::addr_of(&$x); move y } } +) fn thread_ring(i: uint, count: uint, diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index 3a3c609853b3..c395ff39430c 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -132,7 +132,7 @@ fn main() { let args = os::args(); let rdr = if os::getenv(~"RUST_BENCH").is_some() { // FIXME: Using this compile-time env variable is a crummy way to - // get to this massive data set, but #include_bin chokes on it (#2598) + // get to this massive data set, but include_bin! chokes on it (#2598) let path = Path(env!("CFG_SRC_DIR")) .push_rel(&Path("src/test/bench/shootout-k-nucleotide.data")); result::get(&io::file_reader(&path)) diff --git a/src/test/bench/shootout-k-nucleotide.rs b/src/test/bench/shootout-k-nucleotide.rs index e4373d55c179..a4ff9ef16407 100644 --- a/src/test/bench/shootout-k-nucleotide.rs +++ b/src/test/bench/shootout-k-nucleotide.rs @@ -129,7 +129,7 @@ fn main() { let args = os::args(); let rdr = if os::getenv(~"RUST_BENCH").is_some() { // FIXME: Using this compile-time env variable is a crummy way to - // get to this massive data set, but #include_bin chokes on it (#2598) + // get to this massive data set, but include_bin! chokes on it (#2598) let path = Path(env!("CFG_SRC_DIR")) .push_rel(&Path("src/test/bench/shootout-k-nucleotide.data")); result::get(&io::file_reader(&path)) diff --git a/src/test/compile-fail/issue-2823.rs b/src/test/compile-fail/issue-2823.rs index fd2c17584581..67e028dcd46d 100644 --- a/src/test/compile-fail/issue-2823.rs +++ b/src/test/compile-fail/issue-2823.rs @@ -1,12 +1,12 @@ struct C { x: int, drop { - #error("dropping: %?", self.x); + error!("dropping: %?", self.x); } } fn main() { let c = C{ x: 2}; let d = copy c; //~ ERROR copying a noncopyable value - #error("%?", d.x); + error!("%?", d.x); } \ No newline at end of file diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 5cc39f4d683d..132fd47636bb 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -71,7 +71,7 @@ mod test { #[test] fn read_simple_board() { - let s = #include_str("./maps/contest1.map"); + let s = include_str!("./maps/contest1.map"); io::with_str_reader(s, read_board_grid) } } diff --git a/src/test/run-pass/macro-2.rs b/src/test/run-pass/macro-2.rs index 31f6d60df23a..595583d2cefe 100644 --- a/src/test/run-pass/macro-2.rs +++ b/src/test/run-pass/macro-2.rs @@ -1,13 +1,6 @@ // xfail-pretty - token trees can't pretty print fn main() { - #macro[[#mylambda[x, body], - { - fn f(x: int) -> int { return body; } - f - }]]; - - assert (mylambda!(y, y * 2)(8) == 16); macro_rules! mylambda_tt( ($x:ident, $body:expr) => { diff --git a/src/test/run-pass/syntax-extension-shell.rs b/src/test/run-pass/syntax-extension-shell.rs index 6ec80db8d55b..2507057c6481 100644 --- a/src/test/run-pass/syntax-extension-shell.rs +++ b/src/test/run-pass/syntax-extension-shell.rs @@ -1,5 +1,5 @@ // xfail-test fn main() { - auto s = #shell { uname -a }; + let s = shell!( uname -a ); log(debug, s); } diff --git a/src/test/run-pass/syntax-extension-source-utils.rs b/src/test/run-pass/syntax-extension-source-utils.rs index 7afb74fa1217..2a6b5d644f1a 100644 --- a/src/test/run-pass/syntax-extension-source-utils.rs +++ b/src/test/run-pass/syntax-extension-source-utils.rs @@ -1,5 +1,5 @@ // This test is brittle! -// xfail-pretty - the pretty tests lose path information, breaking #include +// xfail-pretty - the pretty tests lose path information, breaking include! #[legacy_exports]; mod m1 {