Skip to content

Commit 8e11189

Browse files
committed
Move tests to ui
1 parent 229d0d3 commit 8e11189

27 files changed

+269
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/block-must-not-have-result-do.rs:13:9
3+
|
4+
13 | true //~ ERROR mismatched types
5+
| ^^^^ expected (), found bool
6+
|
7+
= note: expected type `()`
8+
found type `bool`
9+
10+
error: aborting due to previous error(s)
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/block-must-not-have-result-res.rs:15:9
3+
|
4+
15 | true //~ ERROR mismatched types
5+
| ^^^^ expected (), found bool
6+
|
7+
= note: expected type `()`
8+
found type `bool`
9+
10+
error: aborting due to previous error(s)
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/block-must-not-have-result-while.rs:13:9
3+
|
4+
13 | true //~ ERROR mismatched types
5+
| ^^^^ expected (), found bool
6+
|
7+
= note: expected type `()`
8+
found type `bool`
9+
10+
error: aborting due to previous error(s)
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/consider-removing-last-semi.rs:11:18
3+
|
4+
11 | fn f() -> String { //~ ERROR mismatched types
5+
| __________________^
6+
12 | | 0u8;
7+
13 | | "bla".to_string(); //~ HELP consider removing this semicolon
8+
14 | | }
9+
| |_^ expected struct `std::string::String`, found ()
10+
|
11+
= note: expected type `std::string::String`
12+
found type `()`
13+
help: consider removing this semicolon:
14+
--> $DIR/consider-removing-last-semi.rs:13:22
15+
|
16+
13 | "bla".to_string(); //~ HELP consider removing this semicolon
17+
| ^
18+
19+
error[E0308]: mismatched types
20+
--> $DIR/consider-removing-last-semi.rs:16:18
21+
|
22+
16 | fn g() -> String { //~ ERROR mismatched types
23+
| __________________^
24+
17 | | "this won't work".to_string();
25+
18 | | "removeme".to_string(); //~ HELP consider removing this semicolon
26+
19 | | }
27+
| |_^ expected struct `std::string::String`, found ()
28+
|
29+
= note: expected type `std::string::String`
30+
found type `()`
31+
help: consider removing this semicolon:
32+
--> $DIR/consider-removing-last-semi.rs:18:27
33+
|
34+
18 | "removeme".to_string(); //~ HELP consider removing this semicolon
35+
| ^
36+
37+
error: aborting due to previous error(s)
38+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
error[E0601]: main function not found
2+
3+
error: aborting due to previous error(s)
4+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-11714.rs:11:18
3+
|
4+
11 | fn blah() -> i32 { //~ ERROR mismatched types
5+
| __________________^
6+
12 | | 1
7+
13 | |
8+
14 | | ; //~ HELP consider removing this semicolon:
9+
15 | | }
10+
| |_^ expected i32, found ()
11+
|
12+
= note: expected type `i32`
13+
found type `()`
14+
help: consider removing this semicolon:
15+
--> $DIR/issue-11714.rs:14:5
16+
|
17+
14 | ; //~ HELP consider removing this semicolon:
18+
| ^
19+
20+
error: aborting due to previous error(s)
21+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-13428.rs:13:20
3+
|
4+
13 | fn foo() -> String { //~ ERROR mismatched types
5+
| ____________________^
6+
14 | | format!("Hello {}",
7+
15 | | "world")
8+
16 | | // Put the trailing semicolon on its own line to test that the
9+
17 | | // note message gets the offending semicolon exactly
10+
18 | | ; //~ HELP consider removing this semicolon
11+
19 | | }
12+
| |_^ expected struct `std::string::String`, found ()
13+
|
14+
= note: expected type `std::string::String`
15+
found type `()`
16+
help: consider removing this semicolon:
17+
--> $DIR/issue-13428.rs:18:5
18+
|
19+
18 | ; //~ HELP consider removing this semicolon
20+
| ^
21+
22+
error[E0308]: mismatched types
23+
--> $DIR/issue-13428.rs:21:20
24+
|
25+
21 | fn bar() -> String { //~ ERROR mismatched types
26+
| ____________________^
27+
22 | | "foobar".to_string()
28+
23 | | ; //~ HELP consider removing this semicolon
29+
24 | | }
30+
| |_^ expected struct `std::string::String`, found ()
31+
|
32+
= note: expected type `std::string::String`
33+
found type `()`
34+
help: consider removing this semicolon:
35+
--> $DIR/issue-13428.rs:23:5
36+
|
37+
23 | ; //~ HELP consider removing this semicolon
38+
| ^
39+
40+
error: aborting due to previous error(s)
41+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-13624.rs:17:5
3+
|
4+
17 | Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
6+
|
7+
= note: expected type `()`
8+
found type `a::Enum`
9+
10+
error[E0308]: mismatched types
11+
--> $DIR/issue-13624.rs:32:9
12+
|
13+
32 | a::Enum::EnumStructVariant { x, y, z } => {
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
15+
|
16+
= note: expected type `()`
17+
found type `a::Enum`
18+
19+
error: aborting due to previous error(s)
20+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-20862.rs:12:5
3+
|
4+
12 | |y| x + y
5+
| ^^^^^^^^^ expected (), found closure
6+
|
7+
= note: expected type `()`
8+
found type `[closure@$DIR/issue-20862.rs:12:5: 12:14 x:_]`
9+
10+
error[E0618]: expected function, found `()`
11+
--> $DIR/issue-20862.rs:17:13
12+
|
13+
17 | let x = foo(5)(2);
14+
| ^^^^^^^^^
15+
16+
error: aborting due to previous error(s)
17+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error[E0277]: the trait bound `{integer}: Scalar` is not satisfied
2+
--> $DIR/issue-22645.rs:25:5
3+
|
4+
25 | b + 3 //~ ERROR E0277
5+
| ^ the trait `Scalar` is not implemented for `{integer}`
6+
|
7+
= help: the following implementations were found:
8+
<f64 as Scalar>
9+
= note: required because of the requirements on the impl of `std::ops::Add<{integer}>` for `Bob`
10+
11+
error[E0308]: mismatched types
12+
--> $DIR/issue-22645.rs:25:3
13+
|
14+
25 | b + 3 //~ ERROR E0277
15+
| ^^^^^ expected (), found struct `Bob`
16+
|
17+
= note: expected type `()`
18+
found type `Bob`
19+
20+
error: aborting due to previous error(s)
21+
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0599]: no method named `b` found for type `&Self` in the current scope
2+
--> $DIR/issue-3563.rs:13:17
3+
|
4+
13 | || self.b()
5+
| ^
6+
7+
error[E0308]: mismatched types
8+
--> $DIR/issue-3563.rs:13:9
9+
|
10+
13 | || self.b()
11+
| ^^^^^^^^^^^ expected (), found closure
12+
|
13+
= note: expected type `()`
14+
found type `[closure@$DIR/issue-3563.rs:13:9: 13:20 self:_]`
15+
16+
error: aborting due to previous error(s)
17+
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-5500.rs:12:5
3+
|
4+
12 | &panic!()
5+
| ^^^^^^^^^ expected (), found reference
6+
|
7+
= note: expected type `()`
8+
found type `&_`
9+
10+
error: aborting due to previous error(s)
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Test that we do some basic error correcton in the tokeniser (and don't spew
12+
// too many bogus errors).
13+
14+
fn foo() -> usize {
15+
3
16+
}
17+
18+
fn bar() {
19+
foo()
20+
}
21+
22+
fn main() {
23+
bar()
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/unexpected-return-on-unit.rs:19:5
3+
|
4+
19 | foo()
5+
| ^^^^^ expected (), found usize
6+
|
7+
= note: expected type `()`
8+
found type `usize`
9+
10+
error: aborting due to previous error(s)
11+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/for-loop-has-unit-body.rs:13:9
3+
|
4+
13 | x //~ ERROR mismatched types
5+
| ^ expected (), found integral variable
6+
|
7+
= note: expected type `()`
8+
found type `{integer}`
9+
10+
error: aborting due to previous error(s)
11+

0 commit comments

Comments
 (0)