Skip to content

Commit 7f523e7

Browse files
author
Jakub Bukaj
committed
Update tests with the new error messages
1 parent cca84e9 commit 7f523e7

19 files changed

+45
-33
lines changed

src/test/compile-fail/bad-bang-ann-3.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
// Tests that a function with a ! annotation always actually fails
1212

1313
fn bad_bang(i: uint) -> ! {
14-
return 7u;
15-
//~^ ERROR expected `!`, found `uint`
14+
return 7u; //~ ERROR `return` in a function declared as diverging [E0166]
1615
}
1716

1817
fn main() { bad_bang(5u); }

src/test/compile-fail/bad-bang-ann.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010

1111
// Tests that a function with a ! annotation always actually fails
1212

13-
fn bad_bang(i: uint) -> ! {
13+
fn bad_bang(i: uint) -> ! { //~ ERROR computation may converge in a function marked as diverging
1414
if i < 0u { } else { fail!(); }
15-
//~^ ERROR expected `!`, found `()`
1615
}
1716

1817
fn main() { bad_bang(5u); }

src/test/compile-fail/bang-tailexpr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
fn f() -> ! {
12-
3i //~ ERROR expected `!`, found `int`
11+
fn f() -> ! { //~ ERROR computation may converge in a function marked as diverging
12+
3i
1313
}
1414
fn main() { }

src/test/run-fail/binop-fail-3.rs renamed to src/test/compile-fail/binop-fail-3.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:quux
1211
fn foo() -> ! { fail!("quux"); }
13-
fn main() { foo() == foo(); }
12+
fn main() {
13+
foo() //~ ERROR the type of this value must be known in this context
14+
==
15+
foo();
16+
}

src/test/compile-fail/closure-that-fails.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414
// Type inference didn't use to be able to handle this:
1515
foo(|| fail!());
1616
foo(|| -> ! fail!());
17-
foo(|| 22); //~ ERROR mismatched types
18-
foo(|| -> ! 22); //~ ERROR mismatched types
19-
let x = || -> ! 1; //~ ERROR mismatched types
17+
foo(|| 22i); //~ ERROR computation may converge in a function marked as diverging
18+
foo(|| -> ! 22i); //~ ERROR computation may converge in a function marked as diverging
19+
let x = || -> ! 1i; //~ ERROR computation may converge in a function marked as diverging
2020
}

src/test/compile-fail/index-bot.rs

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

1111
fn main() {
12-
(return)[0u]; //~ ERROR cannot index a value of type `!`
12+
(return)[0u]; //~ ERROR the type of this value must be known in this context
1313
}

src/test/compile-fail/issue-13847.rs

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

1111
fn main() {
12-
return.is_failure //~ ERROR unconstrained type variable
12+
return.is_failure //~ ERROR the type of this value must be known in this context
1313
}

src/test/compile-fail/issue-15207.rs

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

1111
fn main() {
12-
loop { break.push(1); } //~ ERROR type `!` does not implement any method in scope named `push`
12+
loop {
13+
break.push(1) //~ ERROR the type of this value must be known in this context
14+
//~^ ERROR multiple applicable methods in scope
15+
;
16+
}
1317
}

src/test/compile-fail/issue-15965.rs

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

1111
fn main() {
12-
return { return () } (); //~ ERROR expected function, found `!`
12+
return
13+
{ return () } //~ ERROR the type of this value must be known in this context
14+
() //~^ ERROR the type of this value must be known in this context
15+
//~^^ ERROR notation; the first type parameter for the function trait is neither a tuple nor unit
16+
//~^^^ ERROR overloaded calls are experimental
17+
;
1318
}

src/test/compile-fail/issue-17373.rs

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

1111
fn main() {
12-
*return; //~ ERROR type `!` cannot be dereferenced
12+
*return //~ ERROR the type of this value must be known in this context
13+
;
1314
}

0 commit comments

Comments
 (0)