Don't naively point to return type on type error
This commit is contained in:
parent
27d4b314c5
commit
c13a913e5b
12 changed files with 3 additions and 67 deletions
|
|
@ -1,8 +1,6 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-13624.rs:17:5
|
||||
|
|
||||
16 | pub fn get_enum_struct_variant() -> () {
|
||||
| -- expected `()` because of this return type
|
||||
17 | Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
|
||||
|
|
||||
|
|
|
|||
|
|
@ -2,10 +2,7 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-20862.rs:12:5
|
||||
|
|
||||
11 | fn foo(x: i32) {
|
||||
| -
|
||||
| |
|
||||
| possibly return type missing here?
|
||||
| expected `()` because of this default return type
|
||||
| - possibly return type missing here?
|
||||
12 | |y| x + y
|
||||
| ^^^^^^^^^ expected (), found closure
|
||||
|
|
||||
|
|
|
|||
|
|
@ -11,9 +11,6 @@ error[E0277]: the trait bound `{integer}: Scalar` is not satisfied
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-22645.rs:25:3
|
||||
|
|
||||
23 | fn main() {
|
||||
| - expected `()` because of this default return type
|
||||
24 | let b = Bob + 3.5;
|
||||
25 | b + 3 //~ ERROR E0277
|
||||
| ^^^^^ expected (), found struct `Bob`
|
||||
|
|
||||
|
|
|
|||
|
|
@ -8,10 +8,7 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-3563.rs:13:9
|
||||
|
|
||||
12 | fn a(&self) {
|
||||
| -
|
||||
| |
|
||||
| possibly return type missing here?
|
||||
| expected `()` because of this default return type
|
||||
| - possibly return type missing here?
|
||||
13 | || self.b()
|
||||
| ^^^^^^^^^^^ expected (), found closure
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-5500.rs:12:5
|
||||
|
|
||||
11 | fn main() {
|
||||
| - expected `()` because of this default return type
|
||||
12 | &panic!()
|
||||
| ^^^^^^^^^ expected (), found reference
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/unexpected-return-on-unit.rs:19:5
|
||||
|
|
||||
18 | fn bar() {
|
||||
| - expected `()` because of this default return type
|
||||
19 | foo()
|
||||
| ^^^^^ expected (), found usize
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/equality.rs:25:5
|
||||
|
|
||||
21 | fn two(x: bool) -> impl Foo {
|
||||
| -------- expected `i32` because of this return type
|
||||
...
|
||||
25 | 0_u32
|
||||
| ^^^^^ expected i32, found u32
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/abridged.rs:26:5
|
||||
|
|
||||
25 | fn a() -> Foo {
|
||||
| --- expected `Foo` because of this return type
|
||||
26 | Some(Foo { bar: 1 })
|
||||
| ^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `std::option::Option`
|
||||
|
|
||||
|
|
@ -12,8 +10,6 @@ error[E0308]: mismatched types
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/abridged.rs:30:5
|
||||
|
|
||||
29 | fn a2() -> Foo {
|
||||
| --- expected `Foo` because of this return type
|
||||
30 | Ok(Foo { bar: 1})
|
||||
| ^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `std::result::Result`
|
||||
|
|
||||
|
|
@ -23,8 +19,6 @@ error[E0308]: mismatched types
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/abridged.rs:34:5
|
||||
|
|
||||
33 | fn b() -> Option<Foo> {
|
||||
| ----------- expected because of this return type
|
||||
34 | Foo { bar: 1 }
|
||||
| ^^^^^^^^^^^^^^ expected enum `std::option::Option`, found struct `Foo`
|
||||
|
|
||||
|
|
@ -34,8 +28,6 @@ error[E0308]: mismatched types
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/abridged.rs:38:5
|
||||
|
|
||||
37 | fn c() -> Result<Foo, Bar> {
|
||||
| ---------------- expected because of this return type
|
||||
38 | Foo { bar: 1 }
|
||||
| ^^^^^^^^^^^^^^ expected enum `std::result::Result`, found struct `Foo`
|
||||
|
|
||||
|
|
@ -45,8 +37,6 @@ error[E0308]: mismatched types
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/abridged.rs:42:5
|
||||
|
|
||||
41 | fn d() -> X<X<String, String>, String> {
|
||||
| ---------------------------- expected because of this return type
|
||||
42 | / X {
|
||||
43 | | x: X {
|
||||
44 | | x: "".to_string(),
|
||||
|
|
@ -62,8 +52,6 @@ error[E0308]: mismatched types
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/abridged.rs:52:5
|
||||
|
|
||||
51 | fn e() -> X<X<String, String>, String> {
|
||||
| ---------------------------- expected because of this return type
|
||||
52 | / X {
|
||||
53 | | x: X {
|
||||
54 | | x: "".to_string(),
|
||||
|
|
|
|||
|
|
@ -2,10 +2,7 @@ error[E0308]: mismatched types
|
|||
--> $DIR/issue-19109.rs:14:5
|
||||
|
|
||||
13 | fn function(t: &mut Trait) {
|
||||
| -
|
||||
| |
|
||||
| help: possibly return type missing here? `-> *mut Trait `
|
||||
| expected `()` because of this default return type
|
||||
| - help: possibly return type missing here? `-> *mut Trait `
|
||||
14 | t as *mut Trait
|
||||
| ^^^^^^^^^^^^^^^ expected (), found *-ptr
|
||||
|
|
||||
|
|
|
|||
|
|
@ -34,9 +34,6 @@ error[E0425]: cannot find function `is_directory` in this scope
|
|||
error[E0308]: mismatched types
|
||||
--> $DIR/token-error-correct-3.rs:25:13
|
||||
|
|
||||
20 | -> io::Result<bool> {
|
||||
| ---------------- expected `()` because of this return type
|
||||
...
|
||||
25 | fs::create_dir_all(path.as_ref()).map(|()| true) //~ ERROR: mismatched types
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: did you mean to add a semicolon here? `;`
|
||||
| |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue