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