Skip to content

Commit 73ef372

Browse files
committed
run rustfmt on test/run-fail folder
1 parent 97e3a24 commit 73ef372

Some content is hidden

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

54 files changed

+278
-107
lines changed

src/test/run-fail/args-panic.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
#![allow(unknown_features)]
1515
#![feature(box_syntax)]
1616

17-
fn f(_a: isize, _b: isize, _c: Box<isize>) { panic!("moop"); }
17+
fn f(_a: isize, _b: isize, _c: Box<isize>) {
18+
panic!("moop");
19+
}
1820

19-
fn main() { f(1, panic!("meep"), box 42); }
21+
fn main() {
22+
f(1, panic!("meep"), box 42);
23+
}

src/test/run-fail/assert-eq-macro-panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
// error-pattern:assertion failed: `(left == right)` (left: `14`, right: `15`)
1212

1313
fn main() {
14-
assert_eq!(14,15);
14+
assert_eq!(14, 15);
1515
}

src/test/run-fail/binop-fail-3.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
// except according to those terms.
1010

1111
// error-pattern:quux
12-
fn foo() -> ! { panic!("quux"); }
12+
fn foo() -> ! {
13+
panic!("quux");
14+
}
1315
fn main() {
1416
foo() == foo(); // these types wind up being defaulted to ()
1517
}

src/test/run-fail/binop-panic.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@
99
// except according to those terms.
1010

1111
// error-pattern:quux
12-
fn my_err(s: String) -> ! { println!("{}", s); panic!("quux"); }
13-
fn main() { 3_usize == my_err("bye".to_string()); }
12+
fn my_err(s: String) -> ! {
13+
println!("{}", s);
14+
panic!("quux");
15+
}
16+
fn main() {
17+
3_usize == my_err("bye".to_string());
18+
}

src/test/run-fail/bug-2470-bounds-check-overflow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ fn main() {
2020
// address of the 0th cell in the array (even though the index is
2121
// huge).
2222

23-
let x = vec!(1_usize,2_usize,3_usize);
23+
let x = vec![1_usize, 2_usize, 3_usize];
2424

2525
let base = x.as_ptr() as usize;
2626
let idx = base / mem::size_of::<usize>();
2727
println!("ov1 base = 0x{:x}", base);
2828
println!("ov1 idx = 0x{:x}", idx);
2929
println!("ov1 sizeof::<usize>() = 0x{:x}", mem::size_of::<usize>());
3030
println!("ov1 idx * sizeof::<usize>() = 0x{:x}",
31-
idx * mem::size_of::<usize>());
31+
idx * mem::size_of::<usize>());
3232

3333
// This should panic.
3434
println!("ov1 0x{:x}", x[idx]);

src/test/run-fail/bug-811.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
use std::marker::PhantomData;
1414

15-
fn test00_start(ch: chan_t<isize>, message: isize) { send(ch, message); }
15+
fn test00_start(ch: chan_t<isize>, message: isize) {
16+
send(ch, message);
17+
}
1618

1719
type task_id = isize;
1820
type port_id = isize;
@@ -23,6 +25,10 @@ struct chan_t<T> {
2325
marker: PhantomData<*mut T>,
2426
}
2527

26-
fn send<T:Send>(_ch: chan_t<T>, _data: T) { panic!(); }
28+
fn send<T: Send>(_ch: chan_t<T>, _data: T) {
29+
panic!();
30+
}
2731

28-
fn main() { panic!("quux"); }
32+
fn main() {
33+
panic!("quux");
34+
}

src/test/run-fail/doublepanic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#![allow(unreachable_code)]
1212

13-
//error-pattern:One
13+
// error-pattern:One
1414
fn main() {
1515
panic!("One");
1616
panic!("Two");

src/test/run-fail/explicit-panic-msg.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
// error-pattern:wooooo
1515
fn main() {
1616
let mut a = 1;
17-
if 1 == 1 { a = 2; }
17+
if 1 == 1 {
18+
a = 2;
19+
}
1820
panic!(format!("woooo{}", "o"));
1921
}

src/test/run-fail/explicit-panic.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212

1313

1414
// error-pattern:explicit
15-
fn main() { panic!(); }
15+
fn main() {
16+
panic!();
17+
}

src/test/run-fail/expr-fn-panic.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
// error-pattern:explicit panic
1212

13-
fn f() -> ! { panic!() }
13+
fn f() -> ! {
14+
panic!()
15+
}
1416

15-
fn main() { f(); }
17+
fn main() {
18+
f();
19+
}

0 commit comments

Comments
 (0)