diff --git a/src/test/compile-fail/bad-bang-ann-3.rs b/src/test/compile-fail/bad-bang-ann-3.rs index 2ba862ff57f7..ded6f62a6dd8 100644 --- a/src/test/compile-fail/bad-bang-ann-3.rs +++ b/src/test/compile-fail/bad-bang-ann-3.rs @@ -1,7 +1,9 @@ // -*- rust -*- // Tests that a function with a ! annotation always actually fails -// error-pattern: some control paths may return -fn bad_bang(i: uint) -> ! { ret 7u; } +fn bad_bang(i: uint) -> ! { + ret 7u; + //!^ ERROR expected `_|_` but found `uint` (types differ) +} fn main() { bad_bang(5u); } diff --git a/src/test/compile-fail/bad-bang-ann.rs b/src/test/compile-fail/bad-bang-ann.rs index e67013998a1c..f5ec75c59fa9 100644 --- a/src/test/compile-fail/bad-bang-ann.rs +++ b/src/test/compile-fail/bad-bang-ann.rs @@ -1,7 +1,9 @@ // -*- rust -*- // Tests that a function with a ! annotation always actually fails -// error-pattern: may return to the caller -fn bad_bang(i: uint) -> ! { if i < 0u { } else { fail; } } +fn bad_bang(i: uint) -> ! { + if i < 0u { } else { fail; } + //!^ ERROR expected `_|_` but found `()` (types differ) +} fn main() { bad_bang(5u); } diff --git a/src/test/compile-fail/bang-tailexpr.rs b/src/test/compile-fail/bang-tailexpr.rs index d13fca4486c5..20b147cb5e33 100644 --- a/src/test/compile-fail/bang-tailexpr.rs +++ b/src/test/compile-fail/bang-tailexpr.rs @@ -1,3 +1,4 @@ -// error-pattern: some control paths may return -fn f() -> ! { 3 } +fn f() -> ! { + 3 //! ERROR expected `_|_` but found `int` (types differ) +} fn main() { } diff --git a/src/test/compile-fail/issue-897-2.rs b/src/test/compile-fail/issue-897-2.rs index b2b0c0d3597d..9b8f85fc6686 100644 --- a/src/test/compile-fail/issue-897-2.rs +++ b/src/test/compile-fail/issue-897-2.rs @@ -1,4 +1,6 @@ -// error-pattern:in non-returning function f, some control paths may return fn g() -> ! { fail; } -fn f() -> ! { ret 42; g(); } +fn f() -> ! { + ret 42; //! ERROR expected `_|_` but found `int` (types differ) + g(); //! WARNING unreachable statement +} fn main() { } diff --git a/src/test/compile-fail/issue-897.rs b/src/test/compile-fail/issue-897.rs index 7a27b0e51fd5..6521f5159a92 100644 --- a/src/test/compile-fail/issue-897.rs +++ b/src/test/compile-fail/issue-897.rs @@ -1,3 +1,5 @@ -// error-pattern:in non-returning function f, some control paths may return -fn f() -> ! { ret 42; fail; } +fn f() -> ! { + ret 42; //! ERROR expected `_|_` but found `int` (types differ) + fail; //! WARNING unreachable statement +} fn main() { } diff --git a/src/test/compile-fail/loop-does-not-diverge.rs b/src/test/compile-fail/loop-does-not-diverge.rs index 3d2d70fbab8e..eaaa4ecc9fb6 100644 --- a/src/test/compile-fail/loop-does-not-diverge.rs +++ b/src/test/compile-fail/loop-does-not-diverge.rs @@ -1,11 +1,10 @@ -// error-pattern:some control paths may return /* Make sure a loop{} with a break in it can't be the tailexpr in the body of a diverging function */ fn forever() -> ! { loop { break; } - ret 42; + ret 42; //! ERROR expected `_|_` but found `int` (types differ) } fn main() {