Skip to content

Commit 7281647

Browse files
committed
---
yaml --- r: 12111 b: refs/heads/master c: 1d7d5c1 h: refs/heads/master i: 12109: b3ef084 12107: df8d472 12103: fc2a02a 12095: e5dfbeb v: v3
1 parent cbb516a commit 7281647

File tree

7 files changed

+21
-13
lines changed

7 files changed

+21
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ac4294a176f643c9c1f9bb992bf1b2f690499c30
2+
refs/heads/master: 1d7d5c16b375872db6f798e2e4b2f5f8d533dec5
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// -*- rust -*-
22
// Tests that a function with a ! annotation always actually fails
3-
// error-pattern: some control paths may return
43

5-
fn bad_bang(i: uint) -> ! { ret 7u; }
4+
fn bad_bang(i: uint) -> ! {
5+
ret 7u;
6+
//!^ ERROR expected `_|_` but found `uint` (types differ)
7+
}
68

79
fn main() { bad_bang(5u); }
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// -*- rust -*-
22
// Tests that a function with a ! annotation always actually fails
3-
// error-pattern: may return to the caller
43

5-
fn bad_bang(i: uint) -> ! { if i < 0u { } else { fail; } }
4+
fn bad_bang(i: uint) -> ! {
5+
if i < 0u { } else { fail; }
6+
//!^ ERROR expected `_|_` but found `()` (types differ)
7+
}
68

79
fn main() { bad_bang(5u); }
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
// error-pattern: some control paths may return
2-
fn f() -> ! { 3 }
1+
fn f() -> ! {
2+
3 //! ERROR expected `_|_` but found `int` (types differ)
3+
}
34
fn main() { }
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// error-pattern:in non-returning function f, some control paths may return
21
fn g() -> ! { fail; }
3-
fn f() -> ! { ret 42; g(); }
2+
fn f() -> ! {
3+
ret 42; //! ERROR expected `_|_` but found `int` (types differ)
4+
g(); //! WARNING unreachable statement
5+
}
46
fn main() { }
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
// error-pattern:in non-returning function f, some control paths may return
2-
fn f() -> ! { ret 42; fail; }
1+
fn f() -> ! {
2+
ret 42; //! ERROR expected `_|_` but found `int` (types differ)
3+
fail; //! WARNING unreachable statement
4+
}
35
fn main() { }

trunk/src/test/compile-fail/loop-does-not-diverge.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
// error-pattern:some control paths may return
21
/* Make sure a loop{} with a break in it can't be
32
the tailexpr in the body of a diverging function */
43
fn forever() -> ! {
54
loop {
65
break;
76
}
8-
ret 42;
7+
ret 42; //! ERROR expected `_|_` but found `int` (types differ)
98
}
109

1110
fn main() {

0 commit comments

Comments
 (0)