Skip to content

Commit fd2c012

Browse files
committed
auto merge of #10006 : alexcrichton/rust/another-massive-rename, r=brson
Drop the `2` suffix on all of them, updating all code in the process of doing so. This is a completely automated change, and it's dependent on the snapshots going through.
2 parents cd8c7cf + 3ed18bd commit fd2c012

File tree

729 files changed

+3091
-3099
lines changed

Some content is hidden

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

729 files changed

+3091
-3099
lines changed

doc/rust.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -700,15 +700,15 @@ mod math {
700700
type complex = (f64, f64);
701701
fn sin(f: f64) -> f64 {
702702
...
703-
# fail2!();
703+
# fail!();
704704
}
705705
fn cos(f: f64) -> f64 {
706706
...
707-
# fail2!();
707+
# fail!();
708708
}
709709
fn tan(f: f64) -> f64 {
710710
...
711-
# fail2!();
711+
# fail!();
712712
}
713713
}
714714
~~~~
@@ -1059,8 +1059,8 @@ output slot type would normally be. For example:
10591059

10601060
~~~~
10611061
fn my_err(s: &str) -> ! {
1062-
info2!("{}", s);
1063-
fail2!();
1062+
info!("{}", s);
1063+
fail!();
10641064
}
10651065
~~~~
10661066

@@ -1078,7 +1078,7 @@ were declared without the `!` annotation, the following code would not
10781078
typecheck:
10791079

10801080
~~~~
1081-
# fn my_err(s: &str) -> ! { fail2!() }
1081+
# fn my_err(s: &str) -> ! { fail!() }
10821082
10831083
fn f(i: int) -> int {
10841084
if i == 42 {
@@ -2826,9 +2826,9 @@ enum List<X> { Nil, Cons(X, @List<X>) }
28262826
let x: List<int> = Cons(10, @Cons(11, @Nil));
28272827
28282828
match x {
2829-
Cons(_, @Nil) => fail2!("singleton list"),
2829+
Cons(_, @Nil) => fail!("singleton list"),
28302830
Cons(*) => return,
2831-
Nil => fail2!("empty list")
2831+
Nil => fail!("empty list")
28322832
}
28332833
~~~~
28342834

@@ -2864,7 +2864,7 @@ match x {
28642864
return;
28652865
}
28662866
_ => {
2867-
fail2!();
2867+
fail!();
28682868
}
28692869
}
28702870
~~~~
@@ -2918,7 +2918,7 @@ guard may refer to the variables bound within the pattern they follow.
29182918
let message = match maybe_digit {
29192919
Some(x) if x < 10 => process_digit(x),
29202920
Some(x) => process_other(x),
2921-
None => fail2!()
2921+
None => fail!()
29222922
};
29232923
~~~~
29242924

@@ -3669,10 +3669,10 @@ that demonstrates all four of them:
36693669

36703670
~~~~
36713671
fn main() {
3672-
error2!("This is an error log")
3673-
warn2!("This is a warn log")
3674-
info2!("this is an info log")
3675-
debug2!("This is a debug log")
3672+
error!("This is an error log")
3673+
warn!("This is a warn log")
3674+
info!("this is an info log")
3675+
debug!("This is a debug log")
36763676
}
36773677
~~~~
36783678

doc/tutorial-macros.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ match x {
226226
// complicated stuff goes here
227227
return result + val;
228228
},
229-
_ => fail2!("Didn't get good_2")
229+
_ => fail!("Didn't get good_2")
230230
}
231231
}
232232
_ => return 0 // default value
@@ -268,7 +268,7 @@ macro_rules! biased_match (
268268
biased_match!((x) ~ (good_1(g1, val)) else { return 0 };
269269
binds g1, val )
270270
biased_match!((g1.body) ~ (good_2(result) )
271-
else { fail2!("Didn't get good_2") };
271+
else { fail!("Didn't get good_2") };
272272
binds result )
273273
// complicated stuff goes here
274274
return result + val;
@@ -369,7 +369,7 @@ macro_rules! biased_match (
369369
# fn f(x: t1) -> uint {
370370
biased_match!(
371371
(x) ~ (good_1(g1, val)) else { return 0 };
372-
(g1.body) ~ (good_2(result) ) else { fail2!("Didn't get good_2") };
372+
(g1.body) ~ (good_2(result) ) else { fail!("Didn't get good_2") };
373373
binds val, result )
374374
// complicated stuff goes here
375375
return result + val;

doc/tutorial.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ unit, `()`, as the empty tuple if you like).
763763
~~~~
764764
let mytup: (int, int, f64) = (10, 20, 30.0);
765765
match mytup {
766-
(a, b, c) => info2!("{}", a + b + (c as int))
766+
(a, b, c) => info!("{}", a + b + (c as int))
767767
}
768768
~~~~
769769

@@ -779,7 +779,7 @@ For example:
779779
struct MyTup(int, int, f64);
780780
let mytup: MyTup = MyTup(10, 20, 30.0);
781781
match mytup {
782-
MyTup(a, b, c) => info2!("{}", a + b + (c as int))
782+
MyTup(a, b, c) => info!("{}", a + b + (c as int))
783783
}
784784
~~~~
785785

@@ -1576,7 +1576,7 @@ arguments.
15761576
use std::task::spawn;
15771577
15781578
do spawn() || {
1579-
debug2!("I'm a task, whatever");
1579+
debug!("I'm a task, whatever");
15801580
}
15811581
~~~~
15821582

@@ -1588,7 +1588,7 @@ may be omitted from `do` expressions.
15881588
use std::task::spawn;
15891589
15901590
do spawn {
1591-
debug2!("Kablam!");
1591+
debug!("Kablam!");
15921592
}
15931593
~~~~
15941594

src/compiletest/compiletest.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,20 @@ pub fn parse_config(args: ~[~str]) -> config {
8585
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
8686
println(getopts::groups::usage(message, groups));
8787
println("");
88-
fail2!()
88+
fail!()
8989
}
9090

9191
let matches =
9292
&match getopts::groups::getopts(args_, groups) {
9393
Ok(m) => m,
94-
Err(f) => fail2!("{}", f.to_err_msg())
94+
Err(f) => fail!("{}", f.to_err_msg())
9595
};
9696

9797
if matches.opt_present("h") || matches.opt_present("help") {
9898
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
9999
println(getopts::groups::usage(message, groups));
100100
println("");
101-
fail2!()
101+
fail!()
102102
}
103103

104104
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
@@ -203,7 +203,7 @@ pub fn str_mode(s: ~str) -> mode {
203203
~"pretty" => mode_pretty,
204204
~"debug-info" => mode_debug_info,
205205
~"codegen" => mode_codegen,
206-
_ => fail2!("invalid mode")
206+
_ => fail!("invalid mode")
207207
}
208208
}
209209

@@ -226,7 +226,7 @@ pub fn run_tests(config: &config) {
226226
// For context, see #8904
227227
rt::test::prepare_for_lots_of_tests();
228228
let res = test::run_tests_console(&opts, tests);
229-
if !res { fail2!("Some tests failed"); }
229+
if !res { fail!("Some tests failed"); }
230230
}
231231

232232
pub fn test_opts(config: &config) -> test::TestOpts {
@@ -244,13 +244,13 @@ pub fn test_opts(config: &config) -> test::TestOpts {
244244
}
245245

246246
pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
247-
debug2!("making tests from {}",
247+
debug!("making tests from {}",
248248
config.src_base.display());
249249
let mut tests = ~[];
250250
let dirs = os::list_dir_path(&config.src_base);
251251
for file in dirs.iter() {
252252
let file = file.clone();
253-
debug2!("inspecting file {}", file.display());
253+
debug!("inspecting file {}", file.display());
254254
if is_test(config, &file) {
255255
let t = do make_test(config, &file) {
256256
match config.mode {

src/compiletest/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
6161
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
6262
let msg = line.slice(idx, len).to_owned();
6363

64-
debug2!("line={} kind={} msg={}", line_num - adjust_line, kind, msg);
64+
debug!("line={} kind={} msg={}", line_num - adjust_line, kind, msg);
6565

6666
return ~[ExpectedError{line: line_num - adjust_line, kind: kind,
6767
msg: msg}];

src/compiletest/header.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ fn parse_exec_env(line: &str) -> Option<(~str, ~str)> {
154154
let end = strs.pop();
155155
(strs.pop(), end)
156156
}
157-
n => fail2!("Expected 1 or 2 strings, not {}", n)
157+
n => fail!("Expected 1 or 2 strings, not {}", n)
158158
}
159159
}
160160
}
@@ -183,7 +183,7 @@ fn parse_name_value_directive(line: &str,
183183
Some(colon) => {
184184
let value = line.slice(colon + keycolon.len(),
185185
line.len()).to_owned();
186-
debug2!("{}: {}", directive, value);
186+
debug!("{}: {}", directive, value);
187187
Some(value)
188188
}
189189
None => None

src/compiletest/runtest.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ pub fn run_metrics(config: config, testfile: ~str, mm: &mut MetricMap) {
6363
io::stdout().write_str("\n\n");
6464
}
6565
let testfile = Path::new(testfile);
66-
debug2!("running {}", testfile.display());
66+
debug!("running {}", testfile.display());
6767
let props = load_props(&testfile);
68-
debug2!("loaded props");
68+
debug!("loaded props");
6969
match config.mode {
7070
mode_compile_fail => run_cfail_test(&config, &props, &testfile),
7171
mode_run_fail => run_rfail_test(&config, &props, &testfile),
@@ -241,7 +241,7 @@ actual:\n\
241241
\n",
242242
expected, actual);
243243
io::stdout().write_str(msg);
244-
fail2!();
244+
fail!();
245245
}
246246
}
247247

@@ -289,7 +289,7 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
289289
let script_str = [~"set charset UTF-8",
290290
cmds,
291291
~"quit\n"].connect("\n");
292-
debug2!("script_str = {}", script_str);
292+
debug!("script_str = {}", script_str);
293293
dump_output_file(config, testfile, script_str, "debugger.script");
294294

295295
// run debugger script with gdb
@@ -348,10 +348,10 @@ fn check_error_patterns(props: &TestProps,
348348
let mut done = false;
349349
for line in ProcRes.stderr.line_iter() {
350350
if line.contains(*next_err_pat) {
351-
debug2!("found error pattern {}", *next_err_pat);
351+
debug!("found error pattern {}", *next_err_pat);
352352
next_err_idx += 1u;
353353
if next_err_idx == props.error_patterns.len() {
354-
debug2!("found all error patterns");
354+
debug!("found all error patterns");
355355
done = true;
356356
break;
357357
}
@@ -423,7 +423,7 @@ fn check_expected_errors(expected_errors: ~[errors::ExpectedError],
423423
let mut was_expected = false;
424424
for (i, ee) in expected_errors.iter().enumerate() {
425425
if !found_flags[i] {
426-
debug2!("prefix={} ee.kind={} ee.msg={} line={}",
426+
debug!("prefix={} ee.kind={} ee.msg={} line={}",
427427
prefixes[i], ee.kind, ee.msg, line);
428428
if (prefix_matches(line, prefixes[i]) &&
429429
line.contains(ee.kind) &&
@@ -626,7 +626,7 @@ fn compose_and_run_compiler(
626626
fn ensure_dir(path: &Path) {
627627
if os::path_is_dir(path) { return; }
628628
if !os::make_dir(path, 0x1c0i32) {
629-
fail2!("can't make dir {}", path.display());
629+
fail!("can't make dir {}", path.display());
630630
}
631631
}
632632

@@ -784,7 +784,7 @@ fn maybe_dump_to_stdout(config: &config, out: &str, err: &str) {
784784
785785
fn error(err: ~str) { io::stdout().write_line(format!("\nerror: {}", err)); }
786786

787-
fn fatal(err: ~str) -> ! { error(err); fail2!(); }
787+
fn fatal(err: ~str) -> ! { error(err); fail!(); }
788788

789789
fn fatal_ProcRes(err: ~str, ProcRes: &ProcRes) -> ! {
790790
let msg =
@@ -802,7 +802,7 @@ stderr:\n\
802802
\n",
803803
err, ProcRes.cmdline, ProcRes.stdout, ProcRes.stderr);
804804
io::stdout().write_str(msg);
805-
fail2!();
805+
fail!();
806806
}
807807

808808
fn _arm_exec_compiled_test(config: &config, props: &TestProps,

src/compiletest/util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn get_os(triple: &str) -> &'static str {
2929
return os
3030
}
3131
}
32-
fail2!("Cannot determine OS from triple");
32+
fail!("Cannot determine OS from triple");
3333
}
3434

3535
pub fn make_new_path(path: &str) -> ~str {
@@ -63,6 +63,6 @@ pub fn path_div() -> ~str { ~":" }
6363
pub fn path_div() -> ~str { ~";" }
6464
6565
pub fn logv(config: &config, s: ~str) {
66-
debug2!("{}", s);
66+
debug!("{}", s);
6767
if config.verbose { io::println(s); }
6868
}

src/libextra/arc.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ impl<T:Send> MutexArc<T> {
255255
let inner = x.unwrap();
256256
let MutexArcInner { failed: failed, data: data, _ } = inner;
257257
if failed {
258-
fail2!("Can't unwrap poisoned MutexArc - another task failed inside!");
258+
fail!("Can't unwrap poisoned MutexArc - another task failed inside!");
259259
}
260260
data
261261
}
@@ -300,9 +300,9 @@ impl<T:Freeze + Send> MutexArc<T> {
300300
fn check_poison(is_mutex: bool, failed: bool) {
301301
if failed {
302302
if is_mutex {
303-
fail2!("Poisoned MutexArc - another task failed inside!");
303+
fail!("Poisoned MutexArc - another task failed inside!");
304304
} else {
305-
fail2!("Poisoned rw_arc - another task failed inside!");
305+
fail!("Poisoned rw_arc - another task failed inside!");
306306
}
307307
}
308308
}
@@ -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+
fail!("Can't unwrap poisoned RWArc - another task failed inside!")
509509
}
510510
data
511511
}
@@ -619,7 +619,7 @@ mod tests {
619619
assert_eq!(arc_v.get()[2], 3);
620620
assert_eq!(arc_v.get()[4], 5);
621621

622-
info2!("{:?}", arc_v);
622+
info!("{:?}", arc_v);
623623
}
624624

625625
#[test]

0 commit comments

Comments
 (0)